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.

Libvirt Service failed to start

Featured Replies

9 hours ago, stefan.tomko said:

When I faced libvirt issues, I could not start VM services at all. For me, it worked by deleting the libvirt.img (on settings - VM tab, once you stop VM service, there should be button to delete libvirt). It will be recreated upon VM service start.

You can backup VM XML, since after libvirt deletition, VMs will be gone. But this is just VM definition, virtual disks are still there, you just need to create VM again, assign old disk, RAM, etc.

 

What's the proper step to back up my VM xml, just copy and paste?

  • Replies 114
  • Views 84.1k
  • Created
  • Last Reply

Top Posters In This Topic

Most Popular Posts

  • Please post your diagnostics: Tools -> Diagnostics

  • Had the same error and it disappeared after a server restart. I also used the default configuration (Flash -> Syslinux configuration -> Default button). Though, the two errors and the warnings i

  • Then change the entry to be /mnt/user/system/libvirt.img

Posted Images

If you navigate to where you edit your VM - top right, there is possibility to show XML view. Once you toggle it, it shows XML configuration. You should be able to just copy paste it, so when you need to recreate it, you can just paste it there. 

Truth is, unless you are doing something fancy, you really need to pick up just where your VM disk is (usually /mnt/user/domains/xxx), perhaps core assignment, network card type and perhaps MAC address (if you rely on DHCP)

On 1/24/2025 at 9:08 PM, Linguafoeda said:

I just went into settings, stopped VM then tried to turn it on again and now am back to square 1 of the error message "Libvirt Service failed to start."

 

 

this person above is also seemingly having same issue and claiming he has to do a fresh install of unraid to fix it (has tried to recreate his libvirt image 3 times and failed). I'd really like to avoid a fresh unraid install if possible. I haven't done anything to touch my libvirt file - i'm assuming that will be the next step? and figure out why my server is not properly restarting requiring a physical power off and power on for me to restart the server.

That Reddit topic is mine. Apparently I had two issues. One was with USB (already solved) and another is still with VM manager. The behavior is like I described. When I boot Unraid everything is working fine. I can do whatever I want...  start and stop VMs etc.

 

If I go Settings -> VM Manager -> Enable VMs and I set it to OFF and afterwards I set it to ON, VM does not start at all and in the VM tab I have error message "Libvirt Service failed to start" and after short time whole webGUI is not available anymore.

 

However Docker containers seems to be still running. But I am not able to restart Unraid over webGUI. Short press of power button works if I press it till certain time after error is occurred. If it is in that "dead mode" longer I am not able to turn it off with short press of button. So only long press of power button is working or remotely over smart plug.

 

I can confirm that I created several times new libvirt.img. I did also "fresh" Unraid installation because I was not sure if change of HW could somehow influence it and it was driving me crazy. But something was telling me that since it is registering every boot every HW change it will not help and it confirmed me.

 

So if I directly after change restart Unraid, once it is booted up everything is working correctly again.

In "Libvirt volume info" I do not see any errors.

 

I have one more thing related to the webGUI. Once Unraid is booted up and I enter Passphrase after few seconds webGUI completely disappear (similar like when VM Manager is enabled again) and I need to wait something like minute or more until it is accessible again. I am not sure if it is normal or it could be somehow connected.

 

I am attaching diagnostics files: Start of Unraid, VM Manager OFF and the last VM Manager ON (already with error).

 

EDIT: I was just near of my server and was surprised how intensive are HDDs working. Afterwards I checked shared settings and I found that all of my shares are set to "Array". I am not sure when this change happened but I did not make this change intentionally. So it has to do something with reinstall or with an error. But when I set in shares SSD (my "cache" / Pool name) and start Mover nothing is happening.

 

Since I do not have time anymore to tinker with it and I have all my data backed up I decided that I will make one more time new "installation" this time I will format also all the drives. So after installation everything with Mover must be correct and the only issue should be probably the VM manager. 

 

meshius-diagnostics-20250125-2202-Start.zip meshius-diagnostics-20250125-2203-VM_Manager_OFF.zip meshius-diagnostics-20250125-2203-VM_Manager_ON.zip

Edited by ELP1

  • 2 months later...

still having this major issue with VM crashing eventually and causing entire system to hang, thus not able to restart and have to manually power cycle. i haven't done anything to my libvirt image or replaced my VM .xmls.

 

I have a few questions:

1. Is there any risk to deleting the libvirt image file?

2. is literally copy and pasting the xml file into word then re-pasting it back in after the libvirt delete keep things exactly as they were, no extra steps needed?

3. is there any way to troubleshoot the Unraid USB to know if the flash drive is causing issues?

 

@ELP1 were you able to ever fix your similar issue to mine?

Edited by Linguafoeda

