Skip to content

Instantly share code, notes, and snippets.

@drraccoony
Last active November 13, 2023 13:22
Show Gist options
  • Star 16 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save drraccoony/8a8d0a9e3dfde9fafd3e374e418d2935 to your computer and use it in GitHub Desktop.
Save drraccoony/8a8d0a9e3dfde9fafd3e374e418d2935 to your computer and use it in GitHub Desktop.
SteamOS3 on GPD Win 2 (via recovery image)

SteamOS 3 on GPD Win 2 (Via Steamdeck recovery)

gpd

Setting Expectations

This is a intensive task, but highly rewarding. Also this is based off the SteamDeck recovery image which is designed for the SteamDeck, not third party appliances.

If this is intimidating, please wait for official SteamOS3 to release publically. This is a little extra fiddling as its designed to work with a SteamDeck.

This also requires some degree of knowledge working around a linux terminal. Though with patience, you'll get a finished result.

If this guide helped you, feel free to buy me a coffee via Ko-Fi!

What works

  • Launching & Playing Games
  • Proper Screen Rotation
  • WiFi
  • Bluetooth
  • Keyboard, and joystick selector modes
    • Gamepad mode
    • Mouse gamepad mode

What doesn't

  • Touch screen needs calibration on Plasma Desktop
  • Function Keys for Vol -/+
  • Controller Game Rumble (obviously)
  • Night Mode
  • All Advanced power settings
    • Framerate Limit
    • TDP limit
    • Scaling Filter

GPD Win 1 users: I've heard reports of random crashes. I don't have a unit to diagnose this and cannot troubleshoot. Please let me know if anyone fixes this, or knows why.

Installation

Step 1: Installing SteamOS3

First the obvious disclaimer that I am NOT responsible for any damage you do. You can play around in the recovery USB though without installing.

⚠️Proceeding will wipe everything on your disk.

  1. Download the recovery image
  2. Create bootable USB with Rufus
  3. Hit delete while booting to access BIOS and set boot order to prioritize my USB, and saved changes
  4. Boot into Recovery USB for SteamOS
  5. Edit tools/repair_device.sh in your home directory to change disk to /dev/sda and remove the prefix (from "p").
    • You can do this in terminal with nano ~/tools/repair_device.sh
  6. Select option for "Reimage SteamDeck" on desktop

