How to Virtualize SteamOS: Test Its Power Within QEMU/KVM

How to Virtualize SteamOS: Test Its Power Within QEMU/KVM

How to Run SteamOS on a Virtual Machine QEMU KVM

The Steam Deck has revolutionized handheld gaming, but its true power lies in its specialized Linux-based operating system. You don't need a physical handheld to explore the "Game Mode" interface or test software compatibility; by virtualizing the Deck’s environment, you can create a safe sandbox to experiment with the future of Linux gaming directly from your desktop.

Hi 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. I'm using Arch Linux btw! but you can follow this guide on any Linux distribution. In this guide you'll learn:

  • Creating a Virtual Hard Disk and Downloading SteamOS files
  • Attaching OVMF files for UEFI Boot support
  • SteamOS Installation, Updates, and PGP Verifications
  • Disabling SteamOS "Game Mode" for Desktop use in VM
  • Installing Packages and Testing Virtual Machine capabilities

This ultimate guide is designed to demystify the process of running Valve's OS in a virtualized environment. Whether you're a developer or a curious gamer, by the end of this walkthrough, you'll have a fully functional SteamOS environment ready for testing.

Neofetch in SteamOS on a Virtual Machine






Prerequisites

To achieve near-native performance when running SteamOS on a virtual machine, a fully-optimized QEMU environment is essential. While QEMU can technically run on Windows, leveraging the full power of KVM (Kernel-based Virtual Machine) is far more efficient on a Linux host.

If you haven't configured your virtualization stack yet, I highly recommend following my step-by-step QEMU/KVM setup guide to ensure your hardware acceleration is properly enabled.

For those who don't have a Linux environment ready, Arch Linux is an excellent choice for a lightweight and up-to-date host system. You can get started by reading my How to Automate a Minimal Arch Linux Installation, which walks you through building a stable foundation for high-performance virtualization.

System Specifications:

  • Processor: Intel or AMD 64-bit capable and should support hardware-assisted virtualization.
  • RAM: 4GB or more.
  • Hard Drive: For the 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 obtain the .img file.

Extract SteamOS Image

  • Run the following command:
tar -xjf steamOS-recovery-image.bz2



Step 2: Setting Up the Environment for SteamOS Virtualization

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, virtual 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 virtual 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:

Folder structure showing SteamOS image, virtual drive, and OVMF firmware files for QEMU



Step 3: Installing SteamOS on QEMU

I have gathered all my files in a dedicated folder. Open your terminal in your 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
QEMU Flags:

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.

SteamOS recovery screen showing installation options

Note: After the installation is complete, the system will prompt you to reboot to finalize the process. Click the Cancel button instead. This is because the reboot would normally try to launch into Gaming Mode, which won't work inside a VM, so we need to change the default desktop session.

SteamOS installation process animation showing recovery image installation

Bypassing SteamOS Gaming Mode Boot

Fortunately, we can use the Recovery Image's KDE Plasma 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 a 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 enable
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
SteamOS first boot animation showing successful startup in QEMU VM

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.

After successfully booting into SteamOS for the first time, you'll be greeted with the KDE Plasma desktop. Before you can start installing additional software, you need to set up administrative access:

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. 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 two methods:

  • Partset Other Method
  • Partset A/B Method

4.6.1: Partset Other Method

  • Open a 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
Disabling SteamOS Gaming Mode using Partset Other method

4.6.2: Partset A/B Method

  • Open a terminal inside the 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.

Updated SteamOS booted in VM with KDE Plasma as default desktop session


🎉 Congratulations, your SteamOS setup is complete!

You have successfully installed SteamOS on QEMU. You are now ready to explore the Steam Deck ecosystem and test your favorite games in a secure virtual environment.

What's Next?

🎮 Unlock Gaming Performance: SteamOS thrives on hardware power. If you want to achieve native frame rates, check out my guide on Single GPU Passthrough for QEMU.

💻 Linux for Windows Users: If you are primarily a Windows user but want to keep Linux tools handy, learn how to install WSL/WSL2 on Windows for a seamless experience.

🌐 Cloud OS Alternative: Interested in other lightweight systems? Follow my Chrome OS Flex QEMU guide to try Google's cloud-first OS alongside SteamOS.

🔍 System Check: Before jumping into advanced graphics, ensure your PC supports IOMMU in the BIOS. This is a mandatory step for hardware acceleration.

If this guide helped you, feel free to subscribe for more tutorials. If you encounter any issues, I would be happy to help in the comments.
101 out, I’ll see you in the next one! 🚀

Load comments