On 4/9/2025 at 4:21 PM, Linguafoeda said:

still having this major issue with VM crashing eventually and causing entire system to hang, thus not able to restart and have to manually power cycle. i haven't done anything to my libvirt image or replaced my VM .xmls.

 

I have a few questions:

1. Is there any risk to deleting the libvirt image file?

2. is literally copy and pasting the xml file into word then re-pasting it back in after the libvirt delete keep things exactly as they were, no extra steps needed?

3. is there any way to troubleshoot the Unraid USB to know if the flash drive is causing issues?

 

@ELP1 were you able to ever fix your similar issue to mine?

Hi,

I did clean installation of Unraid and it started to work.

  • 2 weeks later...
On 4/9/2025 at 10:21 AM, Linguafoeda said:

still having this major issue with VM crashing eventually and causing entire system to hang, thus not able to restart and have to manually power cycle. i haven't done anything to my libvirt image or replaced my VM .xmls.

 

I have a few questions:

1. Is there any risk to deleting the libvirt image file?

2. is literally copy and pasting the xml file into word then re-pasting it back in after the libvirt delete keep things exactly as they were, no extra steps needed?

3. is there any way to troubleshoot the Unraid USB to know if the flash drive is causing issues?

 

@ELP1 were you able to ever fix your similar issue to mine?

 

wanted to bump this re- the questions above?

2 hours ago, Linguafoeda said:

Is there any risk to deleting the libvirt image file?

You will lose the currently configured VMs, you should always have a goof backup of that file.

  • 2 months later...
On 4/20/2025 at 4:30 AM, JorgeB said:

You will lose the currently configured VMs, you should always have a goof backup of that file.

Hi - just wanted to update on this. i finally got around to attempting to recreate my libvirt and came across a whole host of issues.

  1. I initially had created a OVMF TPM bios for my windows so i could update to 2H22...when i recreated my libvirt.img and pasted the backed up XML....I think this is related to the .fd files in /etc/libvirt/qemu/nvram/, because i got error message: operation failed: unable to find any master var store for loader: /usr/share/qemu/ovmf-x64/OVMF_CODE-pure-efi-tpm.fd

  2. Then i had some sort of device issue which i believe is related to intel gvt-g plugin i'm using to accelerate the VM?

    device not found: mediated device '5b1865eb-1ab5-4e5a-xxxx-be46c922xxxx' not found

At this point, i reverted back because i think i'm whack a moling a bunch of issues. any idea what else i should be aware of since it seems not so simple to just delete libvirt and re-paste XML.

One question i have - if i don't have the backup .fd files for OVMF TPM, is it possible to easily recreate TPM files to use my old Win11 vdisk?

4 hours ago, Linguafoeda said:

One question i have - if i don't have the backup .fd files for OVMF TPM, is it possible to easily recreate TPM files to use my old Win11 vdisk?

yes, just create a new VM with the same settings, it ll use a new nvram then, BUT be aware if you use bitlocker ...

then you need your key to unlock the drive !!! thats it, in terms its activated, may disable bitlocker (decrypt), recreate your libvirt, startup fresh, then you can enable it again.

or write down your bitlocker keys, you will be asked on boot therefore.

1 hour ago, alturismo said:

yes, just create a new VM with the same settings, it ll use a new nvram then, BUT be aware if you use bitlocker ...

then you need your key to unlock the drive !!! thats it, in terms its activated, may disable bitlocker (decrypt), recreate your libvirt, startup fresh, then you can enable it again.

or write down your bitlocker keys, you will be asked on boot therefore.

Don't believe i use bitlocker, though when i attempted to start the libvirt i got the above error message?

My VM actually just crashed while using it to import music into itunes, causing unraid to almost completely freeze. below is the gist:

Gist
No image preview

gist:c38c104eb9da46f62a8d5cab73f90219

GitHub Gist: instantly share code, notes, and snippets.

okay i got this working and was able to recreate the libvirt image. below were the steps:

  1. backup my libvirt.img, Windows vdisk.img and /etc/libvirt/qemu/nvram (had two .fd files, one for win11 VM with UUID matching the WIn11 XML and one for my macOS VM)

  2. Copy and paste the XML into notepad from my existing VMs

  3. Turn off VM in settings -> VM Manager

  4. Use Krusader or MC to delete libvirt.img in mnt/user/system/libvirt

  5. Turn on VM in settings -> VM Manager

  6. Copy the two .fd files from step 1 back to /etc/libvirt/qemu/nvram

  7. Go to VM tab -> add VM -> WIndows 11 (so i get proper logo) -> form view switch on top right -> paste the XML for my previous Win11 VM saved in step 2

  8. At this stage, if i try to launch the VM, it gives me an error "device not found: mediated device 'XXXX-XXXX-XXXX-XXXX-XXXX' not found" which relates to the Intel GPU acceleration

  9. Go to settings -> intel gvt-g plugin settings, delete the existing assignment in the bottom drop-down then in the middle dropdown ("To create another vGPU assignment for 0000:00:02.0 select mode and VM:"), I selected "i915-GVTg_V5_4" and assigned it to the Windows 11 VM i added in step 7

  10. Start VM like normal (i use "Remote Desktop Connection" and "Anydesk" to connect)

