Trying to get vscode to attach to running container made with boxbuddy/distrobox -- docker doesn't see my containers at all

Hi,

Having problems with vscode connecting to container with new new install, here is what I did:

Fresh install of bluefin-dx:gts 39

Ran a few of the ujust commands… setup shell with zsh, installed brew and atuin, ran ujust dx-group

I created a new container with BoxBuddy/Distobox,

Open vscode and try Attach to running container... and I get an error message saying “There are no running containers to attach to.”

Check distrobox, podman, and docker:

❯ distrobox list
ID           | NAME                 | STATUS             | IMAGE                         
4cd3550bdc77 | testcontainer1        | Up 12 minutes      | quay.io/toolbx/ubuntu-toolbox:latest

❯ podman ps -a
CONTAINER ID  IMAGE                                 COMMAND               CREATED            STATUS         PORTS       NAMES
4cd3550bdc77  quay.io/toolbx/ubuntu-toolbox:latest  --verbose --name ...  About an hour ago  Up 12 minutes              testcontainer1

❯ docker ps -a
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES

Docker should pick up my distrobox containers right? Did I miss something? I was pretty sure this was going to work just out of the box basically.

I havn’t run ujust bluefin-cli… am I supposed to? A little bit unsure what bluefin-cli is for and when I should be using that vs host shell

Any help appreciated, thanks

You don’t need bluefin-cli, it’s not for development in your IDE it’s for terminal tool, etc.

By default your distrobox containers are running under your user podman.

Docker runs at a system level and is a completely different engine from podman. A distrobox created by docker is running as root unlike the podman version which runs as your user.

By default we have vscode setup to work with devcontainers using the default backend of docker. This would behave exactly the same as if you were on a Mac or Windows. If you wish to have your distrobox containers work with vscode instead, there is a script called podman-host that you can set your docker path to for your devcontainers extension.

Distroboxes are for pet containers not development. If you click on this thing at the bottom of vscode:

image

and then select “New devcontainer”, then type “ubuntu” in the search box:

Hit enter (and I think there’s a confirmation enter in there too) will get you an ubuntu container.

2 Likes