gtk initialization failed #303

Open
opened 2025-12-29 00:23:41 +01:00 by adam · 14 comments
Owner

Originally created by @DrNulll on GitHub (Jan 12, 2022).

Linux fedora 5.15.12-200.fc35.x86_64 #1 SMP Wed Dec 29 15:03:38 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
:0
1
NAME="Fedora Linux"
VERSION_CODENAME=""
PRETTY_NAME="Fedora Linux 35 (Workstation Edition)"
CPE_NAME="cpe:/o:fedoraproject:fedora:35"
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 930G 118G 813G 13% /home
QEMU emulator version 6.1.0 (qemu-6.1.0-10.fc35)
Copyright (c) 2003-2021 Fabrice Bellard and the QEMU Project developers
libvirtd (libvirt) 7.6.0
total used free shared buff/cache available
Mem: 7.7Gi 1.7Gi 3.0Gi 318Mi 3.0Gi 5.4Gi
Swap: 7.7Gi 0B 7.7Gi
4
8
crw-rw-rw-. 1 root kvm 10, 232 Jan 11 19:12 /dev/kvm
total 0
drwxrwxrwt. 2 root root 120 Jan 11 19:08 .
drwxrwxrwt. 23 root root 540 Jan 11 19:16 ..
srwxr-xr-x. 1 anon anon 0 Jan 11 19:08 X0
srwxr-xr-x. 1 anon anon 0 Jan 11 19:08 X1
srwxr-xr-x. 1 gdm gdm 0 Jan 11 19:08 X1024
srwxr-xr-x. 1 gdm gdm 0 Jan 11 19:08 X1025
root 1042 2.5 1.0 3097260 86964 ? Ssl 19:07 0:13 /usr/bin/dockerd --host=fd:// --exec-opt native.cgroupdriver=systemd --selinux-enabled --log-driver=journald --live-restore --default-ulimit nofile=1024:1024 --init-path /usr/libexec/docker/docker-init --userland-proxy-path /usr/libexec/docker/docker-proxy
anon 4081 0.0 0.0 221792 2184 pts/0 S+ 19:16 0:00 grep --color=auto dockerd
kvm:x:36:qemu,anon
libvirt:x:985:anon
docker:x:977:anon

Originally created by @DrNulll on GitHub (Jan 12, 2022). Linux fedora 5.15.12-200.fc35.x86_64 #1 SMP Wed Dec 29 15:03:38 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux :0 1 NAME="Fedora Linux" VERSION_CODENAME="" PRETTY_NAME="Fedora Linux 35 (Workstation Edition)" CPE_NAME="cpe:/o:fedoraproject:fedora:35" Filesystem Size Used Avail Use% Mounted on /dev/sda3 930G 118G 813G 13% /home QEMU emulator version 6.1.0 (qemu-6.1.0-10.fc35) Copyright (c) 2003-2021 Fabrice Bellard and the QEMU Project developers libvirtd (libvirt) 7.6.0 total used free shared buff/cache available Mem: 7.7Gi 1.7Gi 3.0Gi 318Mi 3.0Gi 5.4Gi Swap: 7.7Gi 0B 7.7Gi 4 8 crw-rw-rw-. 1 root kvm 10, 232 Jan 11 19:12 /dev/kvm total 0 drwxrwxrwt. 2 root root 120 Jan 11 19:08 . drwxrwxrwt. 23 root root 540 Jan 11 19:16 .. srwxr-xr-x. 1 anon anon 0 Jan 11 19:08 X0 srwxr-xr-x. 1 anon anon 0 Jan 11 19:08 X1 srwxr-xr-x. 1 gdm gdm 0 Jan 11 19:08 X1024 srwxr-xr-x. 1 gdm gdm 0 Jan 11 19:08 X1025 root 1042 2.5 1.0 3097260 86964 ? Ssl 19:07 0:13 /usr/bin/dockerd --host=fd:// --exec-opt native.cgroupdriver=systemd --selinux-enabled --log-driver=journald --live-restore --default-ulimit nofile=1024:1024 --init-path /usr/libexec/docker/docker-init --userland-proxy-path /usr/libexec/docker/docker-proxy anon 4081 0.0 0.0 221792 2184 pts/0 S+ 19:16 0:00 grep --color=auto dockerd kvm:x:36:qemu,anon libvirt:x:985:anon docker:x:977:anon
Author
Owner

