I am trying to create zvol backed virtualbox guests using ZFS on Linux. Hopefully this is not too ambitious.
- Find size of original .VDI disk image: vboxmanage showhdinfo Fedora19.vdi
- Pass that file size into zfs create: zfs create -V40960M tank/VMs/Fedora19
- Convert .vdi file to raw, best if you can do this from one hd to another. In my case I’m reading from a zvol and writing to an ssd: vboxmanage clonehd Fedora19.vdi ~/tmp/Fedora19.raw –format RAW
- Load that back into a raw parition image: dd if=~/tmp/Fedora19.raw of=/dev/zvol/tank/VMs/9101-f19 bs=1280k
- now we can check partitions: vboxmanage internalcommands listpartitions –rawdisk /dev/zvol/tank/VMs/9101-f19
- Then we can create a vmdk file for the raw parition: vboxmanage internalcommands createrawvmdk -filename ~/VirtualBox\ VMs/9101-f19/9101-f19-B.vmdk -rawdisk /dev/zvol/tank/VMs/9101-f19 -partitions 1,2,3
- create an idea controller: vboxmanage storagectl …vboxmanage storagectl 9101-f19-B –name IDE –add ide
- add blank version of hard drive: vboxmanage storageattach 9101-f19-B –storagectl IDE –port 0 –device 0 –mtype normal –type hdd –medium none
- add hard drive: vboxmanage storageattach 9101-f19-B –storagectl IDE –port 0 –device 0 –mtype normal –type hdd –medium “/home/jreynolds/VirtualBox VMs/9101-f19-B/9101-f19-B.vmdk”
- …attach the CD rom and then repair the system…somehow my disk image stopped being bootable. :-(