Public Repository

Last pushed: a year ago
Short Description
VM appliance through Docker
Full Description

Build and distribute VM appliance through docker

Convert docker image into VM image

pull image and create container using same image

docker pull jigneshvasoya/vm:ubuntu-server-16.04
docker run -it jigneshvasoya/vm:ubuntu-server-16.04 /bin/bash

above command will start container, get its container id <id>

export container image to convert the image into VM image

docker export <id> > /tmp/vm-iamge.tar
fallocate kvm-vm-image.img -l8G
mkfs.ext4 kvm-vm-image.img
mount kvm-vm-image.img /tmp/mnt
tar xf kvm-vm-image.img -C /tmp/mnt
cp /tmp/mnt/vmlinuz /tmp/vmlinuz
cp /tmp/mnt/initrd.img /tmp/initrd.img
umount /tmp/mnt

create new VM using virt-manager and attach kvm-vm-image.img to the VM
use direct kernl booting using kernle and initrd copied in previoys step (/tmp/vmlinuz, /tmp/initrd.img)
kernel arguments: "root=<disk-device-name> ro quiet fastboot"

Docker Pull Command
Owner
jigneshvasoya