@DrNulll commented on GitHub (Jan 12, 2022):

docker run --device /dev/kvm
--privileged
-p 50922:10022
-e XDG_RUNTIME_DIR=/tmp
-e WAYLAND_DISPLAY=$WAYLAND_DISPLAY
-e QT_QPA_PLATFORM=wayland
-e GDK_BACKEND=wayland
-e CLUTTER_BACKEND=wayland
-e DISPLAY=:0
-v $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/tmp/$WAYLAND_DISPLAY
sickcodes/docker-osx:big-sur

seems to work

@DrNulll commented on GitHub (Jan 12, 2022): > docker run --device /dev/kvm \ > --privileged \ > -p 50922:10022 \ > -e XDG_RUNTIME_DIR=/tmp \ > -e WAYLAND_DISPLAY=$WAYLAND_DISPLAY \ > -e QT_QPA_PLATFORM=wayland \ > -e GDK_BACKEND=wayland \ > -e CLUTTER_BACKEND=wayland \ > -e DISPLAY=:0 \ > -v $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/tmp/$WAYLAND_DISPLAY \ > sickcodes/docker-osx:big-sur seems to work
Author
Owner

@Ace-Krypton commented on GitHub (Jan 15, 2022):

use xhost +

@Ace-Krypton commented on GitHub (Jan 15, 2022): use xhost +
Author
Owner

@sickcodes commented on GitHub (Jan 15, 2022):

-v $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/tmp/$WAYLAND_DISPLAY

Shall we include this for Wayland instructions in the README?

@sickcodes commented on GitHub (Jan 15, 2022): > -v $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/tmp/$WAYLAND_DISPLAY Shall we include this for Wayland instructions in the README?
Author
Owner

@DrNulll commented on GitHub (Jan 15, 2022):

use xhost +

Doesn't do anything. I have it working with this disabled.

-v $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/tmp/$WAYLAND_DISPLAY

Shall we include this for Wayland instructions in the README?

--privileged is what fixed the issue. But prolly should.

@DrNulll commented on GitHub (Jan 15, 2022): > use xhost + Doesn't do anything. I have it working with this disabled. > > -v $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/tmp/$WAYLAND_DISPLAY > > Shall we include this for Wayland instructions in the README? --privileged is what fixed the issue. But prolly should.
Author
Owner

@ash-hashtag commented on GitHub (Nov 5, 2022):

I have the same problem, I'm on Endeavour OS kde plasma

@ash-hashtag commented on GitHub (Nov 5, 2022): I have the same problem, I'm on Endeavour OS kde plasma
Author
Owner

@satmandu commented on GitHub (Apr 26, 2023):

This is what worked for me for high sierra in Ubuntu 23.04, using gdm/wayland:

#!/bin/bash
docker run \
    --privileged -i \
    --device /dev/kvm \
    -p 50922:10022 \
    -e XDG_RUNTIME_DIR=/tmp \
    -e WAYLAND_DISPLAY=$WAYLAND_DISPLAY \
    -e QT_QPA_PLATFORM=wayland \
    -e GDK_BACKEND=wayland \
    -e CLUTTER_BACKEND=wayland \
    -v $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/tmp/$WAYLAND_DISPLAY \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    -e "DISPLAY=${DISPLAY:-:0.0}" \
    -e AUDIO_DRIVER=pa,server=unix:/tmp/pulseaudio.socket \
    -v "/run/user/$(id -u)/pulse/native:/tmp/pulseaudio.socket" \
    sickcodes/docker-osx:high-sierra
@satmandu commented on GitHub (Apr 26, 2023): This is what worked for me for high sierra in Ubuntu 23.04, using gdm/wayland: ``` #!/bin/bash docker run \ --privileged -i \ --device /dev/kvm \ -p 50922:10022 \ -e XDG_RUNTIME_DIR=/tmp \ -e WAYLAND_DISPLAY=$WAYLAND_DISPLAY \ -e QT_QPA_PLATFORM=wayland \ -e GDK_BACKEND=wayland \ -e CLUTTER_BACKEND=wayland \ -v $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/tmp/$WAYLAND_DISPLAY \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -e "DISPLAY=${DISPLAY:-:0.0}" \ -e AUDIO_DRIVER=pa,server=unix:/tmp/pulseaudio.socket \ -v "/run/user/$(id -u)/pulse/native:/tmp/pulseaudio.socket" \ sickcodes/docker-osx:high-sierra ```
Author
Owner

