ublue-os / bazzite

Bazzite is a custom image built upon Fedora Atomic Desktops that brings the best of Linux gaming to all of your devices - including your favorite handheld.
https://bazzite.gg
Apache License 2.0
3.79k stars 224 forks source link

Virtualization is not supported on Steam Deck #877

Closed zqpvr closed 6 months ago

zqpvr commented 7 months ago

Describe the bug

deck@steamdeck:~$ ujust setup-virtualization Virtualization is not supported on Steam Deck deck@steamdeck:~$

What did you expect to happen?

I expect it to work as I use vm's before on my steam deck, this message is wrong.

Output of rpm-ostree status

deck@steamdeck:~$ rpm-ostree status
State: busy
Transaction: install -y virt-manager edk2-ovmf qemu 
  Initiator: client(id:cli dbus:1.3176 unit:run-r732c5d90fccb46d98519ccad1df5f2b6.scope uid:1000)
Deployments:
  ostree-image-signed:docker://ghcr.io/ublue-os/bazzite-deck:stable
                   Digest: sha256:a0c8b3c6d8db35c53617209b90559099d7d11b91281171e7bae89ad9cc65ecdd
                  Version: 39.20240312.0 (2024-03-12T16:59:25Z)
                     Diff: 1 added
          LayeredPackages: dnscrypt-proxy htop sunshine xdelta
                Initramfs: '"-I /etc/crypttab /etc/modprobe.d/amdgpu.conf /etc/modprobe.d/deck-blacklist.conf"' 

● ostree-image-signed:docker://ghcr.io/ublue-os/bazzite-deck:stable
                   Digest: sha256:a0c8b3c6d8db35c53617209b90559099d7d11b91281171e7bae89ad9cc65ecdd
                  Version: 39.20240312.0 (2024-03-12T16:59:25Z)
               LiveCommit: f7e9582b012c08827fafae5e5083d146c8a3980314ce273cf362006daf31e534
                 LiveDiff: 1 added
          LayeredPackages: htop sunshine xdelta
                Initramfs: '"-I /etc/crypttab /etc/modprobe.d/amdgpu.conf /etc/modprobe.d/deck-blacklist.conf"' 
                 Unlocked: transient

  ostree-image-signed:docker://ghcr.io/ublue-os/bazzite-deck:stable
                   Digest: sha256:22d963175ca12c3f19e5b6997f2fb7a273dc3451076d3459f950e6e4b3d54561
                  Version: 39.20240302.0 (2024-03-03T02:14:15Z)
          LayeredPackages: discord htop sunshine xdelta
                Initramfs: '"-I /etc/crypttab /etc/modprobe.d/amdgpu.conf /etc/modprobe.d/deck-blacklist.conf"'

Hardware

Steam Deck.

Extra information or context

No response

KyleGospo commented 7 months ago

The virtualization script fails because Valve intentionally disables IOMMU on the Steam Deck, which is a big part of that script. If you just want to run a VM with no GPU passthrough you can do that the same way you would on SteamOS. I would recommend GNOME Boxes to keep things simple.

zqpvr commented 7 months ago

Is there anyway to install it manually? Also you could add a message to tell you to go in the uefi and enable IOMMU to continue.

KyleGospo commented 7 months ago

It's intentionally disabled by Valve, we're just following their example. You don't want IOMMU on.

GNOME Boxes is a flatpak, grab it from Flathub.

zqpvr commented 7 months ago

I am not using gnome boxes, I use virt-manager + gnome boxes can't do the things that I want to do in it.

HikariKnight commented 6 months ago

I am not using gnome boxes, I use virt-manager + gnome boxes can't do the things that I want to do in it.

ujust --show setup-virtualization | grep -A3 "rpm-ostree install -y virt" run those commands, it will grab the install commands for virt manager and the required kargs as a bare minimum, run those and you will have virt-manager, qemu and ovmf.

I can move the check to only be on IOMMU/VFIO in the future

kubepy commented 6 months ago

I was enable Virtualization on my 32G RAM steamdeck successully.

  1. Vol+ & PowerON goto bios for enable IOMMU

  2. Mount bind override the script

    
    cat <<'EOF' > /tmp/valve-hardware.overrides
    exit 1
    EOF

sudo mount -o bind /tmp/valve-hardware.overrides /usr/libexec/hardware/valve-hardware

3. Install virtualization

ujust setup-virtualization


5. Add kvm & libvirtd group to 1000 user for running not root

sudo vim /etc/libvirt/libvirtd.conf unix_sock_group = "libvirt"

sudo bash -c 'grep "kvm" /lib/group >> /etc/group' sudo bash -c 'grep "libvirt" /lib/group >> /etc/group' sudo usermod -a -G kvm $USER sudo usermod -a -G libvirt $USER


![Screenshot from 2024-03-19 00-53-20](https://github.com/ublue-os/bazzite/assets/43437760/990ffb04-64cc-4e9c-afa9-8f43497b9ccf)
HikariKnight commented 6 months ago

new build would let you install virt-manager, qemu and ovmf with the ujust command. however vfio will remain inaccessible through the ujust command since valve explicitly disables it.

zqpvr commented 6 months ago

what does vfio even do anyway

BryanJacobs commented 6 months ago

what does vfio even do anyway

vfio lets you create a VM running, say, Windows, and attach a device (say, your graphics card) to it using hardware virtualization.

You plug a monitor into the graphics card and you've got Windows there on it. Games run at ~1-2% overhead from native. The guest has direct access to the device without going through the host OS. USB devices plugged into the graphics card are "connected to" the guest, again without any real overhead.

This is a useful feature if you have something with Anticheat that doesn't work on Linux.