Simple opengl-in-lxc multimachine demo for ubuntu


(Dan Kegel) #1

Every year or so, I try out opengl in lxc :slight_smile: I had it working in production with lxc 1.0, but boy was that a pain. Now with lxc 3.13 it seems to be… easy? Took a couple days to realize that, though, what with all the old doc floating around.

Because I want to run build workers across a large number of machines
in lxc using opengl, I wrote a demo script that takes a list of hostnames,
remotely sets up lxc to pull slightly preloaded images from a central host
(to test out lxd’s publish feature), and run glxgears in lxc.
It works on Intel, AMD, and Nvidia graphics, on 6 out of 7 machines I’ve tried…
not sure what’s with that last machine, the script’s probably got a few issues.

Here’s the script if anyone’s interested:
http://kegel.com/linux/lxc-opengl-demo/lxc-opengl-demo.sh.txt

I haven’t figured out X authentication yet, so I had to run xhost + manually on all the machines first. (Anyone know how to avoid that?)


(ryanerwin) #2

Does it work via SSH without LXC?

If it’s an .Xauthority issue, check what: xauth list shows you, and do an xauth add 1c94dc38a8b047ffffffffffffffffff.