Not able to run Docker-OSX on WSLg in windows 11 #309

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

Originally created by @sonook on GitHub (Jan 22, 2022).

Hi,

i have followed all the steps in windows 11 for running Docker-OSX on WSL but getting below error.

root@5CD1407WWJ:/mnt/c/Users/sonook# docker run -it \

--device /dev/kvm \
-p 888:888 \
-v /mnt/wslg/.X11-unix:/tmp/.X11-unix \
-e "DISPLAY=${DISPLAY:-:0}" \
sickcodes/docker-osx:latest

ssh-keygen: generating new host keys: RSA DSA ECDSA ED25519
nohup: appending output to 'nohup.out'
++ id -u
++ id -g

  • sudo chown 1000:1000 /dev/kvm
    ++ id -u
    ++ id -g
  • sudo chown -R 1000:1000 /dev/snd

  • ++ 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 -usb -device usb-kbd -device usb-tablet -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 6.2.0 monitor - type 'help' for more information
    (qemu) ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
    ALSA lib conf.c:5178:(_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:5178:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
    ALSA lib confmisc.c:1334:(snd_func_refer) error evaluating name
    ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
    ALSA lib conf.c:5701:(snd_config_expand) Evaluate error: No such file or directory
    ALSA lib pcm.c:2664:(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:5178:(_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:5178:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory ALSA lib confmisc.c:1334:(snd_func_refer) error evaluating name ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory ALSA lib conf.c:5701:(snd_config_expand) Evaluate error: No such file or directory ALSA lib pcm.c:2664:(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: Failed to create voice dac' ALSA lib confmisc.c:855:(parse_card) cannot find card '0' ALSA lib conf.c:5178:(_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:5178:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory ALSA lib confmisc.c:1334:(snd_func_refer) error evaluating name ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory ALSA lib conf.c:5701:(snd_config_expand) Evaluate error: No such file or directory ALSA lib pcm.c:2664:(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:5178:(_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:5178:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
    ALSA lib confmisc.c:1334:(snd_func_refer) error evaluating name
    ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
    ALSA lib conf.c:5701:(snd_config_expand) Evaluate error: No such file or directory
    ALSA lib pcm.c:2664:(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: Failed to create voice adc'
    gtk initialization failed
Originally created by @sonook on GitHub (Jan 22, 2022). Hi, i have followed all the steps in windows 11 for running Docker-OSX on WSL but getting below error. root@5CD1407WWJ:/mnt/c/Users/sonook# docker run -it \ > --device /dev/kvm \ > -p 888:888 \ > -v /mnt/wslg/.X11-unix:/tmp/.X11-unix \ > -e "DISPLAY=${DISPLAY:-:0}" \ > sickcodes/docker-osx:latest ssh-keygen: generating new host keys: RSA DSA ECDSA ED25519 nohup: appending output to 'nohup.out' ++ id -u ++ id -g + sudo chown 1000:1000 /dev/kvm ++ 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 -usb -device usb-kbd -device usb-tablet -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 6.2.0 monitor - type 'help' for more information (qemu) ALSA lib confmisc.c:855:(parse_card) cannot find card '0' ALSA lib conf.c:5178:(_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:5178:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory ALSA lib confmisc.c:1334:(snd_func_refer) error evaluating name ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory ALSA lib conf.c:5701:(snd_config_expand) Evaluate error: No such file or directory ALSA lib pcm.c:2664:(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:5178:(_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:5178:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory ALSA lib confmisc.c:1334:(snd_func_refer) error evaluating name ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory ALSA lib conf.c:5701:(snd_config_expand) Evaluate error: No such file or directory ALSA lib pcm.c:2664:(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: Failed to create voice `dac' ALSA lib confmisc.c:855:(parse_card) cannot find card '0' ALSA lib conf.c:5178:(_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:5178:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory ALSA lib confmisc.c:1334:(snd_func_refer) error evaluating name ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory ALSA lib conf.c:5701:(snd_config_expand) Evaluate error: No such file or directory ALSA lib pcm.c:2664:(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:5178:(_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:5178:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory ALSA lib confmisc.c:1334:(snd_func_refer) error evaluating name ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory ALSA lib conf.c:5701:(snd_config_expand) Evaluate error: No such file or directory ALSA lib pcm.c:2664:(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: Failed to create voice `adc' gtk initialization failed
Author
Owner

@kris-hamade commented on GitHub (Jan 24, 2022):

I am having this same issue

@kris-hamade commented on GitHub (Jan 24, 2022): I am having this same issue
Author
Owner

@sonook commented on GitHub (Jan 24, 2022):

i am able to run finally after hours of troubleshooting. I have used VNC method.

https://youtu.be/BxBw16OCQME

@sonook commented on GitHub (Jan 24, 2022): i am able to run finally after hours of troubleshooting. I have used VNC method. https://youtu.be/BxBw16OCQME
Author
Owner

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

This is the gtk initialization failed error, I'm gonna work on the windows instructions, have you jumped in the discord? Link on http://sick.chat and we're working on making Windows instructions better

@sickcodes commented on GitHub (Jan 24, 2022): This is the `gtk initialization failed` error, I'm gonna work on the windows instructions, have you jumped in the discord? Link on http://sick.chat and we're working on making Windows instructions better
Author
Owner

@evilz commented on GitHub (Jan 25, 2022):

I run on wsl2g Everytime.
I launch the docker command from Ubuntu.

@evilz commented on GitHub (Jan 25, 2022): I run on wsl2g Everytime. I launch the docker command from Ubuntu.
Author
Owner

@dazbeattie commented on GitHub (Jan 29, 2022):

I run on wsl2g Everytime. I launch the docker command from Ubuntu.

I agree. Had issues running it within Windows, but from Ubuntu WSL2, no issues

@dazbeattie commented on GitHub (Jan 29, 2022): > I run on wsl2g Everytime. I launch the docker command from Ubuntu. I agree. Had issues running it within Windows, but from Ubuntu WSL2, no issues
Author
Owner

@VIEWVIEWVIEW commented on GitHub (Mar 4, 2022):

Hey,

if you used WSL2 under Windows 10 previously and upgraded to Windows 11 via windows update (no clean w11 installation): you need to update your WSL2 VM first.

# Update WSL2 (run powershell with administrator privileges)
wsl --update

# Shut any down all VMs
wsl --shutdown

# Wait at least 8 seconds. See for more info: https://docs.microsoft.com/en-us/windows/wsl/wsl-config#the-8-second-rule

# Start wsl again
wsl

# Test if display output works now
xeyes

# Run your docker container
docker run -it \
--device /dev/kvm \
-p 50922:10022 \
-e "DISPLAY=${DISPLAY:-:0}" \
-v /mnt/wslg/.X11-unix:/tmp/.X11-unix \
sickcodes/docker-osx:latest

Hope this helps :)

@VIEWVIEWVIEW commented on GitHub (Mar 4, 2022): Hey, if you used WSL2 under Windows 10 previously and upgraded to Windows 11 via windows update (no clean w11 installation): you need to update your WSL2 VM first. ``` # Update WSL2 (run powershell with administrator privileges) wsl --update # Shut any down all VMs wsl --shutdown # Wait at least 8 seconds. See for more info: https://docs.microsoft.com/en-us/windows/wsl/wsl-config#the-8-second-rule # Start wsl again wsl # Test if display output works now xeyes # Run your docker container docker run -it \ --device /dev/kvm \ -p 50922:10022 \ -e "DISPLAY=${DISPLAY:-:0}" \ -v /mnt/wslg/.X11-unix:/tmp/.X11-unix \ sickcodes/docker-osx:latest ``` Hope this helps :)
Author
Owner

@mensdev commented on GitHub (Oct 19, 2023):

Hey,

if you used WSL2 under Windows 10 previously and upgraded to Windows 11 via windows update (no clean w11 installation): you need to update your WSL2 VM first.

# Update WSL2 (run powershell with administrator privileges)
wsl --update

# Shut any down all VMs
wsl --shutdown

# Wait at least 8 seconds. See for more info: https://docs.microsoft.com/en-us/windows/wsl/wsl-config#the-8-second-rule

# Start wsl again
wsl

# Test if display output works now
xeyes

# Run your docker container
docker run -it \
--device /dev/kvm \
-p 50922:10022 \
-e "DISPLAY=${DISPLAY:-:0}" \
-v /mnt/wslg/.X11-unix:/tmp/.X11-unix \
sickcodes/docker-osx:latest

Hope this helps :)

Worked for me. But before that, I manually switched to WSL 1 and didn’t update from 10 to 11. Thanks!

@mensdev commented on GitHub (Oct 19, 2023): > Hey, > > if you used WSL2 under Windows 10 previously and upgraded to Windows 11 via windows update (no clean w11 installation): you need to update your WSL2 VM first. > > ``` > # Update WSL2 (run powershell with administrator privileges) > wsl --update > > # Shut any down all VMs > wsl --shutdown > > # Wait at least 8 seconds. See for more info: https://docs.microsoft.com/en-us/windows/wsl/wsl-config#the-8-second-rule > > # Start wsl again > wsl > > # Test if display output works now > xeyes > > # Run your docker container > docker run -it \ > --device /dev/kvm \ > -p 50922:10022 \ > -e "DISPLAY=${DISPLAY:-:0}" \ > -v /mnt/wslg/.X11-unix:/tmp/.X11-unix \ > sickcodes/docker-osx:latest > ``` > > Hope this helps :) Worked for me. But before that, I manually switched to WSL 1 and didn’t update from 10 to 11. Thanks!
Author
Owner

@rollingmoai commented on GitHub (Sep 1, 2024):

The PR in #774 works for me

@rollingmoai commented on GitHub (Sep 1, 2024): The PR in #774 works for me
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Docker-OSX#309