Let it run (it'll take some time). Don't reboot after.

Step 2: Fixing boot

This isn't required on all GPD Win devices, but its recommended just to play it safe. You're welcome to attempt to boot into SteamOS before trying this. If it fails, boot back into the Recovery USB and do these steps.

  1. In terminal, via recovery, run sudo blkid | grep sda | sort. You'll see something similar to:

    /dev/sda4: LABEL="rootfs" UUID="85bac642-d35f-4b85-bd5b-4df56ae56308" UUID_SUB="32550c6d-819f-4c22-b2db-fb4cf890eb42" BLOCK_SIZE="4096" TYPE="btrfs" PARTLABEL="rootfs-A" PARTUUID="f1b55fb7-59de-b34e-a2e9-0a497b9513c0"
    /dev/sda5: LABEL="rootfs" UUID="ccafc966-0af4-432e-b74c-272a39754c8c" UUID_SUB="c23c5a68-0d00-4767-a75a-8cdf46cfea92" BLOCK_SIZE="4096" TYPE="btrfs" PARTLABEL="rootfs-B" PARTUUID="a707c36a-3ca1-6546-97e0-b2a0615b62b3"
    /dev/sda6: LABEL="var" UUID="f96b7861-0988-4b37-ad38-1f627a990738" BLOCK_SIZE="1024" TYPE="ext4" PARTLABEL="var-A" PARTUUID="fbc55735-d32b-d246-9d91-643f58fd837b"
    /dev/sda7: LABEL="var" UUID="e58a674e-a72c-4e30-aa02-af5bb52945e6" BLOCK_SIZE="1024" TYPE="ext4" PARTLABEL="var-B" PARTUUID="db1b1609-9dea-d74a-b0bd-b76fde7c3411"
    /dev/sda8: LABEL="home" UUID="60f9824b-32c8-4c48-abe3-06286459fd8c" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="home" PARTUUID="cc965a2c-2212-624b-9f63-51f338c8f926"
  2. You'll have to update the grub config template to the radom UUID. Look for the partition labeled rootfs-A on the disk, copy the UUID field.

    • Example: set STEAMOS_ROOT_A=d9b54a83-c3aa-479f-b630-8dac41101a77
  3. You'll also have to update the efi partition information. Look for the partition labeled efi-A, copy the disk device path.

    • Example: set STEAMOS_EFI_A=/dev/sdb2

Now the GPD Win 2 should boot into SteamOS. However, please read the next sections before proceeding. We're not done in recovery yet.

Step 3: Temp fallback to Plasma Desktop

Booting now wont work entirely since Gamescope won't be happy with the version currently on your device. So we need to create a environment where we can boot in and correct the issue.

  1. First mount the rootfs you would like to boot to writable, for example, rootfs-A

    • sudo blkid
    • /dev/sdb4: LABEL="rootfs" UUID="d9b54a83-c3aa-479f-b630-8dac41101a77" UUID_SUB="c23c5a68-0d00-4767-a75a-8cdf46cfea92" BLOCK_SIZE="4096" TYPE="btrfs" PARTLABEL="rootfs-A" PARTUUID="fd5d0e43-e467-c443-8cfb-4dc086894ca2"
  2. After that modify /mnt/etc/sddm.conf.d/steamos.conf to look like below, You'll need to use sudo nano to modify this file. So type sudo nano /mnt/etc/sddm.conf.d/steamos.conf.

    #Session=gamescope-wayland.desktop
    Session=plasmawayland.desktop

    Use CTRL-X to exit the file, and hit Y to confirm changes and save.

If you're running through these steps on a GPD Win 2, continue to step 4a.
If you're doing this on a GPD Win 1, skip to step 4b.

Step 4a: Fixing Gamescope and Intel GPU (On Win 2)

If gamescope cannot start, one would just get a black screen. Which we need to fix. Gamescope currently has issues with Intel GPUs due to driver problems. You'll have to install older mesa packages and downgrade gamescope. See ValveSoftware/gamescope#392.

  1. To modify the active partition once booted, first set a password on the deck user with command passwd

  2. Then run the following commands in terminal:

    • sudo mount -o remount,rw /
    • sudo btrfs property set -t subvol / ro false
    • sudo steamos-readonly disable
  3. We need to add the repos needed, Edit /etc/pacman.conf with nano (sudo nano /etc/pacman.conf). Find the [extra] and [multilib] sections to make them look like this:

    [extra]
    Include = /etc/pacman.d/mirrorlist
    SigLevel = Never
      
    [multilib]
    Include = /etc/pacman.d/mirrorlist
    SigLevel = Never
  4. Finally: Downgrade Gamescope & install Intel Mesa:

    • This requires internet. Connect to a network or use a dongle for ethernet.
    • sudo pacman -S extra/mesa extra/vulkan-intel multilib/lib32-mesa multilib/lib32-vulkan-intel holo/gamescope
  5. Revert back to gamescope-wayland.desktop.

    • sudo nano /mnt/etc/sddm.conf.d/steamos.confand undo the changes we did earlier.
      • Remove Session=plasmawayland.desktop
      • Uncomment Session=gamescope-wayland.desktop
  6. Reboot your device, and you should have working gamescope and Steam Game UI! 🤞

Step 4b: Fixing Gamescope and xorg (On Win 1)

I do not own a GPD Win1, so I cannot provide troubleshooting. Thanks to "grump" for helping test out methods to get this guide working on their GPD Win1.

  1. To modify the active partition once booted, first set a password on the deck user with command passwd

  2. Then run the following commands in terminal:

    • sudo mount -o remount,rw /
    • sudo btrfs property set -t subvol / ro false
    • sudo steamos-readonly disable
  3. We need to add the repos needed, Edit /etc/pacman.conf with nano (sudo nano /etc/pacman.conf). Find the [extra] and [multilib] sections to make them look like this:

    [extra]
    Include = /etc/pacman.d/mirrorlist
    SigLevel = Never
      
    [multilib]
    Include = /etc/pacman.d/mirrorlist
    SigLevel = Never
  4. Grab the xf86-video-intel package from package manager with command sudo pacman -S xf86-video-intel

  5. After that make a xorg session from the wayland session.

    sudo cp /usr/share/wayland-sessions/gamescope-wayland.desktop /usr/share/xsessions/gamescope-xorg.desktop
  6. Then set sddm to launch the xorg session by changing /etc/sddm.conf.d/steamos.conf

    • Command sudo nano /etc/sddm.conf.d/steamos.conf
    • Modify to look like:
    #Session=gamescope-wayland.desktop
    Session=gamescope-xorg.desktop
  7. Change gamescope-wayland.desktop to gamescope-xorg.desktop in /usr/bin/steamos-session-select

    ...
    gamescope)
      #session_launcher="gamescope-wayland.desktop"
      session_launcher="gamescope-xorg.desktop"
    ;;
    ...
  8. Add sleep 5 to /usr/bin/gamescope-session after gamescope_pid="$!", So it looks like:

    gamescope -w ...
    gamescope_pid="$!"
    sleep 5
    if read -r -t 3 response_x_display response_wl_display <> "$socket"; then
  9. Attempt to go back to gamemode on the desktop. It won't work, but thats okay.

  10. SSH into your device from another computer.

    • In terminal, enter command ip address show and look for something like inet 192.168.1.5 under wlan0.
  11. The rest of these steps will be via SSH. Run top command to see processes and kill all the xorg / wayland / gamescope processes with kill PID_ID_HERE.

  12. Run sudo Xorg -configure

    • If it worked, you should see something about /root/xorg.conf.new being created.
  13. Run cp /root/xorg.conf.new /etc/X11/xorg.conf

  14. Run sudo nano /etc/X11/xorg.conf

    • In this file, look for a section called Section "Monitor"
    • In this section add Option "Rotate" "right"
    • For cleanliness, match the formatting of the other entries. Use spaces, not tabs.
    • Hit CTRL-X to exit, Hit Y to save the changes, and ENTER key to overwrite the file.
  15. Safely reboot your device with command systemctl reboot

  16. You should be running gamescope with proper monitor rotation.

