11.3. SPICE Agent
11.3.1. Setting up Communication between the SPICE Agent and Host
virsh
or virt-manager can be used to configure communication between the guest and the SPICE agent. The following instructions describe how to configure the SPICE agent on a Linux guest.
Procedure 11.4. Setting up communication between guest agent and host with virsh
on a Linux guest
Shut down the virtual machine
Ensure the virtual machine (named rhel7 in this example) is shut down before configuring the SPICE agent:#
virsh shutdown rhel7
Add the SPICE agent channel to the guest XML configuration
Edit the guest's XML file to add the SPICE agent details:#
virsh edit rhel7
Add the following to the guest's XML file and save the changes:<channel type='spicevmc'> <target type='virtio' name='com.redhat.spice.0'/> </channel>
Start the virtual machine
#
virsh start rhel7
Install the SPICE agent on the guest
Install the SPICE agent if not yet installed in the guest virtual machine:#
yum install spice-vdagent
Start the SPICE agent in the guest
Start the SPICE agent service in the guest:#
systemctl start spice-vdagent
Procedure 11.5. Setting up communication between SPICE agent and host on a running Linux guest
Create an XML file for the SPICE agent
#
cat agent.xml
<channel type='spicevmc'> <target type='virtio' name='com.redhat.spice.0'/> </channel>Attach the SPICE agent to the virtual machine
Attach the SPICE agent to the running virtual machine (named rhel7 in this example) with this command:#
virsh attach-device rhel7 agent.xml
Install the SPICE agent on the guest
Install the SPICE agent if not yet installed in the guest virtual machine:#
yum install spice-vdagent
Start the SPICE agent in the guest
Start the SPICE agent service in the guest:#
systemctl start spice-vdagent
Procedure 11.6. Setting up communication between the SPICE agent and host with virt-manager
Shut down the virtual machine
Ensure the virtual machine is shut down before configuring the SPICE agent.To shut down the virtual machine, select it from the list of virtual machines in Virtual Machine Manager, then click the light switch icon from the menu bar.Add the SPICE agent channel to the guest
Open the virtual machine's hardware details by clicking the lightbulb icon at the top of the guest window.Click the Add New Virtual Hardware window, and select Channel.button to open theSelect the SPICE agent from the Name drop-down list, edit the channel address, and click :Figure 11.2. Selecting the SPICE agent channel device
Start the virtual machine
To start the virtual machine, select it from the list of virtual machines in Virtual Machine Manager, then click on the menu bar.Install the SPICE agent on the guest
Open the guest with virt-manager and install the SPICE agent if not yet installed in the guest virtual machine:#
yum install spice-vdagent
Start the SPICE agent in the guest
Start the SPICE agent service in the guest:#
systemctl start spice-vdagent