Using Distrobox For VR Gaming
This page intends to walk you through setting up your own Distrobox container for VR gaming with Steam, SteamVR, Monado (Note: You may not need SteamVR) and a tool you might find useful for interacting with your desktop.
Why Distrobox?
In short, this ensures programs we'll use have access to dependencies they need. To elaborate: you may choose to run programs that need glibc among other things, such as Steam. Typically you can circumvent this by installing them with Flatpak, which provides them with such dependencies, however also sandboxes them and that may prevent you from using certain hardware as the applications cannot have access to it, or even your host's software.
Distrobox does this without the sandbox.
Before You Start
There may be some prerequisites first.
Go ahead and install steam-devices
and libcap-setcap
to ensure your devices can be used
and to set the right capabilities of the SteamVR binary respectively later on. You need to have main
and community
repositories enabled at the very least, testing
may be useful aswell
# apk add steam-devices libcap-setcap
If you haven't already, please set up Distrobox as per the page's instructions to install it and configure Podman to run in rootless mode (However we will be using a rootful container).
Also, make sure your Desktop environment or Wayland compositor implements the DRM leasing protocol if you have a wired headset (e.g. HTC Vive or Valve Index), see here
Setting Up Your Container
To do this as cleanly as possible, it's recommended that you make a directory to store your container's home, so that it doesn't pollute your host's home.
You may call the container whatever you want, this guide will use "vrbox"
$ mkdir -p ~/Containers/vrbox
Next is actually creating the container in question. We will name it "vrbox", set the hostname to the same name, and choose a convenient image for the container, this example uses the latest Fedora image. It's possible to use rawhide or any distro you'd like, what matters is that it works. Note the --root
argument, which creates a rootful container, and you will need to use it with every enter command to access the container.
Remember to substitute <user>
with your username.
$ distrobox create --home /home/<user>/Containers/vrbox --name vrbox --hostname vrbox --image fedora:latest --root
Now, enter your container to initialize it
$ distrobox enter --root vrbox
Installing Steam and SteamVR
And this is where the fireworks come in as we begin installing Steam itself. To do that you will need to install the free and nonfree rpm fusion repositories like so.
$ distrobox enter --root vrbox -- sudo dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-42.noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-42.noarch.rpm -y
Additionally, the Fedora documentation mentions needing this
$ distrobox enter --root vrbox -- sudo dnf config-manager setopt fedora-cisco-openh264.enabled=1
Finally, install Steam
$ distrobox enter --root vrbox -- sudo dnf install steam -y
After this, you will need to launch Steam and login and install SteamVR.
$ distrobox enter --root vrbox -- steam
Try to launch it once or twice, notice it may or may not work already. To make sure it does, set the right capabilities to the binary and relaunch
# setcap CAP_SYS_NICE+ep /home/user/Containers/vrbox/.steam/steam/steamapps/common/SteamVR/bin/linux64/vrcompositor-launcher
Common SteamVR Issues
SteamVR on Linux often has plenty of issues, Here's how to mitigate the ones you may run into.
Room Setup Cannot Launch Or Crashes Instantly
You can use Quick Calibration to circumvent Room Setup, as noted in this LVRA wiki page
Set the headset and controllers on the floor in the center of the playspace. Run the Quick Calibration utility from the SteamVR-Monitor (the desktop utility showing basestations, headset and controller icons) under Settings > Developer > Room and Tracking. This will setup a standing play area for you to use.
If the Settings window crashes when selecting Developer, try opting into SteamVR Beta first. When calibrated, you should switch back to the stable SteamVR (opt out of Beta).
Turning On Controllers Launches SteamVR
Why is this an issue? It may be if you happen to want to use Monado instead (explained later in this guide), as you do not want to run SteamVR and Envision/Monado at the same time.
The steps to disable this are in LVRA wiki on this page
Why Monado/WiVRn?
It's simple, as SteamVR has a pile of issues, for example lack of reprojection (this means the inside of your headset will be stuttery) or otherwise general bugs and worse performance. Monado doesn't have these issues.
Monado is for wired headsets such as the HTC Vive. WiVRn is based on Monado.
Using Monado Instead of SteamVR with Envision
If you have done everything else right so far, you should be able to install Envision, which will help you setup Monado easily
$ distrobox enter --root vrbox -- sudo dnf install git envision envision-monado
With this done, simply launch Envision like so
$ distrobox enter --root vrbox -- envision
Make sure to read up on Envision to know how to use it. After building a profile, it might ask you to set the right capabilities for the Monado binary, which you would do in essentially the same way as for SteamVR's binary.
Using WiVRn Instead of SteamVR for Standalone Headsets
In contrast (but not really) to Monado, there's WiVRn for standalone headsets such as the Quest. You have a few options with this, as you can continue with the Distrobox trend and install it using
$ distrobox enter --root vrbox -- sudo dnf install wivrn
And proceed to also install required codecs.
Alternatively, you could simply not bother with Distrobox and go the Flatpak way (including Flatpak Steam)
$ flatpak install io.github.wivrn.wivrn
But you will need to do extra setup as explained in the WiVRn LVRA wiki page.
Running Additional Software for VR/XR
For example WlxOverlay-S, which allows you to interact with your desktop inside VR.
Running it is simple, the procedure is as follows:
- Download the relevant AppImage or binary
- Move it somewhere in your container's home directory, i.e. ~/Containers/vrbox/wlx/
- Make it executable using
$ chmod +x ~/Containers/vrbox/wlx/WlxOverlay-S-*.AppImage
- Run it using (use the correct path)
$ distrobox enter --root vrbox -- ~/Containers/vrbox/wlx/WlxOverlay-S-xxx.AppImage
WlxOverlay-S specifically requires functional xdg desktop portals, like those seen here in PipeWire#Screen_sharing_on_Wayland, and it may be important for you to setup Pipewire using its user service as showed in PipeWire#Pipewire_user_service