Skip to content

Instantly share code, notes, and snippets.

@khvn26
Last active October 11, 2025 20:08
Show Gist options
  • Save khvn26/9de497852c9934ded840d53a95434942 to your computer and use it in GitHub Desktop.
Save khvn26/9de497852c9934ded840d53a95434942 to your computer and use it in GitHub Desktop.
SteamOS VSCode + Docker guide

SteamOS VSCode + Docker guide

  1. Install Docker:

    sudo pacman -S docker
  2. Enable Docker systemctl unit:

    sudo systemctl enable docker.service
    sudo systemctl enable containerd.service
  3. Allow X access to containers:

    xhost +si:localuser:$USER
  4. Install distrobox:

    curl -s https://raw.githubusercontent.com/89luca89/distrobox/main/install | sudo sh
  5. Create an ubuntu distrobox image with mounted docker.sock:

    distrobox create --name ubuntu-22-04 --image ubuntu:22.04 --volume /var/run/docker.sock:/var/run/docker.sock
  6. The following steps should be executed in the distrobox container. Enter the distrobox container shell:

    distrobox enter ubuntu-22-04
  7. Install Docker CLI and common plugins (Docker installation taken from official docs):

    sudo chmod 666 /var/run/docker.sock
    sudo apt-get update
    sudo apt-get install ca-certificates curl gnupg lsb-release
    sudo mkdir -m 0755 -p /etc/apt/keyrings
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
    echo \
      "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
      $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
    sudo apt-get update
    sudo apt-get install docker-ce-cli docker-buildx-plugin docker-compose-plugin
    sudo usermod -aG docker $USER
    docker info
  8. Install VSCode (download x64 .deb package here):

    sudo dpkg -i ~/Downloads/code_1.76.2-1678817801_amd64.deb
    sudo apt-get -f install
  9. Allow host xdg-open to process requests from inside the distrobox container:

    sudo ln -s /usr/bin/distrobox-host-exec /usr/local/bin/xdg-open
  10. Export VSCode shortcut:

    distrobox-export --app code

Everything else should work as usual.

@khvn26
Copy link
Author

khvn26 commented Mar 20, 2023

  1. Add the sudo chmod 666 /var/run/docker.sock fix
  2. Explore rootless docker/podman

@felleg
Copy link

felleg commented Aug 14, 2023

Fails on step 5:

$ distrobox create --name ubuntu-22-04 --image ubuntu:22.04 --volume /var/run/docker.sock:/var/run/docker.sock
Image ubuntu:22.04 not found.
Do you want to pull the image now? [Y/n]: 
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

@mateuscarvalhodev
Copy link

mateuscarvalhodev commented Jan 4, 2024

error: bridge-utils: signature from "GitLab CI Package Builder [email protected]" is unknown trust
:: File /var/cache/pacman/pkg/bridge-utils-1.7.1-1-x86_64.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).

i catch this error on my terminal when i try install docker on first step.

EDIT: i just change sigLevel in /etc/pacman.conf to TrustAll and them solved the issue! o//

@leagrr
Copy link

leagrr commented Jul 1, 2024

Fails on step 5:

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

Someone will roast me for this, but I ended up installing Homebrew to get Docker on here so I could bypass using sudo, using pacman, adding an Ubuntu distrobox, and/or constantly toggling steamos readonly filesystem on and off.

The Homebrew docker from what I understand is essentially the correct docker-ce edition that we want, but it doesn't have Docker Engine, which is where Colima comes in.

So I did

brew install colima docker
colima start

Although something hinky happened and I did a brew uninstall qemu colima and brew install qemu colima once again and it worked.

@jswhang86
Copy link

I am encountering an issue at step 7. For some reason Ubuntu does not have Apt-get or dkpg installed. Is there a solution for this?

📦[deck@ubuntu-22-04 ~]$ sudo chmod 666 /var/run/docker.sock
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg lsb-release
sudo mkdir -m 0755 -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce-cli docker-buildx-plugin docker-compose-plugin
sudo usermod -aG docker $USER
docker info
chmod: changing permissions of '/var/run/docker.sock': Operation not permitted
sudo: apt-get: command not found
sudo: apt-get: command not found
File '/etc/apt/keyrings/docker.gpg' exists. Overwrite? (y/N) y
bash: dpkg: command not found
bash: lsb_release: command not found
tee: /etc/apt/sources.list.d/docker.list: No such file or directory
sudo: apt-get: command not found
sudo: apt-get: command not found
usermod: group 'docker' does not exist
bash: docker: command not found

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