Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sonook opened this issue Jan 22, 2022 · 8 comments
Open

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

sonook opened this issue Jan 22, 2022 · 8 comments

Comments

@sonook
Copy link

sonook commented 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
@kris-hamade
Copy link

I am having this same issue

@sonook
Copy link
Author

sonook commented Jan 24, 2022

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

https://youtu.be/BxBw16OCQME

@sickcodes
Copy link
Owner

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

@evilz
Copy link

evilz commented Jan 25, 2022

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

@dazbeattie
Copy link

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

@VIEWVIEWVIEW
Copy link

VIEWVIEWVIEW commented 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 :)

@mensdev
Copy link

mensdev commented 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!

@rollingmoai
Copy link

The PR in #774 works for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants