Running Steam on your Linux PC can be annoying, mainly because of all the 32-bit dependencies.
The following things need to be set up on the host system:
- User namespaces
I used Ubuntu 18.04 bionic for my container, but you should be able to make any distribution work.
To create the container into a folder called
games, run this command as root:
# debootstrap --arch=amd64 bionic games
Note: I’m creating a 64bit container instead of 32bit because Steam had issues running in a 32bit container
To log in for the first time, run this as root:
# systemd-nspawn -UD games
Go ahead and set a root password, and create a user for yourself.
You can then log in using:
$ machinectl login games
I chose to start a second X server for the container to avoid games messing with my display.
Unfortunately, hardware acceleration does not work in XNest or Xephyr :(
Start the X server you wish to use, and use
$ xhost +local: to allow the container to connect to it
After that, you can start the container with this (replace X1 with X0 if you’re using your primary X server):
# systemd-nspawn --bind=/tmp/.X11-unix/X1 --bind=/dev/dri -bUD
That command binds the second X server and the graphics card, then runs the container in the background.
Log into the container, and add
I was unable to get PulseAudio working through a unix socket, so you need to enable remote connections using
After that, you can add
/etc/environment in the container.
After logging into the container and reloading
/etc/environment, you should be able to run X11 applications!
You can simply install Steam as normal, and most games will just work.