open-wa / wa-avd-docker

A Docker image based on Ubuntu Desktop with VNC and noVNC access, that runs a lightweight Android Virtual Device with WhatsApp pre-installed.
https://hub.docker.com/r/yodascholtz/docker-android-whatsapp-avd/
Other
134 stars 40 forks source link

mknod: missing operand after '10' #2

Open kenanduman1988 opened 5 years ago

kenanduman1988 commented 5 years ago

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:

Thank you

kenanduman1988 commented 5 years ago

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...

BenSchZA commented 5 years ago

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 commented 5 years ago

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.

kenanduman1988 commented 5 years ago

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

cd /app ./start-avd.sh

Not helped

sealabr commented 4 years ago

same problem here

BenSchZA commented 4 years ago

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# 
sealabr commented 4 years ago

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

BenSchZA commented 4 years ago

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

sealabr commented 4 years ago

okay, thanks

Nottt commented 4 years ago

I have the same issue

BenSchZA commented 4 years ago

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.

BenSchZA commented 4 years ago

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

BenSchZA commented 4 years ago

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.

Nottt commented 4 years ago

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

smashah commented 4 years ago

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

BenSchZA commented 4 years ago

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.

smashah commented 4 years ago

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

xeniter commented 3 years ago

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"