Public Repository

Last pushed: 8 months ago
Short Description
kvm-qemu container for EbbRT back-end images
Full Description


Container includes the ebbrt fork of qemu, and an entry-point script startvm that setups up the networking and execution of the VM. The VM is bridged to the docker network in a way that the container appears transparent, i.e., the VM inherits the IP and macaddr of the container. The VM is connected via with a multi-queue tap.

Deploying this container requires the NET_ADMIN capability, and kvm tun and vnet-host kernel modules.

Use the VM_CPU and VM_RAM env variables to specify the amount of cpus and ram the VM will have. Arguments passed to the docker container will be appended to qemu creation line.


docker run -d --cap-add NET_ADMIN --net=net0  --device  /dev/kvm:/dev/kvm
--device /dev/net/tun:/dev/net/tun --device /dev/vhost-net:/dev/vhost-net 
-v $HOME/build/helloworld.elf32:/tmp/img.elf
-v $HOME/build/initrd:/tmp/initrd 
-e VM_MEM=2G -e VM_CPU=2 
ebbrt/kvm-qemu:latest -gdb tcp::123 -kernel /tmp/img.elf -initrd /tmp/initrd

The above docker run command results in the following being executed inside the container:

qemu-system-x86_64 -m 2G -smp cpus=2 -cpu host -serial stdio -display none -enable-kvm 
-netdev tap,script=no,downscript=no,ifname=tap0,id=net0,vhost=on,queues=2 
-device virtio-net pci,netdev=net0,mac=02:42:ac:15:00:02,mq=on,vectors=6 
-gdb tcp::123 -kernel /tmp/img.elf -initrd /tmp/initrd

Based off rancher vm

Docker Pull Command

Comments (0)