How to use spice-html5 in QEMU/virt-manager
Why?
This can be useful if you need solid remote access to a virtual machine using SPICE/QXL but don’t have access to the spice-gtk client for some reason.
Preparation
QEMU
If you are using QEMU without a GUI, you simply need to modify the SPICE parameter:
-spice port=5900,disable-ticketing
This applies if you want to use port 5900 (this can be changed). For example, in a full command:
qemu-system-x86_64 \
-m 1024 \
-cdrom TinyCore-current.iso \
-boot d \
-vga qxl \
-spice port=5900,disable-ticketing=on \
-device virtio-serial \
-chardev spicevmc,id=vdagent,debug=0,name=vdagent \
-device virtserialport,chardev=vdagent,name=com.redhat.spice.0
virt-manager
In virt-manager, you just need to ensure:
Spice Display -> Listen typeis set toAddressSpice Display -> Addressis set toLocalhostorAll interfaces
depending on your needs. Also, define a port if necessary (if set to
Auto, it will default to5900).
Starting spice-html5
To start spice-html5, you need to have websockify and, of course, spice-html5 installed.
Once you have both installed and your virtual machine is running, simply execute the following command:
websockify --web=/usr/share/spice-html5/ 5959 localhost:5900
5959is the target port, whilelocalhost:5900is the input address.
With this, if you open http://localhost:5959/spice.html in your browser (or replace localhost with your device’s IP), you will see the interface load and you’ll be able to control the virtual machine.

