How to Virtualize SteamOS: Test Its Power Within QEMU/KVM
Guide Installation QEMU steamos WalkthroughHi all, welcome to my blog, MusaBase! In this article, I'll walk you through installing SteamOS on a Virtual Machine using QEMU/KVM in Linux. This ultimate guide will show you how to create a virtual hard disk, download the SteamOS file, attach OVMF firmware to boot SteamOS, install & update SteamOS, perform PGP verifications, disable SteamOS Game Mode, install packages on SteamOS in QEMU, and test its virtual machine capabilities. I'm using Arch Linux btw! but you can follow this guide on any Linux distribution.
Jump to:
Prerequisites
To run SteamOS on a virtual machine we need a fully-installed QEMU for near-native performance. While it's possible to use QEMU on Windows, but managing KVM on Windows can be cumbersome. Therefore, Linux is the recommended platform. If you haven't installed QEMU yet or need guidance, check out my walkthrough on installing and configuring QEMU on Linux. Additionally, for installing a Linux Operating System, read my article on Arch Linux installtion. System Specifications:
- Processor: Intel or AMD 64-bit capable and should support Hardware-assisted Virtualization.
- RAM: 4GB or more.
- Hard-Drive: For OS alone 16GB for further testing and gaming 200GB.
- Operating System: Any recent Linux distribution 32-bit or 64-bit although i'm using 64-bit.
- Virtual Tool: QEMU.
Step 1: Acquire SteamOS Image
We can download the SteamOS image from Steam's official SteamOS page. Note that the SteamOS recovery image is provided in BZIP2 format. After downloading, simply extract the archive to obatin the .img file.
Step 2: Setting up the Environment for SteamOS Vritualization
This step is optional, you can skip this step and proceed directly to the installation if you wish. However, I recommend creating an empty folder to store your SteamOS image, virutal hard drive, and the necessary ovmf files for UEFI. (SteamOS recommends using UEFI firmware).
2.1. Creating a Virtual Drive with QEMU
I am going to create a virtual drive in QCOW2 format. (Feel free to use your preferred format if desired).
\- To create a virutal drive with QEMU, open your terminal and type:
qemu-img create -f qcow2 steamOSDrive.qcow2 16G
Now, your folder should contain the following four files:
Step 3: Installing SteamOS on QEMU
I have gathered all my files in a dedicated folder. Open your terminal in you SteamOS folder and run QEMU with the following command:
qemu-system-x86_64 \
> -cpu host -enable-kvm -smp 2 -m 8G \
> -drive if=pflash,format=raw,unit=0,file=OVMF.fd,readonly=on \
> -drive if=pflash,format=raw,unit=1,file=OVMF_VARS.fd \
> -drive file=SteamOS.img,format=raw \
> -drive if=none,id=nvme0,file=steamOSDrive.qcow2 \
> -device nvme,drive=nvme0,serial=badbeef \
> -display "gtk,gl=on" \
> -device usb-tablet -usb
After running the above command, QEMU will launch with all specified flags and load the SteamOS recovery image. Within a few seconds, you will see the SteamOS Desktop Screen, where you can proceed to install SteamOS.
On the desktop, you should see four options:
- Clear local user data
- Reimage Steam Deck
- Reinstall SteamOS
- Terminal with repair tools
To begin installing SteamOS on QEMU, open Reimage Steam Deck and click Proceed.
Note: After the installation is complete, the system will prompt you to reboot to finalize the process. Click the button instead. This is because the reboot would normally try to launch into Gaming Mode, which won't work inside a VM, so we would need to change the default desktop session.
Bypassing SteamOS Gaming Mode Boot
Fortunately, we can use the Recovery Image's KDE Plamsa Session to enter a chroot environment.
- Inside QEMU press Ctrl + Alt + G to grab or return the input focus.
- Press Ctrl + Alt + T to open terminal inside SteamOS.
- In the steamOS terminal, run the following commands consecutively:
cd /dev
sudo steamos-chroot --disk nvme0n1 --partset A --no-overlay
steamos-readonly disable
echo '[Autologin]' > /etc/sddm.conf.d//zz-steamos-autologin.conf
echo 'Session=plasma.desktop' >> /etc/sddm.conf.d//zz-steamos.autologin.conf
steamos-readonly enable
exit
sudo steamos-chroot --disk nvme0n1 --partset B --no-overlay
steamos-readonly disable
echo '[Autologin]' > /etc/sddm.conf.d//zz-steamos-autologin.conf
echo 'Session=plasma.desktop' >> /etc/sddm.conf.d//zz-steamos-autologin.conf
steamos-readonly disable
exit
reboot
Step 4: Boot into SteamOS & Further Configuration
Now that the installation is complete, we can remove the SteamOS-Recovery.img flag from the QEMU run command since it is no longer needed. Run QEMU again with the updated command for booting into SteamOS:
qemu-system-x86_64 \
-cpu host -enable-kvm -smp 2 -m 8G \
-drive if=pflash,format=raw,unit=0,file=OVMF.fd,readonly=on \
-drive if=pflash,format=raw,unit=1,file=OVMF_VARS.fd \
-drive if=none,id=nvme0,file=steamOSDrive.qcow2 \
-device nvme,drive=nvme0,serial=badbeef \
-display "gtk,gl=on" \
-device usb-tablet -usb
Since SteamOS is an Arch-based distribution, it uses pacman as its default package manager. This allows you to install and update packages easily. But first, you need to set a root password for your SteamOS.
4.1: Setting the Root Password
- Open a terminal in the Virtual Machine and run:
passwd
When prompted, enter and re-enter your new root password. With the root password set, you can now download and manage packages.
4.2: Package Signing and Signature Verification
To ensure that every package you install is authentic, you need to establish a secure keyring for pacman.
- To establish a secure keyring, run these commands consecutively:
sudo pacman-key --init
sudo pacman-key --populate archlinux
sudo pacman-key --populate holo
4.3: Disable SteamOS Read-Only Mode
SteamOS is set to read-only mode by default (to support Gaming Mode). To install or update packages, you need to disable this mode.
- To disable read-only mode, run:
sudo steamos-readonly disable
4.4: Updating System Packages
Finally we can now update and install system packages with pacman. now run:
sudo pacman -Syu
4.5: Update SteamOS
The recovery image provides SteamOS version 3.5. To update your system to the latest version, run:
steamos-update
4.6: Applying updates and Setting the Default Desktop Session
After updating, the system may revert to Gaming Mode by default. To ensure that KDE Plasma is your default desktop session, you have tow methods:
- Partset Others
- Partset A/B
4.6.1: Partset Other Method
- Open terminal and run the following commands consecutively:
sudo steamos-chroot --partset other
mount -o remount,rw /
steamos-readonly disable
echo '[Autologin]' > /etc/sddm.conf.d//zz-steamos-autologin.conf
echo 'Session=plasma.desktop' >> /etc/sddm.conf.d//zz-steamos-autologin.conf
steamos-readonly enable
exit
reboot
4.6.2: Partset A/B Method
- Open terminal inside VM and type these commands consecutively:
cd /dev
sudo steamos-chroot --disk nvme0n1 --partset A --no-overlay
mount -o remount,rw /
steamos-readonly disable
echo '[Autologin]' > /etc/sddm.conf.d//zz-steamos-autologin.conf
echo 'Session=plasma.desktop' >> /etc/sddm.conf.d//zz-steamos-autologin.conf
steamos-readonly enable
exit
sudo steamos-chroot --disk nvme0n1 --partset B --no-overlay
mount -o remount,rw /
steamos-readonly disable
echo '[Autologin]' > /etc/sddm.conf.d//zz-steamos-autologin.conf
echo 'Session=plasma.desktop' >> /etc/sddm.conf.d//zz-steamos-autologin.conf
steamos-readonly enable
exit
reboot
After rebooting, your system should now boot into the latest version of SteamOS with KDE Plasma as the default desktop session.
Afterwards
Now that you have successfully installed SteamOS on QEMU, you can take your setup even further by enabling GPU passthrough and hardware acceleration for improved gaming performance. Before you do so, make sure your PC supports IOMMU.
With your updated system, you can now explore GPU passthrough options in QEMU and other advanced configurations to enhace your gaming experience.
If you encounter any issues at any step, please let me know in the comments. I’d be more than happy to help.
1O1 out, i will see you in the next one.