I started from these discussions
Start by installing the required packages in the VM (best in a new container for testing, I used bionic)
• apt-get install xserver-xspice spice-vdagent dbus-x11
• apt-get install mate-desktop-environment
The first line above is the spice elements, then you need a desktop (seond line) - I prefer Mate in VMs so as to avoid compositor
Create a Spice config file
• cp /usr/share/doc/xserver-xspice/spiceqxl.xorg.conf.example.gz ~/
• cd ~/
• gunzip spiceqxl.xorg.conf.example.gz
• cp spiceqxl.xorg.conf.example ~/spiceqxl.xorg.conf
Then edit the config file and disable ticketing (up to you, but I’m in a secure LAN playpen so don’t need password protection) reduce the number of “heads” to improve screen size handling and enable vdagent for clipboard sharing (if required)
◦ Section "Device"
◦ Identifier "XSPICE"
◦ Driver "spiceqxl"
◦
◦ # ---- Network and security options
◦
◦ # ========================================= {me} Changes ==================================== #
◦ # Do not require a client password.
◦ # default: False
◦ #Option "SpiceDisableTicketing" "False"
◦ Option "SpiceDisableTicketing" "True"
◦ # ========================================================================================= #
◦ # ========================================= {me} Changes ==================================== #
◦ #Option "NumHeads" "4"
◦ Option "NumHeads" "1"
◦ # ========================================================================================= #
◦ # ========================================= {me} Changes ==================================== #
◦ # Whether or not to accept Vdagent connections.
◦ # default: False
◦ #Option "SpiceVdagentEnabled" "False"
◦ Option "SpiceVdagentEnabled" "True"
◦ # ======================================================================================== #
Then create/update /etc/default/spice-vdagentd with line
SPICE_VDAGENTD_EXTRA_ARGS=-X
Then you can start the xSpice server using a command as below.
Note that I chose console number 10 (see “:10”) along with port number 5910 so as to avoid VNC and X2Go running on the same server whilst testing
# Attemp with external start of vdagent ... because clipboard sharing wont work, no access to /dev/uinput /dev/virtio-ports/com.redhat.spice.0 /dev/vport1p2
Xspice --config /home/redger/spiceqxl.xorg.conf --disable-ticketing --port 5910 --tls-port 0 \
--vdagent-no-launch -logfile /var/log/Xspice/Xorg.log -noreset :10 \
2>/home/{me}/Xspice/Xspice.err >/home/{me}/Xspice/Xspice.log &
I run the above command from /etc/rc.local (after checking Xspice isn’t already running - just in case the service has been enabled)
A similar command which will simultaneously enable vdagent is, though I dont’ recommend this for testing purposes
# Xspice --config /home/{me}/spiceqxl.xorg.conf --disable-ticketing --port 5910 --tls-port 0 --auto \
# --vdagent --vdagent-exec /usr/bin/spice-vdagent --vdagentd-exec /usr/sbin/spice-vdagentd -logfile ~/Xspice/Xorg.log -noreset :10 \
# 2>/home/{me}/Xspice/Xspice.err >/dev/null &
If starting vdagentd as a service, or as part of the Xspice command you’ll probably need to create file /etc/default/spice-vdagentd with line
◦ SPICE_VDAGENTD_EXTRA_ARGS=-X
To enable vdagent manually, you need to start both the server and the client (first check they’re not already running). On initial install the server is likely to be started automatically so you may want to stop and disable it
◦ systemctl stop spice-vdagent
◦ systemctl disable spice-vdagent
To start the vdagent server, for the 1st / system element of shared clipboard support, manually with parameters, including no daemonise so we can easily see the messages
◦ spice-vdagentd -X -x -f -d
Or you could use systemd, though this is less useful for testing
◦ systemctl start spice-vdagent
To start the vdagent client / 2nd part (for clipboard support), start the desktop first, then start the client - see below
Launch the desktop (as normal user)
-
DISPLAY=:10 /usr/bin/dbus-launch --exit-with-session mate-session 2>/home/{me}/Xspice/dbus-launch.err >/home/{me}/Xspice/dbus-launch.log &
The default parameter we set for vdagentd above addresses and issue with systemd and login but it will limit connections to just 1, so I start vdagent from my own account using the same display as the spice server
-
DISPLAY=:10 spice-vdagent -d> /home/{me}/Xspice/vdagent.log &
I also have information on the elements created by Qemu in a hv guest if you’re interested. None of it led to an easy solution to the clipboard problem.
EDIT: Forgot to add instructions for the client. you’ll want to use a spice client, either
- spicy from package spice-client-gtk. Invoke with “spicy {ip address} port 5910”
- remote-viewer from package virt-viewer. Invoke with “remote-viewer spice://{ip address}:5910”
- remmina (packages remmina, remmina-plugin-splice)… which includes a gui front end
R
PS this is all prepared in a hurry so please excuse any mistakes or omissions