Howto Convert Vmware Image to Virtualbox Image or Import Vmware Image into Virtualbox

Sponsored Link
VirtualBox is a family of powerful x86 virtualization products for enterprise as well as home use. Not only is VirtualBox an extremely feature rich, high performance product for enterprise customers, it is also the only professional solution that is freely available as Open Source Software under the terms of the GNU General Public License (GPL).

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

Solution 1

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

Solution 2

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.

Sponsored Link

You may also like...

29 Responses

  1. venhow says:

    thanks??it’s work,,

  2. xyz says:

    and what about vice versa? is it possible?
    thx

  3. anonymous says:

    Xen is also GPL.
    see http://en.wikipedia.org/wiki/Xen

  4. admin says:

    @Xyz

    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

  5. J S says:

    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?

  6. Omar says:

    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.

  7. dietrich says:

    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 \ root@vmware_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!

    –Dietrich

  8. Otter says:

    I’m looking for a VPS hosting service which will accept a Virtual Box vdi file and run that.
    Any pointers?

  9. Kamik says:

    Now you can use directly command

    VBoxManage convertfromraw --format vmdk --variant Standard /tmp/debian.bin debian.vdi

  10. Kamik says:

    sorry should be /tmp/debian.vmdk instead of /tmp/debian.bin

  11. ignbell says:

    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?
    Thanks again,

  12. Rakib says:

    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:-
    Result Code:
    NS_ERROR_FAILURE (0x80004005)
    Component:
    Medium
    Interface:
    IMedium {aa8167ba-df72-4738-b740-9b84377ba9f1}
    Callee:
    IVirtualBox {2158464a-f706-414b-a8c4-fb589dfc6b62}

    please help 🙁 🙁 🙁

  13. Levar Berry says:

    @rakib Did you shut down your VMware server before you attempted to do the convert? Are you logged in as ROOT?

  14. 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.

  15. The Doctor says:

    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

  16. gaz00 says:

    Works like a charm! Thanks for posting this!

  17. Stavros says:

    You help me a lot thank for the tip!

  18. Skaramanger says:

    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.

    Thanks

  19. Really helpful article. I tried using vmware in ubuntu but vbox is far better.

  20. James says:

    Thanks

  21. Chuck Hast says:

    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.

  22. towerlexa says:

    Hi, thanks for this solution. The conversion worked for me.

  23. Chuck Hast says:

    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.

  24. Simon B says:

    VBoxManage clonehd –format VDI /path/to/your/vmdk /path/to/your/converted/vdi

    works better?

  25. foshelan says:

    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.

    That’s all!

  26. ector says:

    Thank you for your help.
    I prefer Virtualbox that Vmware.

  27. Albert says:

    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.

  28. kubuli says:

    Will this work if youir vmware vmdk is split into 2GB files and not single vmdk file?

  29. Trimtab says:

    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.

Leave a Reply

Your email address will not be published. Required fields are marked *