2018年3月24日 星期六

using VboxManage convert dd to vmdk or vdi file

https://blog.sleeplessbeastie.eu/2012/04/29/virtualbox-convert-raw-image-to-vdi-and-otherwise/


Let's assume that we have raw image of the sdb device:

$ sudo dd if=/dev/sdb of=./sdb.raw
To use it with VirtualBox we need to convert it to the VDI format:

$ VBoxManage convertdd sdb.raw sdb.vdi --format VDI
To use it with VMware we need to convert it to the VMDK format:

$ VBoxManage convertdd sdb.raw sdb.vmdk --format VMDK
Convert between VDI/VMDK formats:

$ VBoxManage clonehd sdb.vdi sdb.vmdk --format VMDK
$ VBoxManage clonehd sdb.vmdk sdb.vdi --format VDI
Convert to the RAW image:

$ VBoxManage clonehd sdb.vdi sdb.raw --format RAW
Alternative solution to get back raw image after applying modifications is to use qemu-img command from qemu package:

$ qemu-img convert -f vmdk sdb.vmdk -O raw sdb.raw
Now we can write image to the device:

$ sudo dd if=./sdb.raw of=/dev/sdb

沒有留言:

張貼留言