Community Guide: Setting up devpod with podman

Hoping these posts serve as a useful spot for newcomers and the community to help fill up to support the devs and an easy spot to curate and merge into the documentation.

Bluefin defaults to podman which is an excellent sensible default - podman - (rootless, best practice). However, little documentation or sharing of how to get started. I don’t know how to setup devpod to make use of podman. Help around that would be appreciated.

  1. Under settings, add CLI to path button doesn’t work. Steps to perform this ?
  2. Under providers, what to pick and fill in to make use of podman

There doesn’t appear to be a podman provider, just a docker one:

At the bottom of that page it appears it looks like adding providers to it should be straightforward. I suspect figuring out how to lie to devpod to make it think it’s talking to docker might also work?

Devpod works with docker seamlessly.

Step 1:
just docker

Step 2:
Connect devpod to docker

I was just curious if people were using it with podman.

One issue I’m having on bluefin however is that the ‘add to CLI’ button in devpod doesn’t work.

I’ve been using this machine for mainly data science , but since we are on break I’ve been working on trying to make it my daily driver as a simple non-developer user and just learn. I would attach a screenshot , but that’s another aspect I’m researching right now. When I install flameshot via flathub and try and take a screenshot , I just get an error saying unable to capture screen. Will have this resolve hopefully today and post instructions.

2 Likes

So I somewhat figured this out .

under Docker Host put: unix:///var/run/user/1000/podman/podman.sock
under Docker path put: podman

1 Like

Great thread @zartarr88
yes! same problem with flameshot! did you solve it?

Is this a viable solution? what do you mean by somewhat? :slightly_smiling_face:

It was working a couple months ago , after a couple updates it stopped but they introduced a ujust docker command . and I’ve just defaulted to docker for devpod.

1 Like

Hi there, are you still having issues with Flatpak Flameshot? If yes this might help:

  1. Install Flameshot from Flathub
  2. Give Flameshot screenshot permissions: flatpak permission-set screenshot screenshot org.flameshot.Flameshot yes
  3. Bind shortcut via Settings: flatpak run --command=flameshot -u org.flameshot.Flameshot gui
1 Like

hi @mel226, thanks for checking in!

After having installed flameshot from flathub and run the first line: flatpak permission-set screenshot screenshot org.flameshot.Flameshot yes

when I run the second line flatpak run --command=flameshot -u org.flameshot.Flameshot gui

I’m getting this error:
error: app/org.flameshot.Flameshot/x86_64/stable not installed

Try removing -u in the command - my Flameshot install is on user level and not like Bluefin’s default system level Flatpak, completely forgot about that! If after this Flameshot runs, you can bind the command via Gnome Settings to a certain key combo, e.g. Super+Shift+S

ok great,
what should I have for the command?

flatpak run --command=flameshot org.flameshot.Flameshot gui

Thanks a lot @mel226 ! It’s working perfectly now, pretty sweet!
I love Flameshot
have a good one

I know this is old but I am working on a GitHub - babeloff/devpod-provider-podman: A Podman provider for devpod
Currently, it can be used as follows:

devpod provider add https://raw.githubusercontent.com/babeloff/devpod-provider-podman/main/provider.yml

Eventually, it should work as follows:

devpod provider add babeloff/devpod-provider-podman
6 Likes

Oh wow this is way cool!

This is cool, starring :rocket:

Hello @phreed

I added your provider successfully, then tried to create a workspace with it and this folder:

> cat $HOME/devpod/test-ws/.devcontainer.json
{"image":"registry.fedoraproject.org/fedora-toolbox:40"}

Unfortunately it gives me an error after creating the container (I see container up in the logs) when building the workspace. The logs end with:

...
{"type":"data","data":{"time":"2024-09-23T23:05:37.821535361+01:00","message":"devcontainer up","level":"info"}}
{"type":"data","data":{"time":"2024-09-23T23:05:37.821538067+01:00","message":"github.com/loft-sh/devpod/cmd/agent/workspace.(*UpCmd).Run","level":"info"}}
{"type":"data","data":{"time":"2024-09-23T23:05:37.821541973+01:00","message":"/home/runner/work/devpod/devpod/cmd/agent/workspace/up.go:95","level":"info"}}
{"type":"data","data":{"time":"2024-09-23T23:05:37.821545524+01:00","message":"github.com/loft-sh/devpod/cmd/agent/workspace.NewUpCmd.func1","level":"info"}}
{"type":"data","data":{"time":"2024-09-23T23:05:37.821549024+01:00","message":"/home/runner/work/devpod/devpod/cmd/agent/workspace/up.go:51","level":"info"}}
{"type":"data","data":{"time":"2024-09-23T23:05:37.82155219+01:00","message":"github.com/spf13/cobra.(*Command).execute","level":"info"}}
{"type":"data","data":{"time":"2024-09-23T23:05:37.821555702+01:00","message":"/home/runner/work/devpod/devpod/vendor/github.com/spf13/cobra/command.go:983","level":"info"}}
{"type":"data","data":{"time":"2024-09-23T23:05:37.82155929+01:00","message":"github.com/spf13/cobra.(*Command).ExecuteC","level":"info"}}
{"type":"data","data":{"time":"2024-09-23T23:05:37.821563225+01:00","message":"/home/runner/work/devpod/devpod/vendor/github.com/spf13/cobra/command.go:1115","level":"info"}}
{"type":"data","data":{"time":"2024-09-23T23:05:37.821566756+01:00","message":"github.com/spf13/cobra.(*Command).Execute","level":"info"}}
{"type":"data","data":{"time":"2024-09-23T23:05:37.821569588+01:00","message":"/home/runner/work/devpod/devpod/vendor/github.com/spf13/cobra/command.go:1039","level":"info"}}
{"type":"data","data":{"time":"2024-09-23T23:05:37.821573062+01:00","message":"github.com/loft-sh/devpod/cmd.Execute","level":"info"}}
{"type":"data","data":{"time":"2024-09-23T23:05:37.821575855+01:00","message":"/home/runner/work/devpod/devpod/cmd/root.go:90","level":"info"}}
{"type":"data","data":{"time":"2024-09-23T23:05:37.821578779+01:00","message":"main.main","level":"info"}}
{"type":"data","data":{"time":"2024-09-23T23:05:37.821581186+01:00","message":"/home/runner/work/devpod/devpod/main.go:6","level":"info"}}
{"type":"data","data":{"time":"2024-09-23T23:05:37.821584048+01:00","message":"runtime.main","level":"info"}}
{"type":"data","data":{"time":"2024-09-23T23:05:37.821586339+01:00","message":"/home/runner/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.5.linux-amd64/src/runtime/proc.go:271","level":"info"}}
{"type":"data","data":{"time":"2024-09-23T23:05:37.82159024+01:00","message":"runtime.goexit","level":"info"}}
{"type":"data","data":{"time":"2024-09-23T23:05:37.821592597+01:00","message":"/home/runner/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.5.linux-amd64/src/runtime/asm_amd64.s:1695","level":"info"}}
{"type":"data","data":{"time":"2024-09-23T23:05:37.82524296+01:00","message":"Connection to SSH Server closed","level":"debug"}}
{"type":"data","data":{"time":"2024-09-23T23:05:37.82527146+01:00","message":"Done creating devcontainer","level":"debug"}}
{"type":"data","data":{"time":"2024-09-23T23:05:37.8287052+01:00","message":"Done executing ssh server helper command","level":"debug"}}
{"type":"error","error":{"time":"2024-09-23T23:05:37.945389294+01:00","message":"Process exited with status 1\nrun agent command\ngithub.com/loft-sh/devpod/pkg/devcontainer/sshtunnel.ExecuteCommand.func2\n\t/home/runner/work/devpod/devpod/pkg/devcontainer/sshtunnel/sshtunnel.go:129\nruntime.goexit\n\t/home/runner/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.5.linux-amd64/src/runtime/asm_amd64.s:1695","level":"fatal"}}

Interestingly, the container is up and running, but I cannot enter it:

> toolbox list -c
CONTAINER ID  CONTAINER NAME    CREATED        STATUS   IMAGE NAME
751041fd7fbf  wonderful_merkle  5 minutes ago  running  registry.fedoraproject.org/fedora-toolbox:40

> toolbox enter wonderful_merkle
Error: container wonderful_merkle is too old and no longer supported 
Recreate it with Toolbox version 0.0.17 or newer.

How is this possible?

Not sure, I will give it a look.

1 Like

I made a bunch of updates.
Could you give it another try?
devpod provider add babeloff/devpod-provider-podman --debug

Hello, I was trying this last night and figured it out. I had the wrong impression that dev containers work with any image, but it seems that they require specific images that have some “dev container support” pre-installed.

Above, I used a toolbox image from fedora registry and it seems that the “error” occurs because devpod tries to talk to “devcontainer services” when the container is brought up and fails (because they are missing).

I think you simply need a “compatible image” and indeed this spec works:

>  cat .devcontainer.json 
{"image":"mcr.microsoft.com/devcontainers/python:dev-3.12"}

Having said that, I have installed your new provider with:

> devpod-cli provider add babeloff/devpod-provider-podman --debug

Repeating the above has same results (fails with Fedora image, works with Microsoft image) which I now believe is expected.

So likely this was simply my mistake.

Does anyone know what you need to install in an image to make it “dev container compatible”?

2 Likes