Step 5: Fixing audio (GPD Win1 only)

  1. We need to run some commands in terminal to configure the audio engine (Wire plumber):

    mkdir -p ~/.config/wireplumber/main.lua.d
    cd ~/.config/wireplumber/main.lua.d
    cp /usr/share/wireplumber/main.lua.d/50-alsa-config.lua .
  2. We need to modify 50-alsa-config.lua, run command sudo nano 50-alsa-config.lua

  3. Find and modify these lines (be sure to uncomment them!)

    ["api.alsa.period-size"]   = 1024,
    ["api.alsa.headroom"]      = 8192,
    
  4. Restart the audio engine with command:

    systemctl --user restart wireplumber pipewire pipewire-pulse

Troubleshooting

"setting times of '/usr': Read-only file system" or other read-only error

You need to mount the system as read/write. This can be done with sudo steamos-readonly disable.

My fixes are undone after a reboot!

Its possible Steam updated itself. After an update, steam flips between two rootfs filesystems for the OS. One is labeled rootfs-A and the other is rootfs-B. You just need to go through the fixes one more time and then you're good to go.

I totally updated both rootfs A & B, but now its broken again!

Sometimes performing an update will undo some of the driver level changes we made to intel / gamescope. This is rare, but you may need to downgrade gamescope again. Just perform these steps in SSH:

sudo steamos-readonly disable
sudo pacman -S extra/mesa extra/vulkan-intel multilib/lib32-mesa multilib/lib32-vulkan-intel holo/gamescope

How do I find my IP Address of my deck?

In terminal, enter command ip address show and look for something like inet 192.168.1.5 under wlan0.

How do I SSH into my Deck?

Enable SSH with command in terminal:

sudo systemctl start sshd
sudo systemctl enable sshd

Then make sure you have a password set with passwd. If you're using Windows, you can use something called PuTTY to SSH into your device.

Your demo video had menu UI sounds, I want that!

You need to enable that. Go to "Settings" / Audio / "Enable UI Sounds".

Disable SteamOS Updates

I really don't recommend forcefully ceasing any updates to SteamOS as security patches and what not are important, plus you'd be missing out on the latest and greatest, but if you really don't want updates anymore, you can rename the two update scripts with the following commands:

mv /usr/bin/steamos-update /usr/bin/steamos-update-disabled
mv /usr/bin/steamos-update-os /usr/bin/steamos-update-os-disabled

If you want to re-enable updates, just rename the files back to their original filenames by removing the -disabled postfix. This'll entirely stop all SteamOS updates and will show an error when it tries to fetch the latest updates.

Citation & Sources

Changelog

  • 5/3/2022 : Instructions how to disable all SteamOS updates
  • 4/26/2022 : Added some troubleshooting steps, steps to fix audio on GPD Win1 & removed loaner device section
    • I decided that commiting to writing these guides for all the devices isn't worth the time, especially if they're going to eventually release SteamOS 3 officially down the road soon I hope.
  • 4/19/2022 : Rewrote sections that were missing details. Added GPD Win1 instructions.
  • 4/18/2022 : Updated some incorrect information, and a incorrect sudo blkid readout. Added troubleshooting section.
@mjkl-gh
Copy link

mjkl-gh commented Apr 21, 2022

First of all thanks for the great work, I've used it to start installing it on my Win 3

This post suggest there exist an command called sudo steamos-session-select plasma-persistent which is able to shorten the process of changing /etc/sddm.conf.d/steamos.conf

https://www.gamingonlinux.com/forum/topic/5200/

Also
sudo steamos-chroot --partset A

Drops you directly into a chroot of partition A (Or B if you change the cmd) allowing you to call

steamos-session-select

@grhmhome
Copy link

Thanks for the guide. It works on my brothers Win2. Question: Would it be possible to create a bash script that checks for drivers every time the OS boots and force the system to use the correct drivers? It seems that after updating, the system reverted back to the old drivers and I get booted into tty5. Reinstalling the correct drivers works, but for how long? Not sure. I know a little bit of bash scripting, but don't know if updating or rebooting would remove the bash script, especially if I use something like rc.local.

@mjkl-gh
Copy link

mjkl-gh commented Apr 25, 2022

Thanks for the guide. It works on my brothers Win2. Question: Would it be possible to create a bash script that checks for drivers every time the OS boots and force the system to use the correct drivers? It seems that after updating, the system reverted back to the old drivers and I get booted into tty5. Reinstalling the correct drivers works, but for how long? Not sure. I know a little bit of bash scripting, but don't know if updating or rebooting would remove the bash script, especially if I use something like rc.local.

Hej grhmhome, did you read about this: https://gist.github.com/drraccoony/8a8d0a9e3dfde9fafd3e374e418d2935#my-fixes-are-undone-after-a-reboot

Basically, the SteamOS consists of 2 mirrored partitions called A and B. After an update, it tends to switch to the other one. If you didn't install the changes over there, you need to do it again. This should be a one-time thing for both partitions (or actually a two-time thing per device)

@plrusek
Copy link

plrusek commented Jan 20, 2023

sorry for a bit of a bump on this old guide, i have a problem with step 3 on gpd win 1. first i'd want to mention that my actual system partition was named mmcblk1 so i followed the guide up to step 3 exactly but just with that change. also used the p suffix, was needed apparently, otherwise installation wouldnt continue. anyway, im confused about this mounting part. there's sadly no guide for a specific command and im not sure how listing block devices with blkid again is gonna help me here. other than that, next part of step 3 throws me a Read-only file system error or Unwritable whenever i try to edit steamos.conf. "sudo steamos-readonly disable" does not help. i'd appreciate some pointers

update: alright so im a little linux illiterate but i did manage to understand to just do "sudo mount -o rw /dev/mmcblk1p4 /mnt". the problem is, trying to edit with nano or giving extra permissions with chmod still outputs the "read-only file system" error.

update2: alright, ugh, ignore step 3 of the guide and just follow step 5 here: https://www.gamingonlinux.com/forum/topic/5200/
thanks to mjkl-gh for linking the thread.

update3: well, i tried my best. i did all the steps. except 4a of course since i'm on GPD Win 1. additionally i had to change stuff in pacman.conf because valve changed repository section names. so stuff like "extra" becomes "extra-main". if my session is "gamescope-xorg.desktop", it will continue to show me "steamdeck login:" in console and be stuck there. oh well. plasmawayland works just fine btw, maybe this device is just stuck on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment