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

Fail to run image #280

Closed
banderlog opened this issue May 15, 2021 · 8 comments
Closed

Fail to run image #280

banderlog opened this issue May 15, 2021 · 8 comments

Comments

@banderlog
Copy link

Trying to run images as stated in the README, but it fails:

$docker run -it \                                                                                                                                                                                                                                      [33/33]
>     --device /dev/kvm \
>     -p 50922:10022 \
>     -v /tmp/.X11-unix:/tmp/.X11-unix \
>     -e "DISPLAY=${DISPLAY:-:0.0}" \
>     sickcodes/docker-osx:latest
Unable to find image 'sickcodes/docker-osx:latest' locally
latest: Pulling from sickcodes/docker-osx
d77b9d4abb0e: Pull complete
38c86b782660: Pull complete
4c084b4204e1: Pull complete
fec257bf62bf: Pull complete
ec4a0daf4dc1: Pull complete
64e0f7ef743a: Pull complete
1c6415153a04: Pull complete
cd6ddd277c37: Pull complete
9f215996dcc8: Pull complete
fe177344b257: Pull complete
18cc2a2efa7d: Pull complete
fb1d1e7d9079: Pull complete
31861cc85324: Pull complete
d18a70524efc: Pull complete
ade3ec924eaf: Pull complete
d327295519f9: Pull complete
234c5a3e1c2f: Pull complete
b7d308bc942c: Pull complete
e3f0cee9390d: Pull complete
1671208e795b: Pull complete
Digest: sha256:a42d00a796784daf98603c745d3bc0cdbf55e291662145a9a89fd90811948b65
Status: Downloaded newer image for 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=ourhard
workbythesewordsguardedpleasedontsteal(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 -devic
e 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=InstallM
edia,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
No protocol specified
Unable to init server: Could not connect: Connection refused
QEMU 6.0.0 monitor - type 'help' for more information
(qemu) 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 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
@sickcodes
Copy link
Owner

Missing issue template for diagnosing your problem.

@banderlog
Copy link
Author

Sorry, my bad. Here it is:

Linux 5CD90139Q6 5.4.0-73-generic #82~18.04.1-Ubuntu SMP Fri Apr 16 15:10:02 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
:0

NAME="Ubuntu"
PRETTY_NAME="Ubuntu 18.04.5 LTS"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic

Filesystem                   Size  Used Avail Use% Mounted on
/dev/mapper/ubuntu--vg-root  232G  185G   35G  85% /

Command 'qemu-system-x86_64' not found, but can be installed with:

sudo apt install qemu-system-x86

Command 'libvirtd' not found, but can be installed with:

sudo apt install libvirt-daemon

              total        used        free      shared  buff/cache   available
Mem:            15G         13G        1,5G        198M        755M        1,8G
Swap:          975M        896M         79M
8
8
crw------- 1 root root 10, 232 тра 15 13:40 /dev/kvm
total 24K
drwxrwxrwt  2 root  root  4,0K тра 15 06:40 .
drwxrwxrwt 90 root  root   20K тра 16 10:03 ..
srwxrwxrwx  1 user user    0 тра 15 06:40 X0
root      1802  0.1  0.0 1798236 15060 ?       Ssl  тра15   2:34 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
user    23186  0.0  0.0  17164  1152 pts/6    S+   11:42   0:00 grep --color=auto dockerd

docker:x:999:user

@sickcodes
Copy link
Owner

Try this first:
https://github.com/sickcodes/Docker-OSX#initial-setup

At first glance, you are not in the kvm group. Secondly, I don't think your system allows it. Try this: echo 1 | sudo tee /sys/module/kvm/parameters/ignore_msrs

@Attivik
Copy link

Attivik commented May 16, 2021

I had a similar problem on my (K)Ubuntu 20.04, I worked it out by running xhost + before the docker command.

@banderlog
Copy link
Author

run log after initial setup
sudo modprobe kvm
$ 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=ourhard
workbythesewordsguardedpleasedontsteal(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 -devic
e 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=InstallM
edia,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
No protocol specified
Unable to init server: Could not connect: Connection refused
QEMU 6.0.0 monitor - type 'help' for more information
(qemu) 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
Issue template after initial-setup

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 5CD90139Q6 5.4.0-73-generic #82~18.04.1-Ubuntu SMP Fri Apr 16 15:10:02 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
:0
1
NAME="Ubuntu"
PRETTY_NAME="Ubuntu 18.04.5 LTS"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/ubuntu--vg-root 232G 187G 34G 85% /
QEMU emulator version 2.11.1(Debian 1:2.11+dfsg-1ubuntu7.36)
Copyright (c) 2003-2017 Fabrice Bellard and the QEMU Project developers
libvirtd (libvirt) 4.0.0
total used free shared buff/cache available
Mem: 15G 4,5G 3,6G 726M 7,3G 9G
Swap: 975M 449M 526M
8
8
crw-rw---- 1 root kvm 10, 232 тра 17 02:40 /dev/kvm
total 24K
drwxrwxrwt 2 root root 4,0K тра 15 06:40 .
drwxrwxrwt 140 root root 20K тра 17 02:40 ..
srwxrwxrwx 1 user user 0 тра 15 06:40 X0
root 1802 0.1 0.1 1798236 31108 ? Ssl тра15 2:59 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
user 22955 0.0 0.0 17164 1024 pts/6 S+ 02:44 0:00 grep --color=auto dockerd
docker:x:999:user
kvm:x:127:
libvirt:x:129:administrator,user
libvirt-qemu:x:64055:libvirt-qemu
libvirt-dnsmasq:x:130:

xhost +; before docker command helped, thx @Attivik :]

@BackMountainDevil
Copy link

Excuse me. So how do you solve the problem in the end...

@sickcodes
Copy link
Owner

Excuse me. So how do you solve the problem in the end...

Can you post a new issue with the diagnostic infio or search closed issues for the problem you're having?

@BackMountainDevil
Copy link

Excuse me. So how do you solve the problem in the end...

Can you post a new issue with the diagnostic infio or search closed issues for the problem you're having?

of course. and I have solved it by xhost +SI:localuser:kearney

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

4 participants