@b3b0p831 commented on GitHub (Oct 29, 2023):

docker run --device /dev/kvm
--privileged
-p 50922:10022
-e XDG_RUNTIME_DIR=/tmp
-e WAYLAND_DISPLAY=$WAYLAND_DISPLAY
-e QT_QPA_PLATFORM=wayland
-e GDK_BACKEND=wayland
-e CLUTTER_BACKEND=wayland
-e DISPLAY=:0
-v $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/tmp/$WAYLAND_DISPLAY
sickcodes/docker-osx:big-sur

seems to work

Works on Fedora 38.

@b3b0p831 commented on GitHub (Oct 29, 2023): > > docker run --device /dev/kvm > > --privileged > > -p 50922:10022 > > -e XDG_RUNTIME_DIR=/tmp > > -e WAYLAND_DISPLAY=$WAYLAND_DISPLAY > > -e QT_QPA_PLATFORM=wayland > > -e GDK_BACKEND=wayland > > -e CLUTTER_BACKEND=wayland > > -e DISPLAY=:0 > > -v $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/tmp/$WAYLAND_DISPLAY > > sickcodes/docker-osx:big-sur > > seems to work Works on Fedora 38.
Author
Owner

@Cryolitia commented on GitHub (Apr 30, 2024):

-e "DISPLAY=${DISPLAY:-:0.0}" \

This is what worked for me for high sierra in Ubuntu 23.04, using gdm/wayland:

#!/bin/bash
docker run \
    --privileged -i \
    --device /dev/kvm \
    -p 50922:10022 \
    -e XDG_RUNTIME_DIR=/tmp \
    -e WAYLAND_DISPLAY=$WAYLAND_DISPLAY \
    -e QT_QPA_PLATFORM=wayland \
    -e GDK_BACKEND=wayland \
    -e CLUTTER_BACKEND=wayland \
    -v $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/tmp/$WAYLAND_DISPLAY \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    -e "DISPLAY=${DISPLAY:-:0.0}" \
    -e AUDIO_DRIVER=pa,server=unix:/tmp/pulseaudio.socket \
    -v "/run/user/$(id -u)/pulse/native:/tmp/pulseaudio.socket" \
    sickcodes/docker-osx:high-sierra

works for me NixOS

@Cryolitia commented on GitHub (Apr 30, 2024): > -e "DISPLAY=${DISPLAY:-:0.0}" \ > This is what worked for me for high sierra in Ubuntu 23.04, using gdm/wayland: > > ``` > #!/bin/bash > docker run \ > --privileged -i \ > --device /dev/kvm \ > -p 50922:10022 \ > -e XDG_RUNTIME_DIR=/tmp \ > -e WAYLAND_DISPLAY=$WAYLAND_DISPLAY \ > -e QT_QPA_PLATFORM=wayland \ > -e GDK_BACKEND=wayland \ > -e CLUTTER_BACKEND=wayland \ > -v $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/tmp/$WAYLAND_DISPLAY \ > -v /tmp/.X11-unix:/tmp/.X11-unix \ > -e "DISPLAY=${DISPLAY:-:0.0}" \ > -e AUDIO_DRIVER=pa,server=unix:/tmp/pulseaudio.socket \ > -v "/run/user/$(id -u)/pulse/native:/tmp/pulseaudio.socket" \ > sickcodes/docker-osx:high-sierra > ``` works for me NixOS
Author
Owner

@ErickRodrCodes commented on GitHub (Jun 21, 2024):

This is what worked for me for high sierra in Ubuntu 23.04, using gdm/wayland:

#!/bin/bash
docker run \
    --privileged -i \
    --device /dev/kvm \
    -p 50922:10022 \
    -e XDG_RUNTIME_DIR=/tmp \
    -e WAYLAND_DISPLAY=$WAYLAND_DISPLAY \
    -e QT_QPA_PLATFORM=wayland \
    -e GDK_BACKEND=wayland \
    -e CLUTTER_BACKEND=wayland \
    -v $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/tmp/$WAYLAND_DISPLAY \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    -e "DISPLAY=${DISPLAY:-:0.0}" \
    -e AUDIO_DRIVER=pa,server=unix:/tmp/pulseaudio.socket \.
    -v "/run/user/$(id -u)/pulse/native:/tmp/pulseaudio.socket" \
    sickcodes/docker-osx:high-sierra

works for me on Ubuntu 22.04. tired with the issue of gtk

@ErickRodrCodes commented on GitHub (Jun 21, 2024): > This is what worked for me for high sierra in Ubuntu 23.04, using gdm/wayland: > > ``` > #!/bin/bash > docker run \ > --privileged -i \ > --device /dev/kvm \ > -p 50922:10022 \ > -e XDG_RUNTIME_DIR=/tmp \ > -e WAYLAND_DISPLAY=$WAYLAND_DISPLAY \ > -e QT_QPA_PLATFORM=wayland \ > -e GDK_BACKEND=wayland \ > -e CLUTTER_BACKEND=wayland \ > -v $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/tmp/$WAYLAND_DISPLAY \ > -v /tmp/.X11-unix:/tmp/.X11-unix \ > -e "DISPLAY=${DISPLAY:-:0.0}" \ > -e AUDIO_DRIVER=pa,server=unix:/tmp/pulseaudio.socket \. > -v "/run/user/$(id -u)/pulse/native:/tmp/pulseaudio.socket" \ > sickcodes/docker-osx:high-sierra > ``` works for me on Ubuntu 22.04. tired with the issue of gtk
Author
Owner

@roowus commented on GitHub (Aug 11, 2024):

This is for people who want sonoma on wayland.

docker run -it \
    --privileged -i \
    --device /dev/kvm \
    -p 50922:10022 \
    -e XDG_RUNTIME_DIR=/tmp \
    -e WAYLAND_DISPLAY=$WAYLAND_DISPLAY \
    -e QT_QPA_PLATFORM=wayland \
    -e GDK_BACKEND=wayland \
    -e CLUTTER_BACKEND=wayland \
    -v $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/tmp/$WAYLAND_DISPLAY \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    -e "DISPLAY=${DISPLAY:-:0.0}" \
    -e AUDIO_DRIVER=pa,server=unix:/tmp/pulseaudio.socket \
    -v "/run/user/$(id -u)/pulse/native:/tmp/pulseaudio.socket" \
    -e GENERATE_UNIQUE=true \
    -e CPU='Haswell-noTSX' \
    -e CPUID_FLAGS='kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on' \
    -e MASTER_PLIST_URL='https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom-sonoma.plist' \
    sickcodes/docker-osx:sonoma

# docker build -t docker-osx --build-arg SHORTNAME=sonoma .

This is what worked for me for high sierra in Ubuntu 23.04, using gdm/wayland:

#!/bin/bash
docker run \
    --privileged -i \
    --device /dev/kvm \
    -p 50922:10022 \
    -e XDG_RUNTIME_DIR=/tmp \
    -e WAYLAND_DISPLAY=$WAYLAND_DISPLAY \
    -e QT_QPA_PLATFORM=wayland \
    -e GDK_BACKEND=wayland \
    -e CLUTTER_BACKEND=wayland \
    -v $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/tmp/$WAYLAND_DISPLAY \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    -e "DISPLAY=${DISPLAY:-:0.0}" \
    -e AUDIO_DRIVER=pa,server=unix:/tmp/pulseaudio.socket \
    -v "/run/user/$(id -u)/pulse/native:/tmp/pulseaudio.socket" \
    sickcodes/docker-osx:high-sierra
