Xspice in containers

For some time I’ve been wanting to run ubuntu-desktop and others, remotely, in containers, using spice. Historically vnc has been the best way to do remote desktops, but spice should provide a far better experience. Unfortunately, Xspice has always failed for me, most recently segfaulting on startup. But fortunately, this is fixed in git, and I’m told a new release may be coming soon. While waiting for the new release (0.12.7?), I pushed a package based on git HEAD to ppa:serge-hallyn/virt.

You can create a container to test this with as follows:

lxc-create -t download -n desk1 -- -d ubuntu -r trusty -a amd64
lxc-start -n desk1 -d
lxc-attach -n desk1

Then inside that container shell,

add-apt-repository ppa:serge-hallyn/virt
apt-get update
apt-get install xserver-xspice ubuntu-desktop

ubuntu-desktop can take awhile to install. You can simply install fvwm and xterm if you want a quicker test. Once that’s all one, copy the xspice configuration file into your home directory, uncompress it, set the SpiceDisableTicketing option (or configure a password), and use the config file to configure an Xorg session:

cp /usr/share/doc/xserver-xspice/spiceqxl.xorg.conf.example.gz /root
cd /root
gunzip spiceqxl.xorg.conf.example.gz
cat >> spiceqxl.xorg.conf.example.gz << EOF
Option "SpiceDisableTicketing" "1"
EOF
/usr/bin/Xorg -config /root/spiceqxl.xorg.conf.example :2 &

Now fire up unity, xterm, or fvwm:

DISPLAY=:2 unity

Now connect using either spicy or spicec,

spicec -h  -p 5900

Of course if the container is on a remote host, you’ll want to set up some ssh port forwards to enable that, but if needed then that’s a subject for another post.

About these ads
This entry was posted in Uncategorized. Bookmark the permalink.

4 Responses to Xspice in containers

  1. Bill Nelson says:

    Thanks, that was really useful. A follow-up post talking about doing this with a remote container would be great.

  2. bmullan says:

    Serge… I followed the above and it popped up the unity interface. no sound channel etc and I could still see some error messages on the server related to out of memory for video but … it did work. Its 2am but now I am anxious now to try the spice-html5 connection tomorrow.

  3. c says:

    Would it be possible to set up something that would allow multiple users to connect to their own spice display?

    • s3hh says:

      In fact, each user can create their own unprivileged container and run spice in it. Of course they’ll want to use a password rather than disabling ticketing.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s