How to integrate the VM graphical console inside a web browser with Spice.js


I would like to create a little React app with the LXD VM graphical console inside it, and some custom features. I see that you are using your own version of a SPICE web client : lxd-ui/src/lib/spice at main · canonical/lxd-ui · GitHub, and i was wondering why ? Should i just copy it inside my app ?

@edlerd do you have any information on this one?

In LXD-UI we use the spice-html5 client from

Some patches are added on top, but those are mostly to get responsiveness within the context of LXD-UI. Any functional or feature improvements we have upstreamed to spice-html5 by now. Those include keyboard input handling and some performance improvements.

If you want to see how to integrate between the lxd api and spice, have a look at the InstanceGraphicConsole component.

Long story short: If you are building a new app and want the spice integration, then better use upstream as a source.

1 Like