Created
March 1, 2012 04:04
-
-
Save bdha/1947201 to your computer and use it in GitHub Desktop.
Migrating from VirtualBox to KVM on ZFS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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.img,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. |
Yup. Fixed.
dd if=machine.img of=/dev/zvol/rdsk/zones/machine
This takes incredibly long. According to the partition size, you should add something like bs=1M or similar.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You have machine.raw in line 20 and machine.img in line 25 which refers to the same file. (i'm right ? )