Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Migrating from VirtualBox to KVM on ZFS
# It's important to convert the vbox image (VMDK or VDI or whatever) using
# the same version of VirtualBox that created it. You can try converting the image
# with qemu-img or kvm-img, but weird version mismatches will possibly make it not
# work.
# On your VirtualBox machine:
cd $VBOX_ROOT/$MACHINE_ROOT/
VBoxManage clonehd machine.vmdk machine.img --format RAW
scp machine.img root@kvm-host:/somewhere
# Now go over to your KVM host.
ssh root@kvm-host
cd /somewhere
# You may want to run something like the following to ensure your raw image is
# bootable before taking all the time to dd it.
qemu-system-x86_64 -drive file=machine.raw,boot=on
# You need to see how big of a volume you need for the image, and then create a
# sparse dataset of that size and dd the raw image onto the ZFS raw block device.
ls -l machine.img
123456b
zfs create -V 123456b zones/machine
dd if=machine.img of=/dev/zvol/rdsk/zones/machine
# That's it. Point your KVM branded zone at that dataset and it should boot.
#
# Cheers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.