@roowus commented on GitHub (Aug 11, 2024): This is for people who want sonoma on wayland. ``` docker run -it \ --privileged -i \ --device /dev/kvm \ -p 50922:10022 \ -e XDG_RUNTIME_DIR=/tmp \ -e WAYLAND_DISPLAY=$WAYLAND_DISPLAY \ -e QT_QPA_PLATFORM=wayland \ -e GDK_BACKEND=wayland \ -e CLUTTER_BACKEND=wayland \ -v $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/tmp/$WAYLAND_DISPLAY \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -e "DISPLAY=${DISPLAY:-:0.0}" \ -e AUDIO_DRIVER=pa,server=unix:/tmp/pulseaudio.socket \ -v "/run/user/$(id -u)/pulse/native:/tmp/pulseaudio.socket" \ -e GENERATE_UNIQUE=true \ -e CPU='Haswell-noTSX' \ -e CPUID_FLAGS='kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on' \ -e MASTER_PLIST_URL='https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom-sonoma.plist' \ sickcodes/docker-osx:sonoma # docker build -t docker-osx --build-arg SHORTNAME=sonoma . ``` > This is what worked for me for high sierra in Ubuntu 23.04, using gdm/wayland: > > ``` > #!/bin/bash > docker run \ > --privileged -i \ > --device /dev/kvm \ > -p 50922:10022 \ > -e XDG_RUNTIME_DIR=/tmp \ > -e WAYLAND_DISPLAY=$WAYLAND_DISPLAY \ > -e QT_QPA_PLATFORM=wayland \ > -e GDK_BACKEND=wayland \ > -e CLUTTER_BACKEND=wayland \ > -v $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/tmp/$WAYLAND_DISPLAY \ > -v /tmp/.X11-unix:/tmp/.X11-unix \ > -e "DISPLAY=${DISPLAY:-:0.0}" \ > -e AUDIO_DRIVER=pa,server=unix:/tmp/pulseaudio.socket \ > -v "/run/user/$(id -u)/pulse/native:/tmp/pulseaudio.socket" \ > sickcodes/docker-osx:high-sierra > ```
Author
Owner

@dougg0k commented on GitHub (May 18, 2025):

I just tried out docker osx but have been getting the same result in a arch linux based distro.

...
alsa: Reason: No such file or directory
audio: Could not create a backend for voice `adc'
gtk initialization failed

I tried this on Wayland, it wasnt enough.

docker run -it --device /dev/kvm -p 50922:10022 -e XDG_RUNTIME_DIR=/tmp -e WAYLAND_DISPLAY=($env.WAYLAND_DISPLAY) -e DISPLAY=:0 -v $"($env.XDG_RUNTIME_DIR)/($env.WAYLAND_DISPLAY)":/tmp/($env.WAYLAND_DISPLAY) -e QT_QPA_PLATFORM=wayland -e GDK_BACKEND=wayland -e CLUTTER_BACKEND=wayland -e GENERATE_UNIQUE=true -e CPU='Haswell-noTSX' -e CPUID_FLAGS='kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on' -e MASTER_PLIST_URL='https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom-sonoma.plist' -e SHORTNAME=sequoia sickcodes/docker-osx:latest

ps: $env is due to me using nushell.


Then I tried on X11

docker run -it --device /dev/kvm -p 50922:10022 -v /tmp/.X11-unix:/tmp/.X11-unix -e "DISPLAY=${DISPLAY:-:0.0}" -e GENERATE_UNIQUE=true -e CPU='Haswell-noTSX' -e CPUID_FLAGS='kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on' -e MASTER_PLIST_URL='https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom-sonoma.plist' -e SHORTNAME=sequoia sickcodes/docker-osx:latest

And the same result.

Edit:

I needed to fix the DISPLAY variable to work with nushell. Now it works on X11.

But not on Wayland, which is the one I wanted it to work.

Since --privileged was not necessary here, it doesnt make sense why it should on Wayland, so, maybe the issue is elsewhere.


I rather not try with --privileged, but not sure what else can be done based on the suggestions from this issue thread and others.

@dougg0k commented on GitHub (May 18, 2025): I just tried out docker osx but have been getting the same result in a arch linux based distro. ``` ... alsa: Reason: No such file or directory audio: Could not create a backend for voice `adc' gtk initialization failed ``` --- I tried this on Wayland, it wasnt enough. ``` docker run -it --device /dev/kvm -p 50922:10022 -e XDG_RUNTIME_DIR=/tmp -e WAYLAND_DISPLAY=($env.WAYLAND_DISPLAY) -e DISPLAY=:0 -v $"($env.XDG_RUNTIME_DIR)/($env.WAYLAND_DISPLAY)":/tmp/($env.WAYLAND_DISPLAY) -e QT_QPA_PLATFORM=wayland -e GDK_BACKEND=wayland -e CLUTTER_BACKEND=wayland -e GENERATE_UNIQUE=true -e CPU='Haswell-noTSX' -e CPUID_FLAGS='kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on' -e MASTER_PLIST_URL='https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom-sonoma.plist' -e SHORTNAME=sequoia sickcodes/docker-osx:latest ``` ps: `$env` is due to me using `nushell`. --- Then I tried on X11 ``` docker run -it --device /dev/kvm -p 50922:10022 -v /tmp/.X11-unix:/tmp/.X11-unix -e "DISPLAY=${DISPLAY:-:0.0}" -e GENERATE_UNIQUE=true -e CPU='Haswell-noTSX' -e CPUID_FLAGS='kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on' -e MASTER_PLIST_URL='https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom-sonoma.plist' -e SHORTNAME=sequoia sickcodes/docker-osx:latest ``` And the same result. Edit: I needed to fix the DISPLAY variable to work with nushell. Now it works on X11. But not on Wayland, which is the one I wanted it to work. Since `--privileged` was not necessary here, it doesnt make sense why it should on Wayland, so, maybe the issue is elsewhere. --- I rather not try with `--privileged`, but not sure what else can be done based on the suggestions from this issue thread and others.
Author
Owner