note my libvirt log still have a few errors below but i'll monitor my VM over the next few days/weeks to see if it causes a failure / crash like original post

2025-07-11 03:53:47.801+0000: 271492: warning : qemuTPMVirCommandSwtpmAddTPMState:634 : This swtpm version doesn't support explicit locking

2025-07-11 03:53:49.832+0000: 271492: warning : qemuDomainObjTaintMsg:5481 : Domain id=5 name='Windows' uuid=XXXX-XXXX-XXXX-XXXX-XXXX is tainted: high-privileges

2025-07-11 04:00:59.367+0000: 271494: error : qemuRdpNewForHelper:103 : 'qemu-rdp' is not a suitable qemu-rdp helper name: No such file or directory

ugh - i was moving tabs around in chrome and my windows 11 VM crashed again, and same issue as original....main unraid GUI is now extremely unstable (will not load the VM tab, the main dashboard takes 2-3 minutes to load the docker containers and my VM section is now MISSING the windows VM from the list....). I wont be able to restart the Unraid machine without a physical hard reset of the button (which is difficult because im not physically located next to my server).

So re-creating libvirt did nothing for me. what do i do now to troubleshoot this....is this is a windows 11 VM issue itself that is causing some massive failure that doesn't allow libvirt to work again after it crashes and now requires a physical hard reset?

Note - i have 32GB RAM and Core i7-10700T and have otherwise before never had issues with allocating 8GB RAM / all cores/threads to my Win11 VM to function with much more intensive programs running (vs. chrome with 50 or so tabs open when it just now crashed)

Libvirt Log:

2025-07-11 05:04:21.655+0000: 271495: warning : virDomainObjBeginJobInternal:434 : Cannot start job (query, none, none) in API remoteDispatchDomainGetXMLDesc for domain Windows; current job is (query, none, none) owned by (271492 remoteDispatchConnectGetAllDomainStats, 0 <null>, 0 <null> (flags=0x0)) for (165s, 0s, 0s)

2025-07-11 05:04:21.655+0000: 271495: error : virDomainObjBeginJobInternal:468 : Timed out during operation: cannot acquire state change lock (held by monitor=remoteDispatchConnectGetAllDomainStats)

2025-07-11 05:04:51.656+0000: 271494: warning : virDomainObjBeginJobInternal:434 : Cannot start job (query, none, none) in API remoteDispatchDomainGetXMLDesc for domain Windows; current job is (query, none, none) owned by (271492 remoteDispatchConnectGetAllDomainStats, 0 <null>, 0 <null> (flags=0x0)) for (195s, 0s, 0s)

2025-07-11 05:04:51.656+0000: 271494: error : virDomainObjBeginJobInternal:468 : Timed out during operation: cannot acquire state change lock (held by monitor=remoteDispatchConnectGetAllDomainStats)

2025-07-11 05:05:21.656+0000: 271493: warning : virDomainObjBeginJobInternal:434 : Cannot start job (query, none, none) in API remoteDispatchDomainGetXMLDesc for domain Windows; current job is (query, none, none) owned by (271492 remoteDispatchConnectGetAllDomainStats, 0 <null>, 0 <null> (flags=0x0)) for (225s, 0s, 0s)

2025-07-11 05:05:21.656+0000: 271493: error : virDomainObjBeginJobInternal:468 : Timed out during operation: cannot acquire state change lock (held by monitor=remoteDispatchConnectGetAllDomainStats)

2025-07-11 05:05:51.656+0000: 271496: warning : virDomainObjBeginJobInternal:434 : Cannot start job (query, none, none) in API remoteDispatchDomainGetXMLDesc for domain Windows; current job is (query, none, none) owned by (271492 remoteDispatchConnectGetAllDomainStats, 0 <null>, 0 <null> (flags=0x0)) for (255s, 0s, 0s)

2025-07-11 05:05:51.656+0000: 271496: error : virDomainObjBeginJobInternal:468 : Timed out during operation: cannot acquire state change lock (held by monitor=remoteDispatchConnectGetAllDomainStats)

2025-07-11 05:06:21.656+0000: 271495: warning : virDomainObjBeginJobInternal:434 : Cannot start job (query, none, none) in API remoteDispatchDomainGetXMLDesc for domain Windows; current job is (query, none, none) owned by (271492 remoteDispatchConnectGetAllDomainStats, 0 <null>, 0 <null> (flags=0x0)) for (285s, 0s, 0s)

