Seiten

Sonntag, 14. Dezember 2025

Steam Deck - Mit Hilfe von Distrobox Linux-Distribution (Ubuntu) in einem Container starten

SteamOS setzt als Immutable System auf ein schreibgeschütztes Root-Dateisystem, weshalb Discover nur Flatpak-Pakete anbietet, klassische Kommandozeilenprogramme sucht man hier vergeblich. Zwar sind Basistools vorinstalliert, doch zusätzliche Software lässt sich nicht einfach über pacman nachinstallieren. Wer weitere Tools benötigt, kann auf das vorinstallierte Distrobox zurückgreifen.


Bei Distrobox handelt es sich um einen Wrapper für Podman oder Docker, welche durch im Hintergrund genutzt werden. Mit wenig Aufwand lassen sich so Images von verschiedenen Linux Distribution (z. B. Ubuntu oder Debian) nutzen, über die sich wiederum weitere Anwendungen installieren lassen.

Hintergrund: Distrobox startet andere Linux-Distributionen in Containern, so kann man deren Paketverwaltung nutzen und sogar auf schreibgeschützten Systemen "sudo" Befehle ausführen. Die Container sind nahtlos ins Host-System integriert. Sie greifen auf das Home-Verzeichnis, Netzwerk und USB-Geräte zu, nutzen aber den Kernel des Hosts, somit handelt es sich nicht um virtuelle Maschinen!

Um z.B. Ubuntu zu installieren ist jetzt eigentlich nur noch der folgende Befehl notwendig: 
distrobox-create -n ubuntu -i docker.io/library/ubuntu:24.04

Es empfiehlt sich aber die folgenden Anleitung "Install Distrobox and Podman PERMANENT on Steam Deck >= 3.5" durchzuführen.

nano ~/.bashrc Add the following line if it’s not already there:
export PATH=/home/deck/.local/bin:$PATH

Install and configure Distrobox To install Distrobox in the defined $PATH, use one of the following commands depending on whether you need the latest version (--next) or not:
curl -s https://raw.githubusercontent.com/89luca89/distrobox/main/install | sh -s -- --prefix $HOME/.local

After installing, create the file ~/.distroboxrc if it doesn't already exist. Open it with:
nano ~/.distroboxrc

Add the following lines to configure Distrobox:
# Ensure the graphical apps can talk to the Xwayland session
xhost +si:localuser:$USER >/dev/null
# Force the use of pulseaudio inside the container
export PIPEWIRE_RUNTIME_DIR=/dev/null
# Needed to ensure distrobox can find the podman binary we previously downloaded
export PATH=/home/deck/.local/bin:$PATH
export PATH=$PATH:/home/deck/.local/bin

Install and configure Podman To install Podman, download the latest version from the GitHub releases page:
curl -L -o /home/deck/Downloads/podman-launcher-amd64 https://github.com/89luca89/podman-launcher/releases/download/v0.0.5/podman-launcher-amd64

Next, move and rename the Podman binary with ROOT permissions to the $PATH:
mv /home/deck/Downloads/podman-launcher-amd64 /home/deck/.local/bin/podman

Then, make Podman executable:
chmod +x /home/deck/.local/bin/podman

Configure the deck user’s UID and GID mapping with the following commands:
sudo touch /etc/subuid /etc/subgid
sudo usermod --add-subuid 100000-165535 --add-subgid 100000-165535 deck 

Configure Distrobox Icon folder - (if you install distrobox with sudo) To ensure Distrobox can store its icons correctly, set the proper permissions on the /home/deck/.local/share/icons folder with:
chown deck:deck /home/deck/.local/share/icons

Verify installations After the installation steps, verify that both Distrobox and Podman are properly installed and configured. Use the following commands:
which distrobox which podman distrobox --version podman --version podman info

To create and test a ROOTLESS container, run:
distrobox create --image docker.io/library/ubuntu:24.04 --name ubuntu

For a ROOT container, use:
distrobox create --image docker.io/library/ubuntu:24.04 --name rubuntu --root


Jetzt lässt such Ubuntu mit dem folgenden Befehl starten: 
distrobox enter ubuntu

Jetzt lässt sich z.B. neofetch installieren:
sudo apt install neofetch 

Container starten / stoppen:
distrobox enter ubuntu
distrobox stop ubuntu


Einen Container löschen:
distrobox rm 

Welche Images zur Verfügung stehen:
distrobox create -C 

Liste der Container:
distrobox list

Container klonen:
distrobox create --clone ubuntu -n ubuntu-klon

Portweiterleitung einrichten:
distrobox create --unshare-netns -a "-p 8080:8000" -i ubuntu -n ubuntu-nonet
Mit "-p 8080:8000" landen alle Anfragen, die an Port 8080 des Host-Systems ankommen, direkt im Container an Port 8000.

Pakete bei distrobox create mithilfe von --additional-packages (-ap) direkt in den Container integrieren (z.B. neofetch und iproute2):
distrobox create -i debian:latest -n debian -ap "neofetch iproute2"

Container beim Erzeugen mit der Option --home einen beliebigen anderen Ordner als Heimatverzeichnis verwenden lassen:
distrobox create -i debian:latest -n debian --home ~/temp/debianhome

Anwendungen in das Startmenü des Host-Systems einbinden, mit --extra-flags kann Parameter hinzufügen:
distrobox-export
distrobox-export --app chromium



Keine Kommentare:

Kommentar veröffentlichen