There are multiple reasons one might want to run VMs inside containers. One scenario could be running VMs as part of a CI pipeline which executes all build steps inside containers. This can be useful, for example, for emulating bare-metal deployments. In this talk, I will demonstrate how to create a virtual machine inside a Docker container using KVM as the hypervisor driver, explain how the container needs to be configured in terms of privileges and discuss some of the challenges involved.
3. The Deep-stack Kubernetes
Experts
Engineering services and products for
Kubernetes, containers, process
management and Linux user-space +
kernel
Blog: kinvolk.io/blog
Github: kinvolk
Twitter: kinvolkio
Email: hello@kinvolk.io
8. Also known as Virtual Machine Monitor.
A process that creates and runs virtual machines.
Shares host machine’s resources.
Examples: VirtualBox, VMware, KVM.
10. root@591532:/# egrep -c '(vmx|svm)' /proc/cpuinfo
vmx – Intel VT-x, virtualisation support enabled in BIOS
svm – AMD SVM,virtualisation enabled in BIOS.
If the count is 0, then your CPU does not support hardware virtualisation.
33. Spin up a VM in the container.
vagrant init generic/alpine37
vagrant up
vagrant ssh
# Check that it supports virtualisation
root@59157fd1ed32:/# egrep -c '(vmx|svm)' /proc/cpuinfo
# Spin up another VM inside of this VM :)