Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

(Solved) libvirt.img crash, how to restore VM

Featured Replies

Hey everyone,

 

So, I hadn't touched my UnRaid setup for a while, and when I wanted to fire up my gaming VM, things didn't go as planned.

The libvirt.img file refused to boot up, and even when I tried to restore it from my backup, no luck there (pretty sure it was fine when I made the backup).

 

After that, I attempted to recover the VM using the vdisk and XML. But when I modified the XML by setting up a new VM, the whole system just getting stuck in an endless loop and the VM server page is frozen. I had to resort to opening a new incognito browser window just to get back in.

 

Later on, I decided to upgrade the server to version 6.12.11, hoping it would fix things. Unfortunately, the issue persisted.

 

Appreciate any help in advance.

 

unraid-diagnostics-20240821-2127.zip

Edited by a24425311
solved

Solved by a24425311

  • Community Expert

Libvirt mounted at first boot, but then it didn't unmount cleanly so it couldn't start again, if you still have a backup, disable VM service, reboot, restore the libvirt backup, re-enable VM service and post new diags.

  • Author

Thanks, it can now show the VM but the previous Libvirt still failed to load so I created a new Libvirt but now I stuck at VFIO_MAP_DMA failed message (pass through failed also can't even boot up the vdisk with VNC. 🤕

 

unraid-diagnostics-20240822-2140.zip

Edited by a24425311

  • Community Expert
1 hour ago, a24425311 said:

but the previous Libvirt still failed to load

Not sure I follow, if it showed the VM, libvirt must have loaded.

  • Author
1 hour ago, JorgeB said:

Not sure I follow, if it showed the VM, libvirt must have loaded.

My bad, the VM was showing after recreating the libvirt since the old one failed to load.

  • Community Expert

OK, the libvirt you tried to use after boot is corrupt:

 

Aug 22 20:47:51 UnRaid kernel: BTRFS error (device loop3): bad fsid on logical 22036480 mirror 1
Aug 22 20:47:51 UnRaid kernel: BTRFS error (device loop3): bad fsid on logical 22036480 mirror 2
Aug 22 20:47:51 UnRaid kernel: BTRFS error (device loop3): failed to read chunk root

 

Assuming that is the backup, best bet it to create a new image, them create a new VM with the same settings and point to the existing vdisk, but that doesn't always work, so it's important to have a good backup of libvirt.

  • Author
  • Solution

Solved

 

I don't know how I did it though.

 

1. I recreated the libvirt file

2. create a new VM, I changed the backup vdisk file name to Windows 11 (mine wasn't) and pointed to the backup vdisk with the same CPU cores + RAM setting  + Machine setting based on my old XML (I did not remember any other of my other setting anyway)

3. also I've mounted the Windows image file

4. it takes a while but magic happens.

  • a24425311 changed the title to (Solved) libvirt.img crash, how to restore VM

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.