BBVA/kvm

docker run simply hangs in this step char device redirected to /dev/pts/1 (label charserial0)

csudharsan opened this issue · 2 comments

Firstly, thanks for this wonderful tool :)

When i run my qcow2 image on centos7 using this command

[root@localhost test]# docker run --name kvm --rm -it --privileged -v /var/test/myimage.qcow2:/image/image -e AUTO_ATTACH=yes -e DEBUG=y bbvainnotech/kvm:latest /bin/sh

The command simply hangs at this point

INFO: Launching qemu-kvm
DEBUG: Launching /usr/libexec/qemu-kvm -drive if=virtio,file=/image/image -nodefaults -device virtio-balloon-pci,id=balloon0 -realtime mlock=off -msg timestamp=on -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -serial stdio -enable-kvm -machine accel=kvm,usb=off -vga qxl -display none -m 1024 -smp 4,sockets=4,cores=1,threads=1 /bin/sh -device virtio-net-pci,netdev=net0,mac=02:42:ac:11:00:02 -netdev tap,id=net0,vhost=on,fd=3 3<>/dev/macvtap1c06f8
char device redirected to /dev/pts/1 (label charserial0)

Is there anything i need to set in my host to have this working?

Hi!

Firstly, thanks for this wonderful tool :)

Glad that you like it!

First, I see you are passing /bin/sh as an argument to docker run .... If you want to debug the container, pass bash instead. It is explained here, but the example code is missing the bash keyword at the end. Ooops.

If you want to use the VM, take into account that the VM's will be accessible only via network. You must ensure that the VM launches a dhcp client and spawns an ssh server, for instance.
(Correct me if I'm wrong, @methadata).

If all the requirements I mentioned are met, you should be able to reach your VM with a simple ssh someuser@172.17.0.2 or whatever IP is assigned by the dnsmasq server that is launched. That info should be apparent in the logs.

Hope that it helps!

Closing. @csudharsan, feel free to reopen if you require more clarifications.