Sign inSign up

jigneshvasoya/vm

By jigneshvasoya

Updated almost 10 years ago

VM appliance through Docker

Image
0

423

jigneshvasoya/vm repository overview

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

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= ro quiet fastboot"

Tag summary

Content type

Image

Digest

Size

313.5 MB

Last updated

almost 10 years ago

docker pull jigneshvasoya/vm:14.04_base