Howto Convert Vmware Image to Virtualbox Image or Import Vmware Image into Virtualbox
VirtualBox is a virtual emulator like VMWare workstation. It has many of the features VMWare has, as well as some of its own.
Note:- Before Converting make a backup copy of your vmware image
We are going to use qemu-img tool to this.QEMU disk image utility
First Install qemu qemu-img is included with qemu package using the following command
sudo apt-get install qemu
Convert a VMWare Image to VirtualBox Image
Convert VMWare image called debian.vmdk to /tmp/debian.bin
qemu-img convert debian.vmdk /tmp/debian.bin
Now use VBoxManage to get back image in native format:
VBoxManage convertdd /tmp/debian.bin debian.vdi
VirtualBox can run VMs created by VMware Workstation or Server for this you need to import vmdk files using the following procedure
- Start Virtual Box
- Goto File > Virtual Disk Manager
- Click Add. Locate and select the copied .vmdk file. Click OK.
- Create a New VM as usual using the added vmdk file
- Boot the VM
If you have any other solutions let us share with us.
and what about vice versa? is it possible?
Xen is also GPL.
If you want to convert virtualbox image in to vmware image you can use following procedure
First you need to convert .vdi file in to .raw file using the following command
vboxmanage internalcommands converttoraw debian.vdi debian.raw
Now you need to convert this .raw file in to .vmdk file using the following command
qemu-img convert -O vmdk debian.raw debian.vmdk
Ok… I want to take a HDD windows XP partition and move that to a Virtualbox image that I can run inside of Ubuntu… Any pointers on how to convert that?
To convert an HDD windows xp partition into a VM just use the vmware converter tool. Then follow the steps above to convert from vmware to virtualbox.
There’s more than one way to do it! How? Knoppix.
Essentially you have two working VMs, one is VirtualBox with your Windows partition already to go–fully installed.
In VirtualBox settings, point the CD to either a Knoppix iso, or a Knoppix CD, either will do, which will cause VirtualBox to boot the VirtualBox VM into Knoppix such that the VM mount point is *known* to Knoppix, e.g., /dev/hda.
Set up VMware to open with Knoppix also, and start from the KDE->KNOPPPIX menu sshd server. Open a terminal window and type sudo /sbin/ifconfig to get the VMware ip address. Jot it down. Leave VMware running and switch to VirtualBox and open a Knoppix terminal window there and su to root.
Essentially, you are going to *copy* the /dev/hda filesystem directly over to your VMware VM which has an sshd server listening. This essentially does what ghosting would do except you are using ‘dd’ and ‘ssh’ as follows:
dd if=/dev/hda bs=15M conv=sync,noerror | ssh -o TCPKeepAlive=yes \ [email protected]_host_ip “dd of=/dev/hda”
When all is complete, you should have ‘dd’ return some info:
#dd if=nt_backup bs=15M conv=sync,noerror | ssh -o TCPKeepAlive=yes \
[email protected] “dd of=/dev/hda”
The authenticity of host ‘192.168.114.128 (192.168.114.128)’ can’t be established.
RSA key fingerprint is 23:d6:0e:b7:7b:23:47:9f:f6:45:a6:cc:5b:f1:d4:b1.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘192.168.114.128’ (RSA) to the list of known hosts.
20971520+0 records in
20971520+0 records out
10737418240 bytes (11 GB) copied
20969319+4402 records in
20971520+0 records out
10737418240 bytes (11 GB) copied
Close Knoppix on VMware and remove the Knoppix iso from your settings and VMware should find your newly imaged partition!
And there you have it! Knoppix!
I’m looking for a VPS hosting service which will accept a Virtual Box vdi file and run that.
Now you can use directly command
--variant Standard /tmp/debian.bin debian.vdi
sorry should be /tmp/debian.vmdk instead of /tmp/debian.bin
Thats very nice, thank you.
I have a problem, cause if I use this tutorial what I am importing is the hard drive, but VirtualBox seems to use a different set of virtual hardware and my XP vm isn’t even booting.
Is there a way to import my computers hardware configuration or i’ll have search for a turnaround by fixing my os’s installation instead of changing my VBox configuration?
i tried converting but its not working.
by doing in method 1 –
when i convert from .bin to .vdi, it gives the following error:-
Converting from raw image file=”debian.bin” to file=”debian.vdi”…
Creating dynamic image with size 512 bytes (1MB)…
Error while creating the disk image “debian.vdi”: VERR_INVALID_PARAMETER
and by doing it in method 2 –
after the 3rd step stated above, (“Click Add. Locate and select the copied .vmdk file. Click OK.”) i receive the following error:-
Failed to open the hard disk debian.vmdk.
Could not open the medium ‘debian.vmdk’.
VD: error VERR_ACCESS_DENIED opening image file ‘debian.vmdk’ (VERR_ACCESS_DENIED).
details of the error says:-
please help 🙁 🙁 🙁
@rakib Did you shut down your VMware server before you attempted to do the convert? Are you logged in as ROOT?
There is no need to convert the virtual machines or virtual disks to virtual box. The latest version of Oracle VirtualBox can run them in their native form. Oracle Virtual Box can read the vmware virtual/vmdk hard disks directly.
You can use the VBoxManage utility to convert .vmdk files into .vdi files from the command line, so why can’t it work in reverse as well?
In one step: VBoxManage clonehd foobar.vdi foobar.vmdk –format VMDK
Works like a charm! Thanks for posting this!
You help me a lot thank for the tip!
What about dynamic disks? Do I need to convert all of them? If so any ideas on a simple script to do just that? Also, I tried to import the disk into VBox and I get an about file system corruption with vm files and ext4. This disk files worked fine in vmware workstation and vmplayer.
Really helpful article. I tried using vmware in ubuntu but vbox is far better.
I just started working with VirtualBox. I am liking it, but I have tried to import my VMPlayer images so I can get away from VMPlayer/VMserver (the last one never worked) so far I have not had luck at getting my original images to import into VB. I tried the instructions on here both the cmd line and the gui based. I did generate the .vdi file and I tried to get VB to run it but it would not even recognize it.
I tried to do solution 2 but I had no luck. I am running Rev 4.1.2. I do not want to have to go and rebuild my old VM’s if I can avoid it.
Hi, thanks for this solution. The conversion worked for me.
OK, I figured out what was wrong with my Linux VM’s files, I needed to turn pae on. BUT the win7 VM abends to a BSOD and that dies so fast I can not get the error codes. It runs until the point where the circling balls meet, at that point it does the BSOD. I have done all kinds of things comparing the two VM’s on VMPlayer and VB, but no joy.
VBoxManage clonehd –format VDI /path/to/your/vmdk /path/to/your/converted/vdi
Thank you very much!
I never knew that VirtualBox can use directly VMDK files created by VMware.
But in my version, I could never find where to add a disk. Here was what I did:
Click “New” in the main window to create a new virtual system;
In the new window, click to confirm and the most important: click on “use existed disk”;
In the window to choose file, locate the vmdk file(s) by VMware;
Final ajustments to correctly configure the “new” system.
Thank you for your help.
I prefer Virtualbox that Vmware.
Currently, in virtualbox is not possible anymore to add hard disks from where the article says. You have to create a new machine, then select a new hard disk, then you can select the vmdk image.
Will this work if youir vmware vmdk is split into 2GB files and not single vmdk file?
Fantastic. I was very dissapointed in VMware Workstation on Linux – i’m happily back to Virtual box now – long live open source!
Just wish I could get my damn money back… Damn VMware thieves… The way VMWare Workstatoin manages the user interface completely sucks, and “Unity Mode” is a pile of poo. Virtual box is just ideal.