Virtualbox VDI to VMware VMDK with Qemu script
This script converts your VDI image to a VMDK image if you installed Virtualbox and Qemu on the default location of your Mac OS X.
I placed this script in my home directory as vdi2vmdk.sh but you could place it anywere you want.
The code of vdi2vmdk.sh:
1 2 3 4 5 6 7 8 9 10 11 12 13 | #!/bin/sh echo "VDI 2 Raw..." ri="svi2raw.tmp" if [ -e "$ri" ] then echo "" rm $ri fi /Applications/VirtualBox.app/Contents/MacOS/VBoxManage internalcommands converttoraw -format vdi "$1" "$ri" echo "Raw to VMDK..." /Applications/Q.app/Contents/MacOS/qemu-img convert -O vmdk "$ri" "$2" rm "$ri" echo "DONE!" |
If you have any questions, please ask...
Convert Virtualbox VDI image to VMware VMDK image with Qemu
I wrote this manual for Mac OS X, but it should work also for Linux / Windows.
Download and install Qemu from: http://www.kju-app.org/
The Qemu main site for other systems: http://www.qemu.org/ (like linux / windows)
That should not be so hard, dragging it into your Applications folder
Next start Terminal.app from /Applications/Utilities.
Type the following commands to convert your image, keep in mind that you need to change the paths to your own needs. Else it might (and it will) break
/Applications/VirtualBox.app/Contents/MacOS/VBoxManage internalcommands converttoraw -format vdi "xSOURCE_DISKx.vdi" "tmpz.tmp" /Applications/Q.app/Contents/MacOS/qemu-img convert -O vmdk "tmpz.tmp" "xTARGET_DISKx.vmdk"
Next is to add your disk to VMware and you are done
Keep in mind the following things:
- Enough disk space.
- Virtualbox images are in ~/Library/VirtualBox/HardDisks/
- VMware images are in ~/Documents/Virtual Machines.localized/
- I could use some donations
If you have any question, just contact me
Converting from VMware (vmdk) to VirtualBox (vdi) on Mac OS X
NOTE: This is for a single file vmdk harddisk image!
First of all, nicely shut down your VMware image and copy (keep a backup) the complete disk to a different location, in my case this will be the directory VMware on my desktop.
You need Qemu and of course Virtualbox, they can be downloaded from http://www.qemu.org/ and http://www.virtualbox.org/
After installing these two applications you just need these commands in Terminal to convert your disk:
/Applications/Q.app/Contents/MacOS/qemu-img convert xVMDISKx.vmdk raw-file.bin
Now to convert the raw file to a VirtualBox image, run the following:
/Applications/VirtualBox.app/Contents/MacOS/VBoxManage convertdd raw-file.bin xFILENAMEx.vdi
Start Virtualbox and add the image to the Virtual Disk library. After that close Virtualbox again and compact the image with:
/Applications/VirtualBox.app/Contents/MacOS/VBoxManage modifyvdi xFILENAMEx.vdi compact
Hope this will help you out!




