general/other Freebsd Podman opening a Wayland application in a Ubuntu container

I have installed the Freebsd podman-suite pkg and created a Ubuntu container

The XDG_RUNTIME_DIR is mounted from Freebsd to the Ubuntu container
so i can access the Wayland socket

Then i installed qt5ct on Ubuntu,
created a user and set up the shell and exported the xdg directories

qt5ct running in a Ubuntu podman container displayed using Wayland on the Freebsd host

podman.png



error message related to the gpu

Code:
libEGL warning: wayland-egl: could not open /dev/dri/renderD129 (No such file or directory)
MESA: error: ZINK: failed to choose pdev
libEGL warning: egl: failed to create dri2 screen

there is a podman option called

Code:
--gpus all

that should resolve the gpu issue

audio should be possible by mounting the pulseaudio socket from Freebsd to the container

which would mean we could run linux gui applications using a podman container

the advantage is that you can simply pull the container and run it
as opposed to setting up a jail and installing everything manually

the reason i decided to have a look at podman
is to see if i could get invidious working in a podman container on Freebsd

 
Code:
libEGL warning: wayland-egl: could not open /dev/dri/renderD129 (No such file or directory)
MESA: error: ZINK: failed to choose pdev
libEGL warning: egl: failed to create dri2 screen

I have already seen a similar error when I tried to use the Intel integrated GPU inside the Ubuntu container instead of the nvidia GPU...I never been able to fix it.
 
I know,but I'm trying to use my Intel GPU in Ubuntu installed inside the chroot + Linuxulator,not the nvidia GPU.
 
mounting the /dev directory works
but thats not a good idea and breaks stuff in the container

Code:
doas podman run --os=linux --net=host -v /dev:/dev -v /var/run/xdg/djwilcox:/var/run/user/1001 -it docker.io/library/ubuntu:latest /bin/bash

but trying to mount /dev/dri doesnt

Code:
doas podman run --os=linux --net=host -v /dev/dri:/dev/dri -v /var/run/xdg/djwilcox:/var/run/user/1001 -it docker.io/library/ubuntu:latest /bin/bash

tried device, but ran into the same issues as in this thread

 
by default the Ubuntu container doesnt have /dev/dri /dev/drm

thats why the mount fails with the following command

Code:
doas podman run --os=linux --net=host -v /dev/dri:/dev/drm -v /dev/dri:/dev/drm -v /var/run/xdg/djwilcox:/var/run/user/1001 -it docker.io/library/ubuntu:latest /bin/bash

so i need to create those directories before trying to mount dri and drm
 
Hey NapoleonWils0n ,

Nice setup you’ve got so far. Here’s what I think (and what I’d try) to help crack that GPU issue + sound forwarding.




What I’d Try / What to Send You Back

🎯 GPU / EGL Fix Suggestions

1. Bind host DRM devices into the container
The error:

libEGL warning: wayland-egl: could not open /dev/dri/renderD129
MESA: error: ZINK: failed to choose pdev
libEGL warning: egl: failed to create dri2 screen

means the container doesn’t see the proper /dev/dri/* device nodes. So you can’t get hardware acceleration.

So try a podman run invocation something like:

podman run \
--device /dev/dri/card0 \
--device /dev/dri/renderD128 \
-e XDG_RUNTIME_DIR=/run/user/1000 \
-v $XDG_RUNTIME_DIR:$XDG_RUNTIME_DIR \
ubuntu:latest

(Adjust card0 / renderD128 to whatever your FreeBSD host exposes.)


2. Check FreeBSD’s DRM / device support

Ensure that FreeBSD is exposing those DRM devices (i.e. the GPU is enabled, drivers loaded).

Confirm the host has /dev/dri or equivalent for your GPU, and that permissions allow the container to access them.

See whether FreeBSD’s GPU stack is compatible with Linux-style rendering expectations (Mesa, EGL) inside container.



3. --gpus all compatibility
On Linux hosts, --gpus all automates mounting device nodes and setting up the NVIDIA/AMD runtime. On FreeBSD, that flag might not do anything (or may not be implemented) because of the difference in GPU architecture and drivers.


4. Fallback / software rendering
If passthrough fails, you’ll be stuck with software rendering (llvmpipe). That’s slow for heavy GUI, but workable for lighter apps.






🔊 Audio Suggestions

Mount the host’s PulseAudio (or whichever audio socket) into the container.

Use environment variables like PULSE_SERVER=unix:/path/to/socket inside the container so GUI apps talk to the host’s audio.

Make sure permissions are correct again (container user can read/write the socket).





⚠️ Caveats & Limitations

Podman on FreeBSD is still experimental / under active development.

Device mapping (especially /dev) is less flexible on FreeBSD than Linux. There are prior discussions of mounting host devices into Podman containers on FreeBSD, and device handling is a tricky spot.

GPU passthrough in FreeBSD (even for VMs via bhyve) is itself a niche, sometimes spotty area.
 
Back
Top