Unable to launh on WSL2 with WSLg #195

Closed
opened 2025-12-29 00:20:02 +01:00 by adam · 6 comments
Owner

Originally created by @Vayth on GitHub (May 21, 2021).

OS related issued, please help us identify the issue by posting the output of this

uname -a \
; echo "${DISPLAY}" \
; echo 1 | sudo tee /sys/module/kvm/parameters/ignore_msrs \
; grep NAME /etc/os-release \
; df -h . \
; qemu-system-x86_64 --version \
; libvirtd --version \
; free -mh \
; nproc \
; egrep -c '(svm|vmx)' /proc/cpuinfo \
; ls -lha /dev/kvm \
; ls -lha /tmp/.X11-unix/ \
; ps aux | grep dockerd \
; docker ps | grep osx \
; grep "docker\|kvm\|virt" /etc/group
Linux PC-NAME 5.4.72-microsoft-standard-WSL2 #3 SMP Fri May 21 20:32:44 WIB 2021 x86_64 x86_64 x86_64 GNU/Linux
0:0
1
NAME="Ubuntu"
PRETTY_NAME="Ubuntu 20.04.2 LTS"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
Filesystem      Size  Used Avail Use% Mounted on
/dev/sdc        251G   14G  225G   6% /
QEMU emulator version 4.2.1 (Debian 1:4.2-3ubuntu6.16)
Copyright (c) 2003-2019 Fabrice Bellard and the QEMU Project developers
libvirtd (libvirt) 6.0.0
              total        used        free      shared  buff/cache   available
Mem:          7.7Gi       811Mi       157Mi       402Mi       6.7Gi       6.2Gi
Swap:         2.0Gi       0.0Ki       2.0Gi
8
8
crw-rw-rw- 1 root kvm 10, 232 May 22 03:09 /dev/kvm
total 24K
drwxrwxrwt 2 root root 4.0K May 22 02:43 .
drwxrwxrwt 8 root root  20K May 22 02:51 ..
username+     861  0.0  0.0   8164   732 pts/0    S+   03:17   0:00 grep --color=auto dockerd
kvm:x:108:username
docker:x:1001:username
libvirt:x:120:username
libvirt-qemu:x:64055:libvirt-qemu
libvirt-dnsmasq:x:121:

Hello, I was trying to get this run, but I got some issue since I'm not familiar with kvm/qemu.
I was following this guide to enable nested-kvm on wsl.
Since the latest insider include WSLg, I didn't install additional xserver like vcXsrv or X410. Not sure whether this caused it or not, but I did manage to run gedit successfully.
I also installed x11-apps.

However, I got the following error when trying to run the container:

docker run -it --device /dev/kvm -p 50922:10022 -v /tmp/.X11-unix:/tmp/.X11-unix -e "DISPLAY=${DISPLAY:-:0.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
+ [[ 3 = max ]]
+ [[ 3 = half ]]
++ id -u
++ id -g
+ sudo chown -R 1000:1000 /dev/snd
+ exec qemu-system-x86_64 -m 3000 -cpu Penryn,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,+pcid,+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,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-Catalina/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 -vga vmware
qemu-system-x86_64: -drive if=pflash,format=raw,readonly,file=/home/arch/OSX-KVM/OVMF_CODE.fd: warning: short-form boolean option 'readonly' deprecated
Please use readonly=on instead
Unable to init server: Could not connect: Connection refused
QEMU 6.0.0 monitor - type 'help' for more information
(qemu) qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.80000007H:EDX.invtsc [bit 8]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.80000007H:EDX.invtsc [bit 8]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.80000007H:EDX.invtsc [bit 8]
qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.80000007H:EDX.invtsc [bit 8]
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2660:(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:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2660:(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:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2660:(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:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2660:(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

Can you help me?

Originally created by @Vayth on GitHub (May 21, 2021). # OS related issued, please help us identify the issue by posting the output of this ``` uname -a \ ; echo "${DISPLAY}" \ ; echo 1 | sudo tee /sys/module/kvm/parameters/ignore_msrs \ ; grep NAME /etc/os-release \ ; df -h . \ ; qemu-system-x86_64 --version \ ; libvirtd --version \ ; free -mh \ ; nproc \ ; egrep -c '(svm|vmx)' /proc/cpuinfo \ ; ls -lha /dev/kvm \ ; ls -lha /tmp/.X11-unix/ \ ; ps aux | grep dockerd \ ; docker ps | grep osx \ ; grep "docker\|kvm\|virt" /etc/group ``` ``` Linux PC-NAME 5.4.72-microsoft-standard-WSL2 #3 SMP Fri May 21 20:32:44 WIB 2021 x86_64 x86_64 x86_64 GNU/Linux 0:0 1 NAME="Ubuntu" PRETTY_NAME="Ubuntu 20.04.2 LTS" VERSION_CODENAME=focal UBUNTU_CODENAME=focal Filesystem Size Used Avail Use% Mounted on /dev/sdc 251G 14G 225G 6% / QEMU emulator version 4.2.1 (Debian 1:4.2-3ubuntu6.16) Copyright (c) 2003-2019 Fabrice Bellard and the QEMU Project developers libvirtd (libvirt) 6.0.0 total used free shared buff/cache available Mem: 7.7Gi 811Mi 157Mi 402Mi 6.7Gi 6.2Gi Swap: 2.0Gi 0.0Ki 2.0Gi 8 8 crw-rw-rw- 1 root kvm 10, 232 May 22 03:09 /dev/kvm total 24K drwxrwxrwt 2 root root 4.0K May 22 02:43 . drwxrwxrwt 8 root root 20K May 22 02:51 .. username+ 861 0.0 0.0 8164 732 pts/0 S+ 03:17 0:00 grep --color=auto dockerd kvm:x:108:username docker:x:1001:username libvirt:x:120:username libvirt-qemu:x:64055:libvirt-qemu libvirt-dnsmasq:x:121: ``` Hello, I was trying to get this run, but I got some issue since I'm not familiar with kvm/qemu. I was following [this guide to enable nested-kvm on wsl](https://boxofcables.dev/accelerated-kvm-guests-on-wsl-2/). Since the latest insider include WSLg, I didn't install additional xserver like vcXsrv or X410. Not sure whether this caused it or not, but I did manage to run `gedit` successfully. I also installed `x11-apps`. However, I got the following error when trying to run the container: ``` docker run -it --device /dev/kvm -p 50922:10022 -v /tmp/.X11-unix:/tmp/.X11-unix -e "DISPLAY=${DISPLAY:-:0.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 + [[ 3 = max ]] + [[ 3 = half ]] ++ id -u ++ id -g + sudo chown -R 1000:1000 /dev/snd + exec qemu-system-x86_64 -m 3000 -cpu Penryn,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,+pcid,+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,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-Catalina/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 -vga vmware qemu-system-x86_64: -drive if=pflash,format=raw,readonly,file=/home/arch/OSX-KVM/OVMF_CODE.fd: warning: short-form boolean option 'readonly' deprecated Please use readonly=on instead Unable to init server: Could not connect: Connection refused QEMU 6.0.0 monitor - type 'help' for more information (qemu) qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.80000007H:EDX.invtsc [bit 8] qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.80000007H:EDX.invtsc [bit 8] qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.80000007H:EDX.invtsc [bit 8] qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.80000007H:EDX.invtsc [bit 8] ALSA lib confmisc.c:767:(parse_card) cannot find card '0' ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory ALSA lib pcm.c:2660:(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:767:(parse_card) cannot find card '0' ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory ALSA lib pcm.c:2660:(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:767:(parse_card) cannot find card '0' ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory ALSA lib pcm.c:2660:(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:767:(parse_card) cannot find card '0' ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory ALSA lib pcm.c:2660:(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 ``` Can you help me?
adam closed this issue 2025-12-29 00:20:02 +01:00
Author
Owner

@Vayth commented on GitHub (May 23, 2021):

The error seems similar to #280 at first glance.
However, running xhost + gave me xhost: unable to open display ":0".

@Vayth commented on GitHub (May 23, 2021): The error seems similar to #280 at first glance. However, running `xhost +` gave me `xhost: unable to open display ":0"`.
Author
Owner

@evilz commented on GitHub (Jul 20, 2021):

work for me.

But fail to install bigsur

@evilz commented on GitHub (Jul 20, 2021): work for me. But fail to install bigsur
Author
Owner

@sickcodes commented on GitHub (Jul 21, 2021):

work for me.

But fail to install bigsur

Keep hitting the Big Sur Installer, it needs to reboot about 3 times during the installation

@sickcodes commented on GitHub (Jul 21, 2021): > work for me. > > But fail to install bigsur Keep hitting the Big Sur Installer, it needs to reboot about 3 times during the installation
Author
Owner

@evilz commented on GitHub (Jul 21, 2021):

I got segmentation fault and docker stop

Le mer. 21 juil. 2021 à 16:50, sickcodes @.***> a
écrit :

work for me.

But fail to install bigsur

Keep hitting the Big Sur Installer, it needs to reboot about 3 times
during the installation


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/sickcodes/Docker-OSX/issues/282#issuecomment-884251924,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAWNIBTBX2AXDYDSXY6IMDLTY3NFBANCNFSM45J2FOWA
.

@evilz commented on GitHub (Jul 21, 2021): I got segmentation fault and docker stop Le mer. 21 juil. 2021 à 16:50, sickcodes ***@***.***> a écrit : > work for me. > > But fail to install bigsur > > Keep hitting the Big Sur Installer, it needs to reboot about 3 times > during the installation > > — > You are receiving this because you commented. > Reply to this email directly, view it on GitHub > <https://github.com/sickcodes/Docker-OSX/issues/282#issuecomment-884251924>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AAWNIBTBX2AXDYDSXY6IMDLTY3NFBANCNFSM45J2FOWA> > . >
Author
Owner

@sickcodes commented on GitHub (Jul 28, 2021):

Fixed with https://github.com/sickcodes/Docker-OSX/pull/318

@sickcodes commented on GitHub (Jul 28, 2021): Fixed with https://github.com/sickcodes/Docker-OSX/pull/318
Author
Owner

@JtMotoX commented on GitHub (Nov 26, 2021):

I am also getting this exact output/error. Did you ever get it resolved? I am using Docker Desktop which my Distro is using. I am able to launch gedit through WSLg and I am also able to launch xclock through x11.

@JtMotoX commented on GitHub (Nov 26, 2021): I am also getting this exact output/error. Did you ever get it resolved? I am using Docker Desktop which my Distro is using. I am able to launch gedit through WSLg and I am also able to launch xclock through x11.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Docker-OSX#195