2.2. Enabling QEMU Guest Agent features on your virtual machines
To use certain features on a virtual machine (VM) hosted on your RHEL 10 system, you must first configure the VM to use the QEMU Guest Agent (GA).
For a complete list of these features, see Virtualization features that require QEMU Guest Agent.
2.2.1. Enabling QEMU Guest Agent on Windows guests 复制链接链接已复制到粘贴板!
To allow a RHEL host to perform a certain subset of operations on a Windows virtual machine (VM), you must enable the QEMU Guest Agent (GA). To do so, add a storage device that contains the QEMU Guest Agent installer to an existing VM or when creating a new VM, and install the drivers on the Windows guest operating system.
To install the Guest Agent (GA) by using the graphical interface, see the procedure below. To install the GA on a command line, use the Microsoft Windows Installer (MSI).
Prerequisites
- An installation medium with the Guest Agent is attached to the VM. For instructions on preparing the medium, see Preparing virtio driver installation media on a host machine.
Procedure
-
In the Windows guest operating system, open the
File Explorerapplication. -
Click
This PC. -
In the
Devices and drivespane, open thevirtio-winmedium. -
Open the
guest-agentfolder. Based on the operating system installed on the VM, run one of the following installers:
-
If using a 32-bit operating system, run the
qemu-ga-i386.msiinstaller. -
If using a 64-bit operating system, run the
qemu-ga-x86_64.msiinstaller.
-
If using a 32-bit operating system, run the
Optional: If you want to use the para-virtualized serial driver (
virtio-serial) as the communication interface between the host and the Windows guest, verify that thevirtio-serialdriver is installed on the Windows guest.For more information about installing
virtiodrivers, see: Installing virtio drivers on a Windows guest.
Verification
On your Windows VM, navigate to the Services window.
Computer Management > Services
-
Ensure that the status of the
QEMU Guest Agentservice isRunning.
If you enable QEMU Guest Agent (GA) on a virtual machine (VM), you can use the following commands on your host to manage the VM:
virsh shutdown --mode=agent-
This shutdown method is more reliable than
virsh shutdown --mode=acpi, becausevirsh shutdownused with QEMU GA is guaranteed to shut down a cooperative guest in a clean state.
virsh domfsfreezeandvirsh domfsthaw- Freezes the guest file system in isolation.
virsh domfstrimInstructs the guest to trim its file system, which helps to reduce the data that needs to be transferred during migrations.
重要If you want to use this command to manage a Linux VM, you must also set the following SELinux boolean in the guest operating system:
# setsebool virt_qemu_ga_read_nonsecurity_files onvirsh domtime- Queries or sets the guest’s clock.
virsh setvcpus --guest- Instructs the guest to take CPUs offline, which is useful when CPUs cannot be hot-unplugged.
virsh domifaddr --source agent- Queries the guest operating system’s IP address by using QEMU GA. For example, this is useful when the guest interface is directly attached to a host interface.
virsh domfsinfo- Shows a list of mounted file systems in the running guest.
virsh set-user-password- Sets the password for a given user account in the guest.
virsh set-user-sshkeysEdits the authorized SSH keys file for a given user in the guest.
重要If you want to use this command to manage a Linux VM, you must also set the following SELinux boolean in the guest operating system:
# setsebool virt_qemu_ga_manage_ssh on