Using WMR on Linux with SteamVR (Windows Mixed Reality) and playing Cyberpunk 2077 VR [R.E.A.L Mod]

WARNING!: Most of the tools used for WMR on Linux are in very early stages of development at the time of writing!

Windows Mixed Reality on Linux? Yes... yes, some people are just crazy and make everything possible. I tried it and it works very well. Much better than you would expect. More often than not, the Linux tools are far FAR more stable than the official windows tools (which are kinda not good. They are bad... like really bad. They are so bad that even my mum asked why the official tools are so unstable). Just wow and huge respect to the developers and the community behind the Linux Software!!!

At the end of this entry I have written down my thoughts on whether it is worth it. Read it before you do all this

Important: [AUR] means I used the AUR from Arch to install the software (using yay, pamac or any other software that can use the AUR). It's the same as installing the source code directly, but much more buggy and you need to check EVERY PKGBUILD for safety and make sure all dependencies are installed correctly. You can also just download the source of everything and just install it as it is done in the PKGBUILD files. [GIT] means you have to get it directly from the hosted repository to do a step. I use Steam normally (not as a flatpack). If you are using a flatpack, you will need to add "/run/host/" to each of the paths. I do not recommend flatpacks for this because of the bleeding edge nature of it all. You need quick and easy access to all the files, without extra steps to fix the tools. "###YOUR_USERNAME###" means that this should be your username from your linux porfile or you need to put your name there (ALSO IN SCRIPTS!).

At the time of writing, WMR controllers do not yet work. You have to use another controller, a ???Wii-Mote or hand tracking (which will never work very well with WMR because of the bad cameras. They were never meant to be used for this kind of detail detection, but that may change as I know the open source community by now :D).


> Things used overview (More stuff in sources section!):

First things first; This is the software and hardware I used. How I did setup everything, read on!

Hardware/OS:

Software:

(Install all dependencies, This not in the required installation-order! For the order read further)

Mod's:


How I installed everything:

I tried it on OpenSuse first, but some libraries are compiled incorrectly for this usecase there, which makes it hard to get everything working. So I am using Arch Linux for this. The scripts in the AUR are unfortunately not very good. A lot of dependencies are missing, this means you have to read every error output during installation for the missing dependencies / read the comments under the PKGBUILD page and add them yourself to the system.