2025-07-11 05:06:21.656+0000: 271495: error : virDomainObjBeginJobInternal:468 : Timed out during operation: cannot acquire state change lock (held by monitor=remoteDispatchConnectGetAllDomainStats)

2025-07-11 05:06:55.328+0000: 271494: warning : virDomainObjBeginJobInternal:434 : Cannot start job (query, none, none) in API remoteDispatchDomainGetXMLDesc for domain Windows; current job is (query, none, none) owned by (271492 remoteDispatchConnectGetAllDomainStats, 0 <null>, 0 <null> (flags=0x0)) for (319s, 0s, 0s)

2025-07-11 05:06:55.328+0000: 271494: error : virDomainObjBeginJobInternal:468 : Timed out during operation: cannot acquire state change lock (held by monitor=remoteDispatchConnectGetAllDomainStats)

2025-07-11 05:06:55.499+0000: 271496: warning : virDomainObjBeginJobInternal:434 : Cannot start job (query, none, none) in API remoteDispatchDomainGetXMLDesc for domain Windows; current job is (query, none, none) owned by (271492 remoteDispatchConnectGetAllDomainStats, 0 <null>, 0 <null> (flags=0x0)) for (319s, 0s, 0s)

2025-07-11 05:06:55.499+0000: 271496: error : virDomainObjBeginJobInternal:468 : Timed out during operation: cannot acquire state change lock (held by monitor=remoteDispatchConnectGetAllDomainStats)

Edited by Linguafoeda

47 minutes ago, Linguafoeda said:

ugh - i was moving tabs around in chrome and my windows 11 VM crashed again, and same issue as original....main unraid GUI is now extremely unstable (will not load the VM tab, the main dashboard takes 2-3 minutes to load the docker containers and my VM section is now MISSING the windows VM from the list....). I wont be able to restart the Unraid machine without a physical hard reset of the button (which is difficult because im not physically located next to my server).

So re-creating libvirt did nothing for me. what do i do now to troubleshoot this....is this is a windows 11 VM issue itself that is causing some massive failure that doesn't allow libvirt to work again after it crashes and now requires a physical hard reset?

Note - i have 32GB RAM and Core i7-10700T and have otherwise before never had issues with allocating 8GB RAM / all cores/threads to my Win11 VM to function with much more intensive programs running (vs. chrome with 50 or so tabs open when it just now crashed)

Libvirt Log:

2025-07-11 05:04:21.655+0000: 271495: warning : virDomainObjBeginJobInternal:434 : Cannot start job (query, none, none) in API remoteDispatchDomainGetXMLDesc for domain Windows; current job is (query, none, none) owned by (271492 remoteDispatchConnectGetAllDomainStats, 0 <null>, 0 <null> (flags=0x0)) for (165s, 0s, 0s)

2025-07-11 05:04:21.655+0000: 271495: error : virDomainObjBeginJobInternal:468 : Timed out during operation: cannot acquire state change lock (held by monitor=remoteDispatchConnectGetAllDomainStats)

2025-07-11 05:04:51.656+0000: 271494: warning : virDomainObjBeginJobInternal:434 : Cannot start job (query, none, none) in API remoteDispatchDomainGetXMLDesc for domain Windows; current job is (query, none, none) owned by (271492 remoteDispatchConnectGetAllDomainStats, 0 <null>, 0 <null> (flags=0x0)) for (195s, 0s, 0s)

2025-07-11 05:04:51.656+0000: 271494: error : virDomainObjBeginJobInternal:468 : Timed out during operation: cannot acquire state change lock (held by monitor=remoteDispatchConnectGetAllDomainStats)

2025-07-11 05:05:21.656+0000: 271493: warning : virDomainObjBeginJobInternal:434 : Cannot start job (query, none, none) in API remoteDispatchDomainGetXMLDesc for domain Windows; current job is (query, none, none) owned by (271492 remoteDispatchConnectGetAllDomainStats, 0 <null>, 0 <null> (flags=0x0)) for (225s, 0s, 0s)

2025-07-11 05:05:21.656+0000: 271493: error : virDomainObjBeginJobInternal:468 : Timed out during operation: cannot acquire state change lock (held by monitor=remoteDispatchConnectGetAllDomainStats)

2025-07-11 05:05:51.656+0000: 271496: warning : virDomainObjBeginJobInternal:434 : Cannot start job (query, none, none) in API remoteDispatchDomainGetXMLDesc for domain Windows; current job is (query, none, none) owned by (271492 remoteDispatchConnectGetAllDomainStats, 0 <null>, 0 <null> (flags=0x0)) for (255s, 0s, 0s)

