You need X11, possibly you are on Wayland, just install xorg-host using these commands.
To know your graphic environment: echo $XDG_SESSION_TYPE
Try this
sudo pacman -S xorg-xhost
Allow Docker to access xorg-host:
xhost +local:docker
@jdic commented on GitHub (Jul 25, 2024):
You need X11, possibly you are on Wayland, just install `xorg-host` using these commands.
To know your graphic environment: `echo $XDG_SESSION_TYPE`
### Try this
``` sh
sudo pacman -S xorg-xhost
```
Allow Docker to access `xorg-host`:
``` sh
xhost +local:docker
```
@jdic Can we not use it on Wayland or those are the steps to run it on Wayland?
I'm on Wayland, and those steps solved my problem.
$ echo$XDG_SESSION_TYPE
wayland
@jdic commented on GitHub (Jul 26, 2024):
> @jdic Can we not use it on Wayland or those are the steps to run it on Wayland?
I'm on Wayland, and those steps solved my problem.
```bash
$ echo $XDG_SESSION_TYPE
wayland
```
ssh-keygen: generating new host keys: RSA ECDSA ED25519
nohup: appending output to 'nohup.out'
++ id -u
++ id -g
+ sudo chown 1000:1000 /dev/kvm
+ true
++ id -u
++ id -g
+ sudo chown -R 1000:1000 /dev/snd
+ [[ 4 = max ]]
+ [[ 4 = half ]]
++ id -u
++ id -g
+ sudo chown -R 1000:1000 /dev/snd
+ exec qemu-system-x86_64 -m 4000 -cpu Penryn,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check, -machine q35,accel=kvm:tcg -smp 4,cores=4 -device qemu-xhci,id=xhci -device usb-kbd,bus=xhci.0 -device usb-tablet,bus=xhci.0 -device 'isa-applesmc,osk=ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc' -drive if=pflash,format=raw,readonly=on,file=/home/arch/OSX-KVM/OVMF_CODE.fd -drive if=pflash,format=raw,file=/home/arch/OSX-KVM/OVMF_VARS-1024x768.fd -smbios type=2 -audiodev alsa,id=hda -device ich9-intel-hda -device hda-duplex,audiodev=hda -device ich9-ahci,id=sata -drive id=OpenCoreBoot,if=none,snapshot=on,format=qcow2,file=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2 -device ide-hd,bus=sata.2,drive=OpenCoreBoot -device ide-hd,bus=sata.3,drive=InstallMedia -drive id=InstallMedia,if=none,file=/home/arch/OSX-KVM/BaseSystem.img,format=qcow2 -drive id=MacHDD,if=none,file=/home/arch/OSX-KVM/mac_hdd_ng.img,format=qcow2 -device ide-hd,bus=sata.4,drive=MacHDD -netdev user,id=net0,hostfwd=tcp::10022-:22,hostfwd=tcp::5900-:5900, -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:09:49:17 -monitor stdio -boot menu=on -vga vmware
QEMU 9.0.0 monitor - type 'help' for more information
(qemu) ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1342:(snd_func_refer) error evaluating name
ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5727:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2721:(snd_pcm_open_noupdate) Unknown PCM default
alsa: Could not initialize DAC
alsa: Failed to open `default':
alsa: Reason: No such file or directory
ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1342:(snd_func_refer) error evaluating name
ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5727:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2721:(snd_pcm_open_noupdate) Unknown PCM default
alsa: Could not initialize DAC
alsa: Failed to open `default':
alsa: Reason: No such file or directory
audio: Could not create a backend for voice `dac'
ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1342:(snd_func_refer) error evaluating name
ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5727:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2721:(snd_pcm_open_noupdate) Unknown PCM default
alsa: Could not initialize ADC
alsa: Failed to open `default':
alsa: Reason: No such file or directory
ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1342:(snd_func_refer) error evaluating name
ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5727:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2721:(snd_pcm_open_noupdate) Unknown PCM default
alsa: Could not initialize ADC
alsa: Failed to open `default':
alsa: Reason: No such file or directory
audio: Could not create a backend for voice `adc'
gtk initialization failed
@Zero2wo commented on GitHub (Jul 31, 2024):
Doesn't run
Here's the output
```# docker build -t docker-osx --build-arg SHORTNAME=big-sur .
ssh-keygen: generating new host keys: RSA ECDSA ED25519
nohup: appending output to 'nohup.out'
++ id -u
++ id -g
+ sudo chown 1000:1000 /dev/kvm
+ true
++ id -u
++ id -g
+ sudo chown -R 1000:1000 /dev/snd
+ [[ 4 = max ]]
+ [[ 4 = half ]]
++ id -u
++ id -g
+ sudo chown -R 1000:1000 /dev/snd
+ exec qemu-system-x86_64 -m 4000 -cpu Penryn,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check, -machine q35,accel=kvm:tcg -smp 4,cores=4 -device qemu-xhci,id=xhci -device usb-kbd,bus=xhci.0 -device usb-tablet,bus=xhci.0 -device 'isa-applesmc,osk=ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc' -drive if=pflash,format=raw,readonly=on,file=/home/arch/OSX-KVM/OVMF_CODE.fd -drive if=pflash,format=raw,file=/home/arch/OSX-KVM/OVMF_VARS-1024x768.fd -smbios type=2 -audiodev alsa,id=hda -device ich9-intel-hda -device hda-duplex,audiodev=hda -device ich9-ahci,id=sata -drive id=OpenCoreBoot,if=none,snapshot=on,format=qcow2,file=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2 -device ide-hd,bus=sata.2,drive=OpenCoreBoot -device ide-hd,bus=sata.3,drive=InstallMedia -drive id=InstallMedia,if=none,file=/home/arch/OSX-KVM/BaseSystem.img,format=qcow2 -drive id=MacHDD,if=none,file=/home/arch/OSX-KVM/mac_hdd_ng.img,format=qcow2 -device ide-hd,bus=sata.4,drive=MacHDD -netdev user,id=net0,hostfwd=tcp::10022-:22,hostfwd=tcp::5900-:5900, -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:09:49:17 -monitor stdio -boot menu=on -vga vmware
QEMU 9.0.0 monitor - type 'help' for more information
(qemu) ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1342:(snd_func_refer) error evaluating name
ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5727:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2721:(snd_pcm_open_noupdate) Unknown PCM default
alsa: Could not initialize DAC
alsa: Failed to open `default':
alsa: Reason: No such file or directory
ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1342:(snd_func_refer) error evaluating name
ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5727:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2721:(snd_pcm_open_noupdate) Unknown PCM default
alsa: Could not initialize DAC
alsa: Failed to open `default':
alsa: Reason: No such file or directory
audio: Could not create a backend for voice `dac'
ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1342:(snd_func_refer) error evaluating name
ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5727:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2721:(snd_pcm_open_noupdate) Unknown PCM default
alsa: Could not initialize ADC
alsa: Failed to open `default':
alsa: Reason: No such file or directory
ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1342:(snd_func_refer) error evaluating name
ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5727:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2721:(snd_pcm_open_noupdate) Unknown PCM default
alsa: Could not initialize ADC
alsa: Failed to open `default':
alsa: Reason: No such file or directory
audio: Could not create a backend for voice `adc'
gtk initialization failed
```
@syorito-hatsuki commented on GitHub (Feb 8, 2025):
Yep. Same on Hyprland Wayland Linux. Tried run over this command. I remember that few weeks ago when I did it first time it at least run but boot was in loop
@syorito-hatsuki commented on GitHub (Feb 8, 2025):
Yep. Same on Hyprland Wayland Linux. Tried run over this command. I remember that few weeks ago when I did it first time it at least run but boot was in loop
```sh
docker run -it --device /dev/kvm \
-p 50922:10022 \
-e WAYLAND_DISPLAY=$WAYLAND_DISPLAY \
-e SHORTNAME=sequoia sickcodes/docker-osx:latest
```
I've had the same problem. The issue was SELinux for me. Qemu tried to write into restricted file. Changing SELinux to permissive mode and ignoring that one error solved the issue for me. You can probably also follow the instruction in SELinux troubleshooter if you don't want to change SELinux permission.
I also did xhost +local:docker from @jdic second time I run docker, and I've picked Sonoma. Not sure if that make a difference, but the second time I noticed SELinux error.
@jcubic commented on GitHub (Aug 30, 2025):
I've had the same problem. The issue was SELinux for me. Qemu tried to write into restricted file. Changing SELinux to permissive mode and ignoring that one error solved the issue for me. You can probably also follow the instruction in SELinux troubleshooter if you don't want to change SELinux permission.
I also did `xhost +local:docker` from @jdic second time I run docker, and I've picked Sonoma. Not sure if that make a difference, but the second time I noticed SELinux error.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @ennrl on GitHub (Jul 18, 2024).
NAME="Manjaro Linux"
PRETTY_NAME="Manjaro Linux"
Файловая система Размер Использовано Дост Использовано% Cмонтировано в
/dev/nvme0n1p2 225G 119G 95G 56% /
QEMU emulator version 9.0.1
Copyright (c) 2003-2024 Fabrice Bellard and the QEMU Project developers
libvirtd (libvirt) 10.5.0
free: Multiple unit options don't make sense.
4
egrep: warning: egrep is obsolescent; using grep -E
8
crw-rw-rw- 1 root kvm 10, 232 июл 18 02:30 /dev/kvm
итого 0
drwxrwxrwt 2 root root 120 июл 18 02:23 .
drwxrwxrwt 17 root root 420 июл 18 02:33 ..
srwxr-xr-x 1 akkenrl akkenrl 0 июл 18 02:23 X0
srwxr-xr-x 1 akkenrl akkenrl 0 июл 18 02:23 X1
srwxr-xr-x 1 gdm gdm 0 июл 18 02:23 X1024
srwxr-xr-x 1 gdm gdm 0 июл 18 02:23 X1025
root 1213 0.0 0.9 2347780 77164 ? Ssl 02:23 0:00 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
akkenrl 5555 0.0 0.0 6640 4340 pts/1 S+ 02:33 0:00 grep dockerd
Command:
sudo docker run --privileged -e "DISPLAY=${DISPLAY:-:0.0}" -v /tmp/.X11-unix:/tmp/.X11-unix sickcodes/docker-osx
Output:
ssh-keygen: generating new host keys: RSA ECDSA ED25519
++ id -u
++ id -g
++ id -u
++ id -g
++ id -u
++ id -g
Authorization required, but no authorization protocol specified
QEMU 8.0.2 monitor - type 'help' for more information
(qemu) gtk initialization failed
@jdic commented on GitHub (Jul 25, 2024):
You need X11, possibly you are on Wayland, just install
xorg-hostusing these commands.To know your graphic environment:
echo $XDG_SESSION_TYPETry this
Allow Docker to access
xorg-host:@PixsaOJ commented on GitHub (Jul 26, 2024):
@jdic Can we not use it on Wayland or those are the steps to run it on Wayland?
@jdic commented on GitHub (Jul 26, 2024):
I'm on Wayland, and those steps solved my problem.
@Zero2wo commented on GitHub (Jul 31, 2024):
I have the same problem i am using fedora workstation on x11
what command should i run to show detalils
@PixsaOJ commented on GitHub (Jul 31, 2024):
xhost +or if you sudo
sudo xhost +@Zero2wo commented on GitHub (Jul 31, 2024):
Doesn't run
Here's the output
@ibraiiian commented on GitHub (Aug 3, 2024):
Madep
@Zero2wo commented on GitHub (Aug 5, 2024):
access control disabled, clients can connect from any host
@syorito-hatsuki commented on GitHub (Feb 8, 2025):
Yep. Same on Hyprland Wayland Linux. Tried run over this command. I remember that few weeks ago when I did it first time it at least run but boot was in loop
@jcubic commented on GitHub (Aug 30, 2025):
I've had the same problem. The issue was SELinux for me. Qemu tried to write into restricted file. Changing SELinux to permissive mode and ignoring that one error solved the issue for me. You can probably also follow the instruction in SELinux troubleshooter if you don't want to change SELinux permission.
I also did
xhost +local:dockerfrom @jdic second time I run docker, and I've picked Sonoma. Not sure if that make a difference, but the second time I noticed SELinux error.@GrauBlitz commented on GitHub (Oct 10, 2025):
and
did the trick for me on Manjaro Plasma with Wayland.