rancher / old-vm

(OBSOLETE) Package and Run Virtual Machines as Docker Containers
Apache License 2.0
646 stars 133 forks source link

VM in container fails to connect outside under RancherOS(host OS) #62

Open TrumanLing opened 8 years ago

TrumanLing commented 8 years ago

Case 1: RancherOS(host OS)+rancher/vm-rancheros Cmd: same as document described, it is docker run -e "RANCHER_VM=true" --cap-add NET_ADMIN -v /tmp/ranchervm:/ranchervm --device /dev/kvm:/dev/kvm --device /dev/net/tun:/dev/net/tun rancher/vm-rancheros Result: device eth0 in VM cant not obtain ip address from DHCP server, even if manually config eth0 and ip route, still cann't ping bridge docker0

Case 2: RancherOS(host OS)+rnd-dockerhub.huawei.com/library/rancher-vm-ubuntu:14.04, rnd-dockerhub.huawei.com/library/rancher-vm-ubuntu:14.04 is almost same as rancher/vm-ubuntu, just change id/pwd for ubuntu os image Cmd: same as document described, it is docker run -e "RANCHER_VM=true" --cap-add NET_ADMIN -v /tmp/ranchervm:/ranchervm --device /dev/kvm:/dev/kvm --device /dev/net/tun:/dev/net/tun rnd-dockerhub.huawei.com/library/rancher-vm-ubuntu:14.04 Result: same as Case 1

Case 3: Ubuntu(host OS)+rancher/vm-rancheros Cmd: same as document described, it is docker run -e "RANCHER_VM=true" --cap-add NET_ADMIN -v /tmp/ranchervm:/ranchervm --device /dev/kvm:/dev/kvm --device /dev/net/tun:/dev/net/tun rancher/vm-rancheros Result: network of VM in container works