wa-avd-docker icon indicating copy to clipboard operation
wa-avd-docker copied to clipboard

mknod: missing operand after '10'

Open kenanduman1988 opened this issue 6 years ago • 18 comments

I just did

  1. git clone
  2. docker-compose up -d
  3. connected via http://localhost:6080 with credentials root/secret
  4. I can see desktop(empty) -> Opened LXTerminal
  5. /app/entrypoint.sh

Seems can't create /dev/kvm with mknod

entrypoint_not_work

Please explain how i can run emulator with Pixel device..

Used Versions:

  • Ubuntu 18.04
  • Docker version 18.09.0, build 4d60db4
  • docker-compose version 1.23.1, build b02f1306

Thank you

kenanduman1988 avatar Dec 11 '18 14:12 kenanduman1988

Tried with docker run --privileged -p 6080:80 -e VNC_PASSWORD=secret -e HTTP_PASSWORD=secret docker-android can not create /dev/kvm, tried that script https://github.com/kevinwallace/qemu-docker/blob/master/kvm-mknod.sh not helped...

kenanduman1988 avatar Dec 11 '18 14:12 kenanduman1988

Hi @kenanduman1988. Does manually running start-avd.sh throw any similar errors? I haven't come across this before. Will see what I can find. I also haven't run/updated the project in a while, so maybe I need to check on package versions.

BenSchZA avatar Dec 11 '18 21:12 BenSchZA

So I just tested it on my system without any issues. entrypoint.sh is run when building the Docker image, you should run start-avd.sh once you're in the graphical session - let me know if that works.

BenSchZA avatar Dec 12 '18 20:12 BenSchZA

screencapture-localhost-6080-2019-01-21-19_45_09 1

cd /app ./start-avd.sh

Not helped

kenanduman1988 avatar Jan 21 '19 17:01 kenanduman1988

same problem here

sealabr avatar Oct 08 '19 12:10 sealabr

Here's the issue. The KVM driver seems to be missing. I'm a bit out of context, so will try investigate why that may be the case.

root@8d1f203c0c13:~# cd /app/
root@8d1f203c0c13:/app# ls
avd.desktop    sdk-tools-linux-4333796.zip  start-avd.sh
entrypoint.sh  snapshots                    whatsapp.apk
root@8d1f203c0c13:/app# ./entrypoint.sh 
mknod: missing operand after '10'
Try 'mknod --help' for more information.
root@8d1f203c0c13:/app# vim entrypoint.sh 
bash: vim: command not found
root@8d1f203c0c13:/app# vi entrypoint.sh 
root@8d1f203c0c13:/app# $(grep '\<kvm\>' /proc/misc | cut -f 1 -d' ')
root@8d1f203c0c13:/app# echo $(grep '\<kvm\>' /proc/misc | cut -f 1 -d' ')

root@8d1f203c0c13:/app# cat /proc/misc 
 55 rfkill
237 loop-control
200 tun
 56 vboxnetctl
 57 vboxdrvu
 58 vboxdrv
235 autofs
236 device-mapper
249 zfs
 59 memory_bandwidth
 60 network_throughput
 61 network_latency
 62 cpu_dma_latency
228 hpet
231 snapshot
 63 vga_arbiter
root@8d1f203c0c13:/app# 

BenSchZA avatar Oct 08 '19 13:10 BenSchZA

how I can call the shell of docker in my command line?

sealabr avatar Oct 08 '19 15:10 sealabr

For the above shell, I accessed it from within the VNC session, at localhost:6080. Otherwise you could maybe go directly through the Docker process: e.g. docker exec -it <container name> /bin/bash

BenSchZA avatar Oct 08 '19 15:10 BenSchZA

okay, thanks

sealabr avatar Oct 08 '19 15:10 sealabr

I have the same issue

Nottt avatar Nov 24 '19 06:11 Nottt

Okay, so something I really didn't know much about is that Docker containers share the host kernel and kernel modules... So that's the root of the issue I think.

What kernel version are you using @Nottt ?

See the following issues, which might lead to a work-around. My guess is that when I had this setup working, I had the kernel and modules all configured on host machine.

  • https://stackoverflow.com/questions/33013539/docker-loading-kernel-modules
  • https://forums.docker.com/t/kvm-module-is-not-loaded-in-container/50928
  • https://forum.proxmox.com/threads/lxc-docker-containerd-cannot-find-lib-modules-4-15-18-9-pve.49406/

BenSchZA avatar Nov 27 '19 21:11 BenSchZA

For reference, this is where I got the qemu-kvm setup code originally: https://github.com/sivaramsk/docker-kvm

BenSchZA avatar Nov 27 '19 21:11 BenSchZA

I'm unfortunately running NixOS which complicates things slightly with loading the host kernel modules into the Docker container, but you could try something like binding the host modules -v /lib/modules:/lib/modules.

BenSchZA avatar Nov 27 '19 21:11 BenSchZA

I'm using Ubuntu 18.04 with 5.1.9-050109-generic and haven't installed anything related to kvm, qemu or similar to host.

I'll try to play around again later

Nottt avatar Nov 28 '19 18:11 Nottt

I'm 99% certain this is happening because the host machine does not have VT turned on in the bios.

smashah avatar Jan 03 '20 22:01 smashah

If you'd like to check I found this helpful: https://stackoverflow.com/questions/11116704/check-if-vt-x-is-activated-without-having-to-reboot-in-linux

@smashah I see you forked the repo, let us know if you have any luck :) I'm pretty sure I have virtualization enabled though, but will double check I wasn't testing on a different machine.

My guess is still some sort of incompatibility between the host kernel version/modules and the container setup.

BenSchZA avatar Jan 04 '20 18:01 BenSchZA

I have tried this on two servers at home. One has VT on and one doesn't. It worked fine on the one with VT on. This error popped up on the one without VT. Both Ubuntu 18.04.

I got it running ok, however it's temperamental to say the least. This finding is not unique to this image though as the same issues arise with budtmo/docker-android

I forked for the purpose of trying to implement v42loopback within the container itself (which I can then add an implementation of my library - sulla-hotfix).

The avd isn't reliable on the working host as when I hit the home button the avd crashes. Maybe time to upgrade the hardware (intel i5 nuc).

I've looked into genymotion but it's pretty expensive however it's reliable. I think there needs to be a concerted community effort to reverse engineer genymotion in order to build a reliable docker avd base image.

Can you walk me through the hardware on your host and it's actual performance?

Thanks for the legwork on this project @BenSchZA

smashah avatar Jan 04 '20 20:01 smashah

had same issue, please verify first if /dev/kvm exists on host if not virtualization is most likely not enabled, in my case i had to enable virtualization support again (was disabled via bios update) with a amd cpu enter bios then go to “Advanced” > “CPU Configuration”. Go to “SVM Mode” and select “Enabled"

xeniter avatar Dec 20 '20 01:12 xeniter