How to run a containerized GUI application

There is an “official” way to run a program that need the desktop environment, using podman on Silverblue?
I’ve seen some examples using docker, but they talk about X11 and not Wayland.

1 Like

Just as a reference, in this way I was able to start xclock (X11, not wayland).

vi Doeckerfile
FROM fedora:latest
RUN  dnf -y update
RUN  dnf -y install xorg-x11-apps
podman build --tag fedora:Base -f ./Doeckerfile

Then, running the container, I don’t know if the SELinux part is ok.

podman run -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix:rw --security-opt label=type:container_runtime_t --user=$(id -u):$(id -g) -rm -ti fedora:Base /usr/bin/xclock

Check this out:

These are optimized for Ubuntu, but most of them will wil on fedora. Have fun!

1 Like

Just use Flatpak?

1 Like

If you want a development environment that replicates an RPM based OS, then try fedora-toolbox that uses OCI containers, podman and buildah underneath. You can run GUI programs from within it.

Oh. I mean non flatpaked applications, of course. :slightly_smiling_face:

This is experimental version GitHub - DimaZirix/podbox: Container sandbox for GUI applications , but works.


podbox create gimp --gui --net --ipc --audio
podbox exec gimp --root dnf install gimp -y
# podbox volume add gimp /home/user/Pictures --to /home/user/Pictures
podbox desktop create gimp gimp 'Gimp Inside Podman' --icon gimp
1 Like