View on GitHub


Use any linux distribution inside your terminal

Download this project as a .zip file Download this project as a tar.gz file

Integrate VSCode and Distrobox

VScode doesn’t need presentations, and it’s a powerful tool for development. You may want to use it, but how to handle the dualism between host and container?

In this experiment we will use VSCodium as an opensource alternative to VSCode.

Here are a couple of solutions.

The easy one

Well, you could just install VSCode in your Distrobox of choice, and export it!

For example using an Arch Linux container:

~$ distrobox create --image archlinux:latest --name arch-distrobox
~$ distrobox enter --name arch-distrobox

Download the deb file HERE, or in Arch case just install

user@arch-distrobox:~$ sudo pacman -S code

Now that we have installed it, we can export it:

user@ubuntu-distrobox:~$ distrobox-export --app code

And that’s really it, you’ll have VSCode in your app list, and it will run from the Distrobox itself, so it will have access to all the software and tools inside it without problems.

image image

The not so easy one

Alternatively you may want to install VSCode on your host. We will explore how to integrate VSCode installed via Flatpak with Distrobox.

Note that this integration process is inspired by the awesome project toolbox-vscode so many thanks to @owtaylor for the heavy lifting!

First step install it

~$ flatpak install --user app/com.visualstudio.code

Second step, extensions

Now we want to install VSCode Remote Container extension


Third step podman wrapper

Being in a Flatpak, we will need access to host’s podman (or docker) to be able to use the containers. Place this in your ~/.local/bin/podman-host

set -x
if [ "$1" == "exec" ]; then
 # Remove 'exec' from $@
     result_command="podman exec"
        for i in $(printenv | grep "=" | grep -Ev " |\"" |
            grep -Ev "^(HOST|HOSTNAME|HOME|PATH|SHELL|USER|_)"); do

            result_command=$result_command --env="$i"

        exec ${result_command} "$@"
 exec flatpak-spawn --host sh -c "$script" - "$@"
 exec flatpak-spawn --host podman "$@"

and make it executable: chmod +x ~/.local/bin/podman-host.

Open VSCode settings (Ctrl+,) and head to Remote>Containers>Docker Path and set it to the path of podman-exec, like in the example


This will give a way to execute host’s container manager from within the flatpak app.

Fourth step configure the container

We need not to deploy a configuration for our container. We should create one for each Distrobox we choose to integrate with VSCode:

  "remoteUser": "${localEnv:USER}",
  "settings": {
    "remote.containers.copyGitConfig": false,
    "remote.containers.gitCredentialHelperConfigLocation": "none",
    "terminal.integrated.profiles.linux": {
      "shell": {
        "path": "${localEnv:SHELL}",
        "args": [
    "terminal.integrated.defaultProfile.linux": "shell"
  "remoteEnv": {
    "COLORTERM": "${localEnv:COLORTERM}",
    "DISPLAY": "${localEnv:DISPLAY}",
    "LANG": "${localEnv:LANG}",
    "SHELL": "${localEnv:SHELL}",
    "SSH_AUTH_SOCK": "${localEnv:SSH_AUTH_SOCK}",
    "TERM": "${localEnv:TERM}",
    "VTE_VERSION": "${localEnv:VTE_VERSION}",
    "XDG_DATA_DIRS": "${localEnv:XDG_DATA_DIRS}",

And place it under ${HOME}/.var/app/com.visualstudio.code/config/Code/User/globalStorage/ms-vscode-remote.remote-containers/nameConfigs/your-distrobox-name.json

Final Result

After that, we’re good to go! Open VSCode and Attach to Remote Container:


And let’s choose our Distrobox


And we’re good to go! We have our VSCode remote session inside our Distrobox container!