2025-07-11 05:05:51.656+0000: 271496: error : virDomainObjBeginJobInternal:468 : Timed out during operation: cannot acquire state change lock (held by monitor=remoteDispatchConnectGetAllDomainStats)

2025-07-11 05:06:21.656+0000: 271495: warning : virDomainObjBeginJobInternal:434 : Cannot start job (query, none, none) in API remoteDispatchDomainGetXMLDesc for domain Windows; current job is (query, none, none) owned by (271492 remoteDispatchConnectGetAllDomainStats, 0 <null>, 0 <null> (flags=0x0)) for (285s, 0s, 0s)

2025-07-11 05:06:21.656+0000: 271495: error : virDomainObjBeginJobInternal:468 : Timed out during operation: cannot acquire state change lock (held by monitor=remoteDispatchConnectGetAllDomainStats)

2025-07-11 05:06:55.328+0000: 271494: warning : virDomainObjBeginJobInternal:434 : Cannot start job (query, none, none) in API remoteDispatchDomainGetXMLDesc for domain Windows; current job is (query, none, none) owned by (271492 remoteDispatchConnectGetAllDomainStats, 0 <null>, 0 <null> (flags=0x0)) for (319s, 0s, 0s)

2025-07-11 05:06:55.328+0000: 271494: error : virDomainObjBeginJobInternal:468 : Timed out during operation: cannot acquire state change lock (held by monitor=remoteDispatchConnectGetAllDomainStats)

2025-07-11 05:06:55.499+0000: 271496: warning : virDomainObjBeginJobInternal:434 : Cannot start job (query, none, none) in API remoteDispatchDomainGetXMLDesc for domain Windows; current job is (query, none, none) owned by (271492 remoteDispatchConnectGetAllDomainStats, 0 <null>, 0 <null> (flags=0x0)) for (319s, 0s, 0s)

2025-07-11 05:06:55.499+0000: 271496: error : virDomainObjBeginJobInternal:468 : Timed out during operation: cannot acquire state change lock (held by monitor=remoteDispatchConnectGetAllDomainStats)

Okay was playing around for 30 minutes trying to "unfreeze" my GUI since i could still SSH into the terminal. I wanted to share a detailed summary of the issues I encountered and the troubleshooting steps I took after my Unraid server “froze” during a Windows 11 VM run with Intel GVT-g GPU virtualization enabled.

Timeline & Key Points:

  • The Unraid server became unresponsive (“frozen”) when attempting to start the Windows 11 VM using Intel GVT mediated devices.

  • The libvirt daemon became stuck, and I found a defunct (<defunct>) QEMU process lingering, which was not cleared by a normal stop.

  • I killed defunct QEMU processes manually with kill -9, then stopped all related libvirt services (libvirtd, virtlockd, virtlogd) forcibly ("killall -9 libvirtd virtlockd virtlogd").

  • After that, I restarted libvirt services cleanly via /etc/rc.d/rc.libvirt stop and /etc/rc.d/rc.libvirt start, which restored access to the VM tab.

  • When trying to start the VM, I got errors in the libvirt logs about the disk image being locked, which was resolved after confirming no other process was holding it.

  • However, upon assigning the Intel GVT mediated device to the VM, I hit a kernel error repeatedly:

    gvt: fail to allocate resource low GM space

    gvt: request 128MB avail 0MB max 128MB taken 128MB

    gvt: failed to create intel vgpu: -28

  • Checking /sys/bus/mdev/devices/ showed no active mediated devices.

  • modprobe intel_gvt failed because the kernel module does not exist in my current Unraid kernel (6.12.24-Unraid).

  • No GVT modules are currently loaded, and mediated devices are not created.

  • The problem appears to be that the Intel GVT kernel module (intel_gvt / intel_vgpu_mdev) is missing from my Unraid kernel build, preventing creation and proper cleanup of vGPU devices.

  • This causes leftover UUID references and inability to allocate vGPU memory for new VM sessions.

  • I am currently unable to reboot the server due to physical access limitations currently.

What I’ve Tried:

  • Manually killing stale defunct QEMU processes.

  • Restarting libvirt and associated services multiple times.

  • Verified disk image locks with lsof and ensured no conflicts.

  • Confirmed that no intel_gvt or related kernel modules are loaded or available.

  • Checked kernel logs confirming the “fail to allocate resource low GM space” error and GVT memory exhaustion.

Current Status & Questions:

  • Without the proper Intel GVT kernel module, I cannot create or assign mediated devices.

  • Is there a recommended way to manually clean up stale vGPU UUIDs or free VRAM without rebooting?

  • Any advice on handling this issue remotely without physical reboot would be appreciated.