This video by one of the developers (I think) can help you get started; https://youtu.be/Oqla04P_2QA. This is what I did to install everything correctly:

  1. Installing fmt9 [AUR], OpenHMD [AUR], libuvc [AUR], OpenCV, OnnxRuntime [AUR] and then basalt-monado-git [AUR].
  2. Downloading monado from there gitlab.freedesktop.org-page https://gitlab.freedesktop.org/monado/monado and executing the ./scripts/get-ht-models.sh batch-file to get the tracking-models.
  3. Adding the Udev rules from the "Creation and manual installation of udev rules"-section https://github.com/OpenHMD/OpenHMD/wiki/Udev-rules-list#creation-and-manual-installation-of-udev-rules
  4. Installing xr-hardware [AUR], OpenComposite [AUR] and monado-git [AUR] and making sure while monado-git is compiling (at the start) that the following items are correctly set/detected (DRIVER_HANDTRACKING: ON, FEATURE_SLAM: ON, BASALT: ON).
  5. Open Steam again and install the following application:
  6. Execute: ~/.steam/steam/steamapps/common/SteamVR/bin/vrpathreg.sh adddriver /usr/share/steamvr-monado
  7. Check that the output of this command has this at the end: ~/.steam/steam/steamapps/common/SteamVR/bin/vrpathreg.sh adddriver

    ###########
    External Drivers: monado : /usr/share/steamvr-monado ###########

  8. Add this to SteamVR's startup options: STEAMVR_EMULATE_INDEX_CONTROLLER=1 %command%
  9. Open Steam again and install the following application:
  10. Create the script below, change "###YOUR_USERNAME###" to your Linux username, make it executable and place it in your home directory:

    ###########
    #!/bin/bash # For OpenComposite, sould SteamVR not work: #VR_OVERRIDE=/run/host/usr/share/opencomposite XR_RUNTIME_JSON=/run/host/usr/share/openxr/1/openxr_monado.json PRESSURE_VESSEL_FILESYSTEMS_RW=$XDG_RUNTIME_DIR/monado_comp_ipc %command% # VR-SafeMode-CleanUp (https://linuxhint.com/replace_string_in_file_bash/): # - Assign the filename filename="/home/###YOUR_USERNAME###/.steam/steam/config/steamvr.vrsettings" # - Take the search string search="\"blocked_by_safe_mode\" : true" # - Take the replace string replace="\"blocked_by_safe_mode\" : false" # - Replacing String: if [[ $search != "" && $replace != "" ]]; then sed -i "s/$search/$replace/" $filename fi # Start Steam: export STEAMVR_PATH="~/.local/share/Steam/steamapps/common/SteamVR" export STEAM_RUNTIME=~/.steam/root/ubuntu12_64/steam-runtime export XDG_SESSION_TYPE=x11 export QT_QPA_PLATFORM=xcb export -n XDG_BACKEND export -n ELM_ENGINE export -n ELM_DISPLAY export -n WINIT_UNIX_BACKEND export -n BEMENU_BACKEND export -n SDL_VIDEODRIVER export -n ECORE_EVAS_ENGINE export -n CLUTTER_BACKEND export -n QT_WAYLAND_DISABLE_WINDOWDECORATION export -n QT_WAYLAND_FORCE_DPI export STEAMVR_EMULATE_INDEX_CONTROLLER=1 STEAMVR_EMULATE_INDEX_CONTROLLER=1 ~/.steam/steam/steamapps/common/SteamVR/bin/vrstartup.sh ###########

  11. The following is for steam and user applications. If you are running a VR program with root privileges, you will need to use a different command; https://monado.freedesktop.org/getting-started.html
  12. Execute: systemctl --user enable monado.socket
  13. Execute: systemctl --user start monado.socket
  14. Execute: mkdir -p ~/.config/openxr/1
  15. Execute: ln -s /usr/share/openxr/1/openxr_monado.json ~/.config/openxr/1/active_runtime.json
  16. Reboot!
  17. Execute: ~/.steam/steam/steamapps/common/SteamVR/bin/vrpathreg.sh adddriver /usr/share/steamvr-monado
  18. Check that the output of this command has this at the end (you may need to start SteamVR once to make this happen): ~/.steam/steam/steamapps/common/SteamVR/bin/vrpathreg.sh adddriver

    ###########
    External Drivers: monado : /usr/share/steamvr-monado holographic : /home/###YOUR_USERNAME###/.local/share/Steam/steamapps/common/MixedRealityVRDriver ###########

  19. Now open steam, open a terminal in your home directory and run vr.sh. SteamVR should start without problems. If not, make sure the following file looks like this (It is important that "LastKnown" shows YOUR headset at "HMDModel"!Mmonado is still in very early development and can crash. Steam will block unstable drivers from starting after an unhandled exception. It is important that this setting is ALWAYS reset. The script from me does this automagically :D):
    File: "/home/###YOUR_USERNAME###/.steam/steam/config/steamvr.vrsettings"

    ###########
    {"DesktopUI" : { "pairing" : "1960,680,799,599,0", "settings_desktop" : "1960,680,799,599,0" }, "GpuSpeed" : { "gpuSpeed0" : 1476, "gpuSpeed1" : 1472, "gpuSpeed2" : 1485, "gpuSpeed3" : 1493, "gpuSpeed4" : 1459, "gpuSpeed5" : 1420, "gpuSpeed6" : 1478, "gpuSpeed7" : 1478, "gpuSpeed8" : 1484, "gpuSpeed9" : 1445, "gpuSpeedCount" : 10, "gpuSpeedDriver" : "96477185", "gpuSpeedHorsepower" : 1474, "gpuSpeedRenderTargetScale" : 1, "gpuSpeedVendor" : "AMD Radeon RX 7900 XT (RADV GFX1100)", "gpuSpeedVersion" : 2 }, "LastKnown" : { "ActualHMDDriver" : "monado", "HMDModel" : "HP Windows Mixed Reality Headset" }, "driver_gamepad" : { "blocked_by_safe_mode" : false }, "driver_monado" : { "blocked_by_safe_mode" : false }, "steam.app.658920" : { "DominantHand" : 2 }, "steamvr" : { "installID" : "16430710729258384815", "lastVersionNotice" : "2.1.8", "lastVersionNoticeDate" : "1701302696" } } ###########

  20. After SteamVR runns you can start a game in VR. :D
  21. For Cyberpunk 2077 VR you need to get the R.E.A.L. Mod from LukeRoss at (The patreon required at the time of writing is 10€): https://www.patreon.com/realvr
  22. Place the file in the game folder as the developer intended. Open a terminal and run wine RealConfig.bat. It SOULD work. Then have a look at the "option.replace" for Cyberpunk and change the settings in the file "/###PATH_TO_YOUR_STEAM_LIBARY###/SteamLibrary/steamapps/compatdata/1091500/pfx/drive_c/users/steamuser/AppData/Local/CD Projekt Red/Cyberpunk 2077/UserSettings.json". You could also use protontricks to run the bath in the gamefolder inside the prefix BUT this only worked ONCE for me. I cannot share the file for copyright reasons. You could also do the install step on Windows and copy the json file and the game files to Linux.
  23. To get the most out of Cyberpunk 2077, we need a few mods:
  24. Optionally, you can increase performance and frame time by a good amount by running sudo setcap CAP_SYS_NICE=eip ~/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/vrcompositor-launcher. BUT this could break all controller support for good (e.g. in Cyberpunk or for racing sims and later for VR controllers!). To remove it, just run: sudo setcap CAP_SYS_NICE-eip ~/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/vrcompositor-launcher
  25. If something does not work, you can find the log for it at: "/home/###YOUR_USERNAME###/.steam/steam/logs/vrserver.txt"
  26. If something does not work with SteamVR, you can try OpenComposite. Run the monado-service in the terminal and start a Steam game with these startup options (DON'T CHANGE THEM! THIS WILL WORK FOR ANY KIND OF !DEFAULT! STEAM INSTALLATION!): "VR_OVERRIDE=/run/host/usr/share/opencomposite XR_RUNTIME_JSON=/run/host/usr/share/openxr/1/openxr_monado.json PRESSURE_VESSEL_FILESYSTEMS_RW=$XDG_RUNTIME_DIR/monado_comp_ipc %command%"
  27. Useful monado-service commands:


> How good dose it Work?:

Surprisingly well. The only time it crashes is when the heatset, or more precisely the basalt, loses its tracking completely and the position shoots into the stars. This can be prevented with a very variable and three dimensional area in front of you and the headset. My 3 displays cause tracking loss no matter what I do. But the table next to me with decorations on it and a few pictures on the wall works perfectly. I directed the room light to the table and it works really well and reliably. The problem is that sometimes the tracking gets lost very easily and on the next try it is unbreakable no matter what I do and tracks perfectly.

I often have to run the vr.sh script twice. The second time it usually works. I hold the headset where I want it to be and when everything is running, I put it on. The tracking is... fast enough. It definitely needs to get faster with development (basalt tracking) but its a good start.

Cyberpunk 2077 plays well. The settings and the fps are not ideal (around 90-120, thanks to the way the mod works, 45-60 at the headset). It is fine but not good. Other games made for VR are perfect because they are optimised for such high resolutions and fps for VR.

The big question is whether this is good enough for you. If you have a headset with outside-in tracking (infrared base station that helps your headset determine where it is. The best way to do tracking) or a well supported headset like the Valve Index or an HTC Vive then definitely (but then thanks to the native support you dont need to do any of the driver steps here. They just work!). With Inside-out tracking (cameras on the headset that scan the room and software that calculates your position), most WMR headsets for example, yes BUT only if you play games that are not too motion intensive and/or you have a room with a lot of stuff for the headset and software to detect and track reliably and quickly. Basalt is currently a little slow compared to the official tools and the delay in combination with standing up could cause nausea. But this can change quickly, or your setup may just work much better than mine, as always with such cutting-edge software :D. But for sitting VR (Racingsim or Cyberpunk 2077 for example) 100% YES! I do not currently play any games that require motion controls. Most WMR controllers are not supported at the time of writing (this will probably change relatively soon). If you have a workaround (3D camera and PS2/Wii/Hand Tracking with Basalt/any third party motion controller) then you can work around this. Basalt has also used hand tracking with the headset or even with a 3D camera I think (Kinect for example), but the tracking is not good (On WMR at least). Most WMR cameras just suck too much lol.

The last point I want to go over is: Should you buy a cheap WMR headset to get cheap and easy access to VR because Monado exists? The answer: NO! WMR sucks! Like real bad (In my opinion). It is like cheap fast food. It "tastes" """okay""" and you get it if there is no other option. Anything that is a SteamVR heatset, the Valve Index or HTC-Vive for example, preferably with outside in tracking, will work without special drivers (but you can still use them for even more compatibility in serten cases) and is FAR FAR F-A-R better. Inside-out tracking was, is and will always be very prone to desync, crashes and reboots every few hours !at least!. If you have a WMR headset for some reason and want to use it, this is a good way to make it useful without using a bad (IMO) OS, but if you don't have a VR headset, save the money and just buy something better. You will also be supporting SteamVR and the Linux driver to grow and keep a present on the market. Just avoid WMR (iMo!). But if you are "stuck" with it, yes, use Monado. At least your e-waste will be used :D. And yes, this rant was again fuelled by a bad WMR experience on Windows and an unstable Linux VR experience, fuelled by the inexplicably poor reliability of a VR headset everywhere. But I'm stuck with it, so I might as well use it.

Almost all games work with either SteamVR (works best) or OpenComposite.

A few things that helped me to get it more stable (and somtimes I dont know why):



I hope I could help you getting a very obscure way of playing Windows VR on Linux to work. I linked EVERYTHING I found useful in the sources section. Thanks to all the development behind these projects, you do a great job! Consider donating to them for a healthy open source community!


Sources: