Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
[Software] [Virt Manager] [Solved] QEMU guest agent not working in VMs
[Software] [Virt Manager] [Solved] QEMU guest agent not working in VMs
I'm running Debian Bookworm, with LXQT as my desktop environment. Which i installed from scratch about a week ago, then gradually added softwares as needed. Eventually, I needed Virt Manager, I've been using it to run VMs for Windows 11, Manjaro, and a few other OSes, so I dont have to dualboot for real. Earlier today I was installing Windows 11, all seemed fine. So far, I've been using the following guide for this, and it has worked well, up until now:
https://sysguides.com/install-a-windows ... ine-on-kvm
I followed all the prerequisite steps before installing the OS (mainly, the Virt Manager installation steps, and getting the required VirtIO drivers iso that must be fed to Windows after it is installed). After 11 was booted, I mounted the iso onto a virtual CDROM, then installed it in the guest. However, after rebooting the guest, I couldnt enable the "autoresize VM with window" button in the Virt Manager GUI, and a small message was displayed "guest agent is not available" when mousing over it. Then I remembered that in the past, doing:
sudo apt install qemu-guest-agent
Had been enough to fix it. But not this time. Even after rebooting host and guest multiple times, I cant enable the option. I have previously used the guide above for Windows 10 and Windows 11, on an older Debian 12 install, and had no issues.
Attempting to run commands like:
sudo systemctl status qemu-guest-agent
sudo systemctl start qemu-guest-agent
sudo systemctl restart qemu-guest-agent
Have not yielded any results. But I did get a dependency error message. Not sure what to do at this point, or even how to work toward finding the cause and solving this. I do need this to work, since it's affecting my productivity. I can boot the VMs fine, but without the guest agent running they are sluggish, not very usable in a meaningful way.
From what I can tell so far, I've what what I can on both the host and guest to try to resolve this, but I'm at a standstill. Help appreciated.
https://sysguides.com/install-a-windows ... ine-on-kvm
I followed all the prerequisite steps before installing the OS (mainly, the Virt Manager installation steps, and getting the required VirtIO drivers iso that must be fed to Windows after it is installed). After 11 was booted, I mounted the iso onto a virtual CDROM, then installed it in the guest. However, after rebooting the guest, I couldnt enable the "autoresize VM with window" button in the Virt Manager GUI, and a small message was displayed "guest agent is not available" when mousing over it. Then I remembered that in the past, doing:
sudo apt install qemu-guest-agent
Had been enough to fix it. But not this time. Even after rebooting host and guest multiple times, I cant enable the option. I have previously used the guide above for Windows 10 and Windows 11, on an older Debian 12 install, and had no issues.
Attempting to run commands like:
sudo systemctl status qemu-guest-agent
sudo systemctl start qemu-guest-agent
sudo systemctl restart qemu-guest-agent
Have not yielded any results. But I did get a dependency error message. Not sure what to do at this point, or even how to work toward finding the cause and solving this. I do need this to work, since it's affecting my productivity. I can boot the VMs fine, but without the guest agent running they are sluggish, not very usable in a meaningful way.
From what I can tell so far, I've what what I can on both the host and guest to try to resolve this, but I'm at a standstill. Help appreciated.
Last edited by Enigma83 on 2024-04-17 05:03, edited 3 times in total.
Re: [Software] [Virt Manager] QEMU guest agent not working in VMs
This is part of what I get. But it only seems to happen after I've booted the VM, then shut it down and closed all Virt Manager Windows:
steve@enigmadebianpc:~$ sudo systemctl status qemu-guest-agent.service
[sudo] password for steve:
○ qemu-guest-agent.service - QEMU Guest Agent
Loaded: loaded (/lib/systemd/system/qemu-guest-agent.service; static)
Active: inactive (dead)
Apr 16 19:27:55 enigmadebianpc systemd[1]: qemu-guest-agent.service: Job qemu-guest-agent.service/start failed with result 'dependency'.
Apr 16 19:29:07 enigmadebianpc systemd[1]: qemu-guest-agent.service: Bound to unit dev-virtio\x2dports-org.qemu.guest_agent.0.device, but unit isn't active.
Apr 16 19:29:07 enigmadebianpc systemd[1]: Dependency failed for qemu-guest-agent.service - QEMU Guest Agent.
Apr 16 19:29:07 enigmadebianpc systemd[1]: qemu-guest-agent.service: Job qemu-guest-agent.service/start failed with result 'dependency'.
Apr 16 19:29:17 enigmadebianpc systemd[1]: qemu-guest-agent.service: Bound to unit dev-virtio\x2dports-org.qemu.guest_agent.0.device, but unit isn't active.
Apr 16 19:29:17 enigmadebianpc systemd[1]: Dependency failed for qemu-guest-agent.service - QEMU Guest Agent.
Apr 16 19:29:17 enigmadebianpc systemd[1]: qemu-guest-agent.service: Job qemu-guest-agent.service/start failed with result 'dependency'.
Apr 16 19:31:06 enigmadebianpc systemd[1]: qemu-guest-agent.service: Bound to unit dev-virtio\x2dports-org.qemu.guest_agent.0.device, but unit isn't active.
Apr 16 19:31:06 enigmadebianpc systemd[1]: Dependency failed for qemu-guest-agent.service - QEMU Guest Agent.
Apr 16 19:31:06 enigmadebianpc systemd[1]: qemu-guest-agent.service: Job qemu-guest-agent.service/start failed with result 'dependency'.
steve@enigmadebianpc:~$ sudo systemctl status qemu-guest-agent.service
[sudo] password for steve:
○ qemu-guest-agent.service - QEMU Guest Agent
Loaded: loaded (/lib/systemd/system/qemu-guest-agent.service; static)
Active: inactive (dead)
Apr 16 19:27:55 enigmadebianpc systemd[1]: qemu-guest-agent.service: Job qemu-guest-agent.service/start failed with result 'dependency'.
Apr 16 19:29:07 enigmadebianpc systemd[1]: qemu-guest-agent.service: Bound to unit dev-virtio\x2dports-org.qemu.guest_agent.0.device, but unit isn't active.
Apr 16 19:29:07 enigmadebianpc systemd[1]: Dependency failed for qemu-guest-agent.service - QEMU Guest Agent.
Apr 16 19:29:07 enigmadebianpc systemd[1]: qemu-guest-agent.service: Job qemu-guest-agent.service/start failed with result 'dependency'.
Apr 16 19:29:17 enigmadebianpc systemd[1]: qemu-guest-agent.service: Bound to unit dev-virtio\x2dports-org.qemu.guest_agent.0.device, but unit isn't active.
Apr 16 19:29:17 enigmadebianpc systemd[1]: Dependency failed for qemu-guest-agent.service - QEMU Guest Agent.
Apr 16 19:29:17 enigmadebianpc systemd[1]: qemu-guest-agent.service: Job qemu-guest-agent.service/start failed with result 'dependency'.
Apr 16 19:31:06 enigmadebianpc systemd[1]: qemu-guest-agent.service: Bound to unit dev-virtio\x2dports-org.qemu.guest_agent.0.device, but unit isn't active.
Apr 16 19:31:06 enigmadebianpc systemd[1]: Dependency failed for qemu-guest-agent.service - QEMU Guest Agent.
Apr 16 19:31:06 enigmadebianpc systemd[1]: qemu-guest-agent.service: Job qemu-guest-agent.service/start failed with result 'dependency'.
-
- Global Moderator
- Posts: 2743
- Joined: 2018-06-20 15:16
- Location: Colorado
- Has thanked: 45 times
- Been thanked: 206 times
Re: [Software] [Virt Manager] QEMU guest agent not working in VMs
It is easier to read in code tags...
The guest agent is socket activated IIRC, or automagic.
I can't tell where you're trying this but it is not required in host or guest, and the package is only required by the linux guest.
The guest agent is socket activated IIRC, or automagic.
I can't tell where you're trying this but it is not required in host or guest, and the package is only required by the linux guest.
-
- Global Moderator
- Posts: 2743
- Joined: 2018-06-20 15:16
- Location: Colorado
- Has thanked: 45 times
- Been thanked: 206 times
Re: [Software] [Virt Manager] QEMU guest agent not working in VMs
No idea what you mean?
This package provides a daemon (agent) to run inside qemu-system
guests (full system emulation). It communicates with the host using
a virtio-serial channel org.qemu.guest_agent.0, and allows one to perform
some functions in the guest from the host, including:
- querying and setting guest system time
- performing guest filesystem sync operation
- initiating guest shutdown or suspend to ram
- accessing guest files
- freezing/thawing guest filesystem operations
- others.
Install this package on a system which is running as guest inside
qemu virtual machine. It is not used on the host.
Re: [Software] [Virt Manager] QEMU guest agent not working in VMs
I was getting the "guest agent is not available" message from Virt Manager even before I installed the qemu-guest-agent package. And it has continued after installing it. Either way, all i know it, it was working before on a previous Bookworm install, and with this package installed.
I get that it's supposed to be happen automagically.....except when it doesnt work. There is a difference between "supposed to" and "does".
Speaking of Linux guests, I've tried enabling the guest agent while Manjaro is running, but it doesnt seem to work there either, even though it did before.
About the code tags, not sure how to use them, so I just copy/pasted directly.
If you dont know what I mean, then I cant think of anything else to say that would bring more clarification. I've stated the situation as best I can.
-
- Global Moderator
- Posts: 2743
- Joined: 2018-06-20 15:16
- Location: Colorado
- Has thanked: 45 times
- Been thanked: 206 times
Re: [Software] [Virt Manager] QEMU guest agent not working in VMs
check nc
make sure one is installed in the host, openbsd version preferred.
The needless systemctl actions could be killing the service - It is never required for the user to enable or start.
Code tag icon looks like a little prompt icon </>
Code: Select all
$ apt policy netcat-*
This doesn't make sense - Virt-manager is on the host and does not require the package.
The needless systemctl actions could be killing the service - It is never required for the user to enable or start.
Code tag icon looks like a little prompt icon </>
Re: [Software] [Virt Manager] QEMU guest agent not working in VMs
I never said that Virt Manager itself required the package. But the VMs seem to need it. Virt Manager is little more than a GUI frontend.CwF wrote: ↑2024-04-17 04:34 check ncmake sure one is installed in the host, openbsd version preferred.Code: Select all
$ apt policy netcat-*
This doesn't make sense - Virt-manager is on the host and does not require the package.
The needless systemctl actions could be killing the service - It is never required for the user to enable or start.
Code tag icon looks like a little prompt icon </>
Re: [Software] [Virt Manager] QEMU guest agent not working in VMs
I'm going to tag this thread as solved, because I've figured it out. CwF, I think you may be right, Linux guests may not need the package. When I booted Manjaro from a live ISO, I was getting the 'guest agent is not available" message, it couldnt be ticked, and things that are supposed to work when the agent is doing its' thing, were not working. But after installing it into a qcow2 disk image, I was able to enable the option on the first boot. Immediately, I noticed that the lagginess went away (especially the slow mouse cursor), and I was able to adjust the VM resolution to something closer to my monitor's highest supported resolution.
As for Windows 11, I think whatever VirtIO drivers ISO i used must be borked. I dug up an older ISO from an external hard drive, uninstalled the drivers, then reinstalled them from the archived ISO. On the next boot, I was able to tick the box immediately. Similar results as Manjaro.
As for Windows 11, I think whatever VirtIO drivers ISO i used must be borked. I dug up an older ISO from an external hard drive, uninstalled the drivers, then reinstalled them from the archived ISO. On the next boot, I was able to tick the box immediately. Similar results as Manjaro.
Re: [Software] [Virt Manager] QEMU guest agent not working in VMs
Can you go into more detail on HOW to use the code tags?
Click the ... icon at the top right and review this edit to see it.
Code: Select all
this is code tags
-
- Global Moderator
- Posts: 2743
- Joined: 2018-06-20 15:16
- Location: Colorado
- Has thanked: 45 times
- Been thanked: 206 times
Re: [Software] [Virt Manager] [Solved] QEMU guest agent not working in VMs
I edited your post, edit it again to see the tags.
Hover over the icons immediately above the edit box, they'll tell you.
Hover over the icons immediately above the edit box, they'll tell you.
-
- Debian Developer
- Posts: 464
- Joined: 2022-07-12 14:10
- Has thanked: 1 time
- Been thanked: 88 times
Re: [Software] [Virt Manager] QEMU guest agent not working in VMs
qemu-guest-agent should be used on the host:
Code: Select all
$ apt-cache show qemu-guest-agent
...
Install this package on a system which is running as guest inside
qemu virtual machine. It is not used on the host.
-
- Debian Developer
- Posts: 464
- Joined: 2022-07-12 14:10
- Has thanked: 1 time
- Been thanked: 88 times
Re: [Software] [Virt Manager] [Solved] QEMU guest agent not working in VMs
Here are my notes on how to get good performance from a Windows virtual machine and without having to play around as root:
- Download virtio-win-0.1.229.iso (sha256 c88a0dde34605eaee6cf889f3e2a0c2af3caeb91b5df45a125ca4f701acbbbe0)
- Download Win10_22H2_EnglishInternational_x64.iso (sha256 3ac5522f9db9f4f432a1aade69fef268c8c0b5fd3f22d3a6987719752f8a7108)
- Start virt-manager, connect to "QEMU/KVM User session"
- Create new VM
- Select "Local install media"
- Select Win10_22H2_EnglishInternational_x64.iso
- Select Forward
- Set "Memory" to 8192
- Set "CPUs" to "4"
- Select Forward
- Set disk image size to 100 GiB
- Select Forward
- Select "Customize configuration before install"
- Select Finish
- Select Add Hardware/Storage/CD-ROM and choose virtio-win-0.1.229.iso
- Select Finish
- Select existing "NIC" and set model to "virtio"
- Select Apply
- Select existing "SATA Disk 1" and set bus to "virtio" and cache to "writeback"
- Select Apply
- Select "Boot options" and make both CD drives bootable
- Select Apply
- Select "Begin installation"
- Set "Language to install" to "English (United Kingdom)"
- Set "Time and currency format" to "English (United Kingdom)"
- Set "Keyboard or input method" to "Finnish"
- Select Next
- Click "Install now"
- Select "I don't have a product key"
- Select "Windows 10 Pro" and Next
- Select "I accept the license agreement" and Next
- Select Custom
- Select load drivers and load drivers for viostor/w10/amd64, NetKVM/w10/amd64 and qxldod/w10/amd64
- Select New, Apply, OK and Next
- Select New, Apply, OK and Next
- Select "Finnish" as the keyboard layout and Yes
- Select Add layout and add English (Finland) and Next
- Select Finnish and Add layout
- Select "set up for personal use"
- Select "Offline account"
- Select limited experience
- Enter TEMPLATE_USERNAME as username and Next
- Enter TEMPLATE_PASSWORD as password
- Set security question answers
- Select No
- Select No
- Select Send Required diagnostic data
- Select No
- Select No
- Select No
- Select Skip
- Run e:\virtio-win-guest-tools.exe
- Configure automatic login:
- Run reg.exe ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v AutoAdminLogon /t REG_SZ /d 1 /f
- Run REG.exe ADD "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultUserName /t REG_SZ /d TEMPLATE_USERNAME /f
- Run REG.exe ADD "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultPassword /t REG_SZ /d TEMPLATE_PASSWORD /f
Re: [Software] [Virt Manager] QEMU guest agent not working in VMs
This is very contradictory..."should be used on the host", and then apt-cache's description "it is not used on the host". My understanding is that it's meant to be installed on the host, to facilitate guest agent communication between the host (Debian) and guest (whatever OS it might be). Like a translator, helping 2 people to communicate even though they don't understand the same language. Either way, it's already installed, I don't think it will hurt anything.lindi wrote: ↑2024-04-17 07:24qemu-guest-agent should be used on the host:
Code: Select all
$ apt-cache show qemu-guest-agent ... Install this package on a system which is running as guest inside qemu virtual machine. It is not used on the host.
Re: [Software] [Virt Manager] [Solved] QEMU guest agent not working in VMs
I'm using Windows 11 Enterprise edition, but I'm sure the steps between 10 and 11 are nearly identical.lindi wrote: ↑2024-04-17 07:35 Here are my notes on how to get good performance from a Windows virtual machine and without having to play around as root:
- Download virtio-win-0.1.229.iso (sha256 c88a0dde34605eaee6cf889f3e2a0c2af3caeb91b5df45a125ca4f701acbbbe0)
- Download Win10_22H2_EnglishInternational_x64.iso (sha256 3ac5522f9db9f4f432a1aade69fef268c8c0b5fd3f22d3a6987719752f8a7108)
- Start virt-manager, connect to "QEMU/KVM User session"
- Create new VM
- Select "Local install media"
- Select Win10_22H2_EnglishInternational_x64.iso
- Select Forward
- Set "Memory" to 8192
- Set "CPUs" to "4"
- Select Forward
- Set disk image size to 100 GiB
- Select Forward
- Select "Customize configuration before install"
- Select Finish
- Select Add Hardware/Storage/CD-ROM and choose virtio-win-0.1.229.iso
- Select Finish
- Select existing "NIC" and set model to "virtio"
- Select Apply
- Select existing "SATA Disk 1" and set bus to "virtio" and cache to "writeback"
- Select Apply
- Select "Boot options" and make both CD drives bootable
- Select Apply
- Select "Begin installation"
- Set "Language to install" to "English (United Kingdom)"
- Set "Time and currency format" to "English (United Kingdom)"
- Set "Keyboard or input method" to "Finnish"
- Select Next
- Click "Install now"
- Select "I don't have a product key"
- Select "Windows 10 Pro" and Next
- Select "I accept the license agreement" and Next
- Select Custom
- Select load drivers and load drivers for viostor/w10/amd64, NetKVM/w10/amd64 and qxldod/w10/amd64
- Select New, Apply, OK and Next
- Select New, Apply, OK and Next
- Select "Finnish" as the keyboard layout and Yes
- Select Add layout and add English (Finland) and Next
- Select Finnish and Add layout
- Select "set up for personal use"
- Select "Offline account"
- Select limited experience
- Enter TEMPLATE_USERNAME as username and Next
- Enter TEMPLATE_PASSWORD as password
- Set security question answers
- Select No
- Select No
- Select Send Required diagnostic data
- Select No
- Select No
- Select No
- Select Skip
- Run e:\virtio-win-guest-tools.exe
- Configure automatic login:
- Run reg.exe ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v AutoAdminLogon /t REG_SZ /d 1 /f
- Run REG.exe ADD "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultUserName /t REG_SZ /d TEMPLATE_USERNAME /f
- Run REG.exe ADD "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultPassword /t REG_SZ /d TEMPLATE_PASSWORD /f
I'm using the VirtIO iso tagged 0.1.240. I had tried a newer version, but had issues getting the guest agent working, with or without the Debian package installed. I guess newer releases of the iso aren't always better.
My QEMU runs as QEMU/system rather than QEMU/user, so basically running with system authority. But I don't have to type in root password every time I open Virt Manager. And i can run virsh without su/sudo. Just a simple little change in .bashrc accomplished this.
In the link I gave in first post, it is recommended to set cache mode to none rather than write back. I've been using that setting, no issues. What's your reasoning for setting cache mode to write back?
https://sysguides.com/install-a-windows ... he-storage
He also advises using VirtIO for the disk mode, rather than SATA, claiming that it is superior for performance. The downside seems to be that the Windows installer won't natively recognize a disk using VirtIO, so a driver from the VirtIO iso must be manually installed before the disk is recognized. Once that's done, it no longer seems to be an issue.
-
- Debian Developer
- Posts: 464
- Joined: 2022-07-12 14:10
- Has thanked: 1 time
- Been thanked: 88 times
Re: [Software] [Virt Manager] QEMU guest agent not working in VMs
Enigma83 wrote: ↑2024-04-17 08:27This is very contradictory..."should be used on the host", and then apt-cache's description "it is not used on the host". My understanding is that it's meant to be installed on the host, to facilitate guest agent communication between the host (Debian) and guest (whatever OS it might be). Like a translator, helping 2 people to communicate even though they don't understand the same language. Either way, it's already installed, I don't think it will hurt anything.lindi wrote: ↑2024-04-17 07:24qemu-guest-agent should not be used on the host:
Code: Select all
$ apt-cache show qemu-guest-agent ... Install this package on a system which is running as guest inside qemu virtual machine. It is not used on the host.
-
- Debian Developer
- Posts: 464
- Joined: 2022-07-12 14:10
- Has thanked: 1 time
- Been thanked: 88 times
Re: [Software] [Virt Manager] QEMU guest agent not working in VMs
It should be used on the guest, my post had a missing "not" in it.Enigma83 wrote: ↑2024-04-17 08:27 This is very contradictory..."should be used on the host", and then apt-cache's description "it is not used on the host". My understanding is that it's meant to be installed on the host, to facilitate guest agent communication between the host (Debian) and guest (whatever OS it might be). Like a translator, helping 2 people to communicate even though they don't understand the same language. Either way, it's already installed, I don't think it will hurt anything.
Re: [Software] [Virt Manager] QEMU guest agent not working in VMs
Then if it's really not meant to be installed on the host, then its' only use case would be if the guest system were Debian or a Debian derivative (Ubuntu, Mint, etc). It cant be assumed that all non-Debian based distros will be guaranteed to have an installable package called "qemu-guest-agent". Some may, some may not.lindi wrote: ↑2024-04-17 09:02It should be used on the guest, my post had a missing "not" in it.Enigma83 wrote: ↑2024-04-17 08:27 This is very contradictory..."should be used on the host", and then apt-cache's description "it is not used on the host". My understanding is that it's meant to be installed on the host, to facilitate guest agent communication between the host (Debian) and guest (whatever OS it might be). Like a translator, helping 2 people to communicate even though they don't understand the same language. Either way, it's already installed, I don't think it will hurt anything.
-
- Debian Developer
- Posts: 464
- Joined: 2022-07-12 14:10
- Has thanked: 1 time
- Been thanked: 88 times
Re: [Software] [Virt Manager] QEMU guest agent not working in VMs
I don't think anyone is assuming that. You do not need to install qemu-guest-agent at all. I don't use it at all since spice gives me enough features and qemu-guest-agent increases attack surface unnecessarily in that case.Enigma83 wrote: ↑2024-04-17 09:08
Then if it's really not meant to be installed on the host, then its' only use case would be if the guest system were Debian or a Debian derivative (Ubuntu, Mint, etc). It cant be assumed that all non-Debian based distros will be guaranteed to have an installable package called "qemu-guest-agent". Some may, some may not.