@dh0169 commented on GitHub (May 18, 2025):

I just tried out docker osx but have been getting the same result in a arch linux based distro.

...
alsa: Reason: No such file or directory
audio: Could not create a backend for voice `adc'
gtk initialization failed

I tried this on Wayland, it wasnt enough.

docker run -it --device /dev/kvm -p 50922:10022 -e XDG_RUNTIME_DIR=/tmp -e WAYLAND_DISPLAY=($env.WAYLAND_DISPLAY) -e DISPLAY=:0 -v $"($env.XDG_RUNTIME_DIR)/($env.WAYLAND_DISPLAY)":/tmp/($env.WAYLAND_DISPLAY) -e QT_QPA_PLATFORM=wayland -e GDK_BACKEND=wayland -e CLUTTER_BACKEND=wayland -e GENERATE_UNIQUE=true -e CPU='Haswell-noTSX' -e CPUID_FLAGS='kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on' -e MASTER_PLIST_URL='https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom-sonoma.plist' -e SHORTNAME=sequoia sickcodes/docker-osx:latest

ps: $env is due to me using nushell.


Then I tried on X11

docker run -it --device /dev/kvm -p 50922:10022 -v /tmp/.X11-unix:/tmp/.X11-unix -e "DISPLAY=${DISPLAY:-:0.0}" -e GENERATE_UNIQUE=true -e CPU='Haswell-noTSX' -e CPUID_FLAGS='kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on' -e MASTER_PLIST_URL='https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom-sonoma.plist' -e SHORTNAME=sequoia sickcodes/docker-osx:latest

And the same result.

Edit:

I needed to fix the DISPLAY variable based on nushell. Now it works on X11.

But not on Wayland, which is the one I wanted it to work.

Since --privileged was not necessary here, it doesnt make sense why it should on Wayland, so, maybe the issue is elsewhere.


I rather not try with --privileged, but not sure what else can be done based on the suggestions from this issue thread and others.

What happens if you use bash with the original docker command? Same issue?

@dh0169 commented on GitHub (May 18, 2025): > I just tried out docker osx but have been getting the same result in a arch linux based distro. > > ``` > ... > alsa: Reason: No such file or directory > audio: Could not create a backend for voice `adc' > gtk initialization failed > ``` > > --- > > I tried this on Wayland, it wasnt enough. > > ``` > docker run -it --device /dev/kvm -p 50922:10022 -e XDG_RUNTIME_DIR=/tmp -e WAYLAND_DISPLAY=($env.WAYLAND_DISPLAY) -e DISPLAY=:0 -v $"($env.XDG_RUNTIME_DIR)/($env.WAYLAND_DISPLAY)":/tmp/($env.WAYLAND_DISPLAY) -e QT_QPA_PLATFORM=wayland -e GDK_BACKEND=wayland -e CLUTTER_BACKEND=wayland -e GENERATE_UNIQUE=true -e CPU='Haswell-noTSX' -e CPUID_FLAGS='kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on' -e MASTER_PLIST_URL='https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom-sonoma.plist' -e SHORTNAME=sequoia sickcodes/docker-osx:latest > ``` > > ps: `$env` is due to me using `nushell`. > > --- > > Then I tried on X11 > > ``` > docker run -it --device /dev/kvm -p 50922:10022 -v /tmp/.X11-unix:/tmp/.X11-unix -e "DISPLAY=${DISPLAY:-:0.0}" -e GENERATE_UNIQUE=true -e CPU='Haswell-noTSX' -e CPUID_FLAGS='kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on' -e MASTER_PLIST_URL='https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom-sonoma.plist' -e SHORTNAME=sequoia sickcodes/docker-osx:latest > ``` > > And the same result. > > Edit: > > I needed to fix the DISPLAY variable based on nushell. Now it works on X11. > > But not on Wayland, which is the one I wanted it to work. > > Since `--privileged` was not necessary here, it doesnt make sense why it should on Wayland, so, maybe the issue is elsewhere. > > --- > > I rather not try with `--privileged`, but not sure what else can be done based on the suggestions from this issue thread and others. What happens if you use bash with the original docker command? Same issue?
Author
Owner

