Since LXC (Linux Containers) is a kernel level super-chroot, I've been wondering what sort of video driver the containers have:
My host is Ubuntu 12.04 64-bit machine with ATI gpu. Will the LXC container have access to the same driver? Or do they need to be installed on each container?
Please, take a look at this script to create a LXC container that runs steam with sound and video acceleration:
http://bazaar.launchpad.net/~ubuntu-lxc/lxc/steam-lxc/view/head:/steam-lxc
The magic comes here:
Outside LXC:
We export X11 with a bind mount the
/tmp/.X11-unix
directory to allow container to use host X11. Do the same with/dev/dri
directory and audio socket.Inside LXC:
Uses
pactl
to use a unix socket to communicate with host pulse audio server and later export the socket andDISPLAY
environment variable to allow steam to use local X11 server and socket to audio server.Take a look at the script and enjoy it :)
With that environment variables inside LXC you could play (theoretically) almost all games.
Best regards!
Container-based 'virtualisation' technologies such as OpenVZ and LXC don't virtualize any hardware, unlike Xen, KVM, VMware, etc. Another major difference is that LXC/OpenVZ containers are running in the same instance of a single Linux kernel, whereas real virtual machines are running their own kernel.
Because the containers are inside the same kernel and don't manage any hardware, they're 'running' the same driver, yet they don't have any knowlegde about it. All processes are simply chroot'ed and this is completely independent of hardware drivers (kernel modules).
To the best of my knowledge the lxc containers will have acess to the driver. check out this site for more info http://libvirt.org/drvlxc.html