Thanks in advance for any guidance or suggestions. I will eventually be able to physically reboot my machine in ~12-24 hours but at least Libvirt is running....even with errors as i can't restart the VM right now:

Libvirt Log:

2025-07-11 05:13:58.815+0000: 271491: warning : virNetDaemonRun:880 : Make forcefull daemon shutdown

2025-07-11 05:22:33.057+0000: 730004: info : libvirt version: 11.2.0

2025-07-11 05:22:33.057+0000: 730004: info : hostname: XXXX

2025-07-11 05:22:33.057+0000: 730004: error : qemuRdpNewForHelper:103 : 'qemu-rdp' is not a suitable qemu-rdp helper name: No such file or directory

2025-07-11 05:22:35.098+0000: 730004: warning : qemuTPMVirCommandSwtpmAddTPMState:634 : This swtpm version doesn't support explicit locking

2025-07-11 05:22:37.135+0000: 730004: warning : qemuDomainObjTaintMsg:5481 : Domain id=1 name='Windows' uuid=84939d5e-3784-2728-0510-XXXX is tainted: high-privileges

2025-07-11 05:22:38.026+0000: 735140: error : qemuMonitorIORead:397 : Unable to read from monitor: Connection reset by peer

2025-07-11 05:22:38.027+0000: 735140: error : qemuProcessReportLogError:1953 : internal error: QEMU unexpectedly closed the monitor (vm='Windows'): 2025-07-11T05:22:37.961624Z qemu-system-x86_64: -blockdev {"node-name":"libvirt-1-format","read-only":false,"cache":{"direct":false,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage","backing":null}: Failed to get "write" lock

Is another process using the image [/mnt/cache/domains/Windows/Windows_disk.img]?

2025-07-11 05:22:38.027+0000: 730004: error : qemuProcessReportLogError:1953 : internal error: process exited while connecting to monitor: 2025-07-11T05:22:37.961624Z qemu-system-x86_64: -blockdev {"node-name":"libvirt-1-format","read-only":false,"cache":{"direct":false,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage","backing":null}: Failed to get "write" lock

Is another process using the image [/mnt/cache/domains/Windows/Windows_disk.img]?

2025-07-11 05:31:18.938+0000: 730000: error : virNetSocketReadWire:1782 : End of file while reading data: Input/output error

2025-07-11 05:36:31.204+0000: 760692: info : libvirt version: 11.2.0

2025-07-11 05:36:31.204+0000: 760692: info : hostname: XXXX

2025-07-11 05:36:31.204+0000: 760692: error : networkCheckRouteCollision:298 : internal error: Network is already in use by interface virbr0

2025-07-11 05:37:52.459+0000: 760676: error : qemuRdpNewForHelper:103 : 'qemu-rdp' is not a suitable qemu-rdp helper name: No such file or directory

2025-07-11 05:37:54.487+0000: 760676: error : virMediatedDeviceNew:144 : device not found: mediated device 'e3e02122-f09d-4809-adb8-XXXX' not found

2025-07-11 05:39:27.497+0000: 760678: error : qemuRdpNewForHelper:103 : 'qemu-rdp' is not a suitable qemu-rdp helper name: No such file or directory

2025-07-11 05:39:42.903+0000: 760675: error : qemuRdpNewForHelper:103 : 'qemu-rdp' is not a suitable qemu-rdp helper name: No such file or directory

2025-07-11 05:39:44.942+0000: 760675: error : virMediatedDeviceNew:144 : device not found: mediated device 'e3e02122-f09d-4809-adb8-XXXX' not found

2025-07-11 05:40:01.164+0000: 760680: error : qemuRdpNewForHelper:103 : 'qemu-rdp' is not a suitable qemu-rdp helper name: No such file or directory

2025-07-11 05:40:08.842+0000: 760679: error : qemuRdpNewForHelper:103 : 'qemu-rdp' is not a suitable qemu-rdp helper name: No such file or directory

2025-07-11 05:40:14.668+0000: 760678: error : qemuRdpNewForHelper:103 : 'qemu-rdp' is not a suitable qemu-rdp helper name: No such file or directory

2025-07-11 05:40:15.686+0000: 760723: error : udevProcessMediatedDevice:1146 : failed to wait for file '/sys/devices/pci0000:00/0000:00:02.0/fc6dbcf6-dc59-4143-95f3-XXXX/mdev_type' to appear: No such file or directory

2025-07-11 05:40:16.692+0000: 760678: error : virMediatedDeviceNew:144 : device not found: mediated device 'fc6dbcf6-dc59-4143-95f3-XXXX' not found

2025-07-11 05:43:19.114+0000: 760675: error : qemuRdpNewForHelper:103 : 'qemu-rdp' is not a suitable qemu-rdp helper name: No such file or directory

2025-07-11 05:43:26.216+0000: 760683: error : qemuRdpNewForHelper:103 : 'qemu-rdp' is not a suitable qemu-rdp helper name: No such file or directory

2025-07-11 05:45:42.828+0000: 760679: error : qemuRdpNewForHelper:103 : 'qemu-rdp' is not a suitable qemu-rdp helper name: No such file or directory

2025-07-11 05:45:43.850+0000: 760723: error : udevProcessMediatedDevice:1146 : failed to wait for file '/sys/devices/pci0000:00/0000:00:02.0/bf29780a-4561-4394-88a0-XXXX/mdev_type' to appear: No such file or directory

2025-07-11 05:45:44.859+0000: 760679: error : virMediatedDeviceNew:144 : device not found: mediated device 'bf29780a-4561-4394-88a0-XXXX' not found

Edited by Linguafoeda

FWIW - chatGPT believes the root cause of my issues is related to Intel GVT-g acceleration that caused the original crash (just using Chrome) to begin with, that then put me in this loop of trying to recover my unstable machine post-libvirt crash. I'm not sure if ChatGPT is guiding me wrong but that's what it surmises....i'm on 7.1.4 and i don't remember specifically when i started having these issues but do rememeber Win11 VM could run for months very stable when i was on 6.10 last year.

I do have plex also running with parameters: --device=/dev/dri --memory=12G if that helps.

  • 9 months later...

UNRAID_LIBVIRT_VMSERVICE_FIX.md

My journey today to begin using VMs again on this old box. Long-story short: libvirt.img was corrupted and recreating the image through the existing scripts in the OS did not seem to work right and so had to directly rename libvirt.img to libvirt-xfs.img in the domain.cfg path. I included the markdown file of my troubleshooting steps and how to diagnose should you have the same issues (attached) and may as well make it scrapeable:

# Unraid LibVirt VM Service Failure — Troubleshooting Guide


## Overview


This document describes a specific, confirmed bug/misconfiguration that causes the

**VM Service (LibVirt) to fail on startup** in Unraid 7.x. It was diagnosed and

resolved on Unraid **7.2.4** (upgraded from **7.2.3**). The issue may have been

introduced during or prior to the 7.2.3 → 7.2.4 upgrade cycle, with the earliest

confirmed failure logged on March 18, 2026.


Docker continued to work normally throughout. Only the VM Service was affected.


---


## Symptom


- VM Service shows red/failed in the Unraid GUI after array start

- Syslog contains:

  ```

  emhttpd: shcmd: /usr/local/sbin/mount_image '/mnt/user/system/libvirt/libvirt.img' /etc/libvirt 1

  root: mount: /etc/libvirt: wrong fs type, bad option, bad superblock on /dev/loop3

  ```

  or:

  ```

  root: mount: /etc/libvirt: can't read superblock on /dev/loop3

  ```

- Kernel log shows BTRFS being detected on loop3 with a consistent UUID — even after

  the array is restarted or the server is rebooted

- rc.libvirt reports: libvirt daemon... No image mounted at /etc/libvirt


---


## Root Cause (Two-Part)


### Part 1 — The libvirt.img file was created as BTRFS


The Unraid helper script /usr/local/sbin/mount_image determines the filesystem type

to use based on the **filename suffix** of the image file:


| Filename ends with | Filesystem used |

|--------------------|----------------|

| -xfs.img         | XFS            |

| anything else      | **BTRFS**      |


Because the default image is named libvirt.img (no -xfs suffix), mount_image

always uses BTRFS — both when creating the file and when mounting it. At some point

the libvirt.img on this system became corrupted (BTRFS superblock bad fsid errors),

making it unmountable even as BTRFS.


### Part 2 — Replacing the file with ext4 does not work


A natural troubleshooting step is to delete the corrupted image and create a fresh

one using mkfs.ext4. This produces a valid ext4 image that file and od confirm

as correct — but mount_image will still fail because it always calls:


```bash

mount -o noatime,space_cache=v2 libvirt.img /etc/libvirt

```


These are BTRFS-specific mount options. Mounting an ext4 image with

space_cache=v2 causes the kernel to reject it with "wrong fs type." The ext4

image is never the problem — the mount options are.


### Why the kernel always reports the old BTRFS UUID


The kernel BTRFS scanner caches device UUIDs. Even after replacing the file, the

kernel may report the old UUID in dmesg because the loop device is being presented

with the same size (2097152 sectors = 1GiB). This is a red herring — the file on

disk can be perfectly valid ext4 while the kernel log still references old BTRFS

metadata from a prior mount attempt in the same session.


---


## Diagnosis Steps


### 1. Check the image file type

```bash

file /mnt/cache/system/libvirt/libvirt.img

```

- If it reports BTRFS → original corrupted image still present

- If it reports ext4 → replacement was made but won't work due to mount_image logic


### 2. Verify the magic bytes directly

```bash

# BTRFS magic at offset 0x10040 — should be zeros if NOT btrfs

od -A x -t x1z -j $((0x10040)) -N 8 /mnt/cache/system/libvirt/libvirt.img


# ext4 magic at offset 0x438 — should be "53 ef" if ext4

od -A x -t x1z -j $((0x438)) -N 2 /mnt/cache/system/libvirt/libvirt.img

```


### 3. Confirm which file is actually being mounted

The system share is typically cache=only, meaning the real file is on the

cache drive, not the array disks. Always check:

```bash

file /mnt/cache/system/libvirt/libvirt.img

ls -lah /mnt/cache/system/libvirt/

find /mnt/disk1 /mnt/disk2 /mnt/disk3 /mnt/disk4 /mnt/disk5 /mnt/disk6 /mnt/disk7 \

  -name "libvirt.img" 2>/dev/null

```


### 4. Confirm the mount_image script behavior

```bash

cat /usr/local/sbin/mount_image

```

Look for the filename suffix logic — if libvirt.img doesn't end in -xfs.img,

BTRFS mount options will always be used regardless of actual filesystem type.


### 5. Quick proof-of-concept test (array running, LibVirt stopped)

```bash

mount -o noatime /mnt/cache/system/libvirt/libvirt.img /etc/libvirt && \

  echo "SUCCESS" && \

  /etc/rc.d/rc.libvirt start

```

If this succeeds, it confirms the image is fine and mount_image's BTRFS options

are the sole cause of failure.


---


## The Fix


### Step 1 — Edit /boot/config/domain.cfg directly (array can be stopped)

```bash

sed -i 's|IMAGE_FILE=.*|IMAGE_FILE="/mnt/user/system/libvirt/libvirt-xfs.img"|' \

  /boot/config/domain.cfg


# Verify

grep IMAGE_FILE /boot/config/domain.cfg

```


### Step 2 — Remove the old/replacement image

```bash

# If array is running:

rm /mnt/cache/system/libvirt/libvirt.img

rm /mnt/cache/system/libvirt/libvirt.img.bak  # if present

```


### Step 3 — Start the array

On next array start, mount_image will see that libvirt-xfs.img does not exist,

and will **automatically create it** using mkfs.xfs. No manual image creation needed.


### Step 4 — Verify in GUI

Settings → VM Manager → Libvirt storage location should now show:

/mnt/user/system/libvirt/libvirt-xfs.img


VM Service should go green. LibVirt config files virtlockd.conf, virtlogd.conf)

will be regenerated automatically on first successful start — the "No such file"

errors for these in the log are harmless and expected on a fresh image.


---


## What Is NOT Lost


- **VM disk images** .img, .qcow2) stored in /mnt/user/domains/ are

  completely separate from libvirt.img and are unaffected

- **Docker** is unaffected throughout — it uses its own docker.img

- Only the LibVirt XML configuration files (VM definitions) live inside libvirt.img

  If VMs were previously defined, they will need to be re-created in the GUI and

  pointed at their existing disk images in /mnt/user/domains/


---


## Key Files and Paths


| Item | Path |

|------|------|

| LibVirt image (correct name) | /mnt/user/system/libvirt/libvirt-xfs.img |

| LibVirt image (real location on cache-only share) | /mnt/cache/system/libvirt/libvirt-xfs.img |

| VM disk images | /mnt/user/domains/ |

| Unraid VM config | /boot/config/domain.cfg |

| mount_image script | /usr/local/sbin/mount_image |

| LibVirt startup script | /etc/rc.d/rc.libvirt |


---


## Version Context


| Field | Value |

|-------|-------|

| Unraid version at time of fix | 7.2.4 |

| Previous Unraid version | 7.2.3 |

| Kernel | 6.12.54-Unraid |

| LibVirt version | 11.7.0 |

| Earliest confirmed failure in logs | March 18, 2026 |

| Docker image filesystem | BTRFS (working correctly — uses different image) |

| Cache pool filesystem | BTRFS |


---


## Summary for LLM Context


If an LLM is helping debug this issue, the key facts to establish are:


1. What does file /mnt/cache/system/libvirt/libvirt.img report?

2. What does the kernel log say about loop3 when the mount fails?

3. What does cat /usr/local/sbin/mount_image show about filesystem selection logic?

4. What is the current value of IMAGE_FILE in /boot/config/domain.cfg?


The fix is always: **rename the image to end in -xfs.img** so that mount_image

uses XFS filesystem operations instead of BTRFS. Edit domain.cfg to match, then

let the array start create the image fresh.

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.