@dougg0k commented on GitHub (May 18, 2025):

Nice suggestion, it worked with bash. Maybe I set a variable wrongly which gave the wrong result with nushell.

Thanks.


Though, after minimizing the QEMU window, in the setup part, it came back as blackscreen.


Found what I did wrong in the nushell script, these two were set wrongly.

-e $"WAYLAND_DISPLAY=($env.WAYLAND_DISPLAY)" -v $"($env.XDG_RUNTIME_DIR)/($env.WAYLAND_DISPLAY):/tmp/($env.WAYLAND_DISPLAY)"

This is the correct way, and it works.

@dougg0k commented on GitHub (May 18, 2025): Nice suggestion, it worked with bash. Maybe I set a variable wrongly which gave the wrong result with nushell. Thanks. --- Though, after minimizing the QEMU window, in the setup part, it came back as blackscreen. --- Found what I did wrong in the nushell script, these two were set wrongly. ``` -e $"WAYLAND_DISPLAY=($env.WAYLAND_DISPLAY)" -v $"($env.XDG_RUNTIME_DIR)/($env.WAYLAND_DISPLAY):/tmp/($env.WAYLAND_DISPLAY)" ``` This is the correct way, and it works.
Author
Owner

@dh0169 commented on GitHub (May 18, 2025):

Nice suggestion, it worked with bash. Maybe I set a variable wrongly which gave the wrong result with nushell.

Thanks.


Though, after minimizing the QEMU window, in the setup part, it came back as blackscreen.


Found what I did wrong in the nushell script, these two, were set wrongly.

-e $"WAYLAND_DISPLAY=($env.WAYLAND_DISPLAY)" -v $"($env.XDG_RUNTIME_DIR)/($env.WAYLAND_DISPLAY):/tmp/($env.WAYLAND_DISPLAY)"

This is the correct way, and it works.

Nice. I mainly use fish and tend to have issues with bash CMDs/scripts.

@dh0169 commented on GitHub (May 18, 2025): > Nice suggestion, it worked with bash. Maybe I set a variable wrongly which gave the wrong result with nushell. > > Thanks. > > --- > > Though, after minimizing the QEMU window, in the setup part, it came back as blackscreen. > > --- > > Found what I did wrong in the nushell script, these two, were set wrongly. > > ``` > -e $"WAYLAND_DISPLAY=($env.WAYLAND_DISPLAY)" -v $"($env.XDG_RUNTIME_DIR)/($env.WAYLAND_DISPLAY):/tmp/($env.WAYLAND_DISPLAY)" > ``` > > This is the correct way, and it works. Nice. I mainly use fish and tend to have issues with bash CMDs/scripts.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Docker-OSX#303