Is there some documentation on how I can set up Spice to work with my LXD VMs?
I tried installing the spice-vdagent on the VM but I think I’m missing something as it won’t start until it is started manually (systemctl enable doesn’t enable it, outputs errors). However, I still do not see it listening on some port that I can use to connect to from the host machine using the spice-client.
Yes, seen it but how do I create a spice device inside the VM so that I can access spice from the web browser?
From what I understood, spice-vdagent and a spice device must be configured in the VM and then from the host I can access spice with virt-viewer or any other spice client. Is that correct?
The LXD-UI uses the LXD API which provides the spice protocol over websocket back to LXD server, which then connects that to the raw console output of the VM, without needing to setup spice inside the VM guest.
The lxc CLI tool will setup a local spice URL that you can connect to using a local client as well.
You are of course able to setup a spice server inside the VM guest too/instead, but that isn’t anything LXD specific.
Is it spice-vdagent that needs to be installed or some other package? I can’t get spice-vdagent to work. I do not see it listening on any port inside the guest VM. If you can go into some specifics here, that will be very helpful for me.
Edit: I tested with Ubuntu Noble VM. Please let me know if you need more information. And one more question: So adding spice config to raw.qemu is not necessary?
the LXD API which provides the spice protocol over websocket back to LXD server, which then connects that to the raw console output of the VM, without needing to setup spice inside the VM guest.
Instead the lxc CLI tool will open a port locally on your machine and tunnel it back to the remote LXD using its HTTPS API:
The lxc CLI tool will setup a local spice URL that you can connect to using a local client as well.
So if you are wanting to go that route then you should start with making LXD’s API reachable externally:
There is no prebuilt solution for this in LXD. You can write your own that uses LXD’s API (like lxc and LXD-UI do) or you can setup spice server inside the guest.