Converting VMWare .vmdk To VirtualBox .vdi Using Qemu+ and VBoxManage: Difference between revisions

From ITCwiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(27 intermediate revisions by the same user not shown)
Line 3: Line 3:
First, download qemu, open a Console and execute:  
First, download qemu, open a Console and execute:  


sudo apt-get install qemu  
  '''sudo apt-get install qemu'''


Next, open a console and go to your .vmdk virtual disc image folder and type this:  
Next, open a console and go to your .vmdk virtual disc image folder and type this:  


qemu-img convert "harddrive-name".vmdk -O raw-file.bin  
  '''qemu-img convert "harddrive-name".vmdk /filelocation/"harddrive-name".bin'''


Change "harddrive-name" with the name of your .vmdk file and raw-file with the name of the new converted file you want to create. This takes a few minutes, After the conversion is completed. A raw hard disk image has been created.  
Change "harddrive-name" with the name of your .vmdk file and raw-file with the name of the new converted file you want to create. This takes a few minutes, After the conversion is completed. A raw hard disk image has been created.  


To convert a raw disk image to a VirtualBox Disk Image (VDI) file use this command.  
To convert a raw disk image to a VirtualBox Disk Image (.vdi) file use this command.  


VBoxManage convertfromraw  
The syntax is as follows:
  '''VBoxManage convertfromraw /filelocation/"harddrive-name".bin <outputfile>'''


The syntax is as follows: sudo VBoxManage clonehd /home/edwardss/.VirtualBox/HardDisks/XPHardDisk1.vdi /home/edwardss/.VirtualBox
Example:


  '''sudo VBoxManage convertfromraw /home/tony/.VirtualBox/HardDisks/HardDisk1.bin /home/tony/.VirtualBox'''
[--format VDI|VMDK|VHD]


VBoxManage convertfromraw <filename> <outputfile>  
[--variant Standard,Fixed,Split2G,Stream,ESX]
  '''VBoxManage convertfromraw stdin <outputfile> <bytes>'''
[--format VDI|VMDK|VHD]  
[--format VDI|VMDK|VHD]  
[--variant Standard,Fixed,Split2G,Stream,ESX]
VBoxManage convertfromraw stdin <outputfile> <bytes>
[--format VDI|VMDK|VHD]
[--variant Standard,Fixed,Split2G,Stream,ESX]
where the parameters mean: format Select the disk image format to create. Default is VDI.
variant Allow to choose a file format variant for the output file. It is a comma-separated list of variant flags. Not all combinations are supported, and specifying inconsistent flags will result in an error message.
The second form forces VBoxManage to read the content for the disk image from standard input(useful for using that command in a pipe).


Run VirtualBox, use the (File Menu) Virtual Media Manager and 'Add' the newly cloned drive. This makes Virtual Box 'aware' of the drive. Then go though the normal creation steps and choose this as the drive to use for the virtual machine.
[--variant Standard,Fixed,Split2G,Stream,ESX]


Downloading that vditool file is not the simplest thing in the world. If you try and open it with Firefox, for page with weird code in it will appear. To save this vditool file, right click on the link and choose to save the file. You can also tell a download manager to download this file for you. I suggest you the download manager: Aria. It is into Ubuntu repositoryes.
What the parameters mean:


Now that we’ve got vditool, we need to make it executable. Right click on the file, open its propertyes and set the “Executable” permission option. In Gnome, go into the Permission tag and activate the “Let this program be executed” or something like that option (Remember, my Ubuntu is Italian, dunno what’s your exact translation).  
'''format'''  - Selects the disk image format to create. Default is .vdi.  


At that point, we’ll need the console again, from the same dir where you’ve stored dvitool and the .bin raw file. Run this from console into the interested dir:
'''variant'''  - Allows to choose a file format variant for the output file. It is a comma-separated list of variant flags. Not all combinations are supported, and specifying inconsistent flags will result in an error message.  


LD_LIBRARY_PATH=/opt/VirtualBox* ./vditool DD new-file.vdi old-file.bin


Where new-file.vdi is the file that will be outputted by vdi tool and must be the first to appear in the command. The second filename, old-file.bin, is the name of the raw disc image we converted the .vmdk image to. Naturally, change this invented names with real ones.  
The second form forces VBoxManage to read the content for the disk image from standard input(useful for using that command in a pipe).


If you wish, remember that you can run vditool for other tasks too. Now we’ll run it to optimize the filesize of the .vdi image file, for example. For a list of all commands, you’ve just got to execute vditool without any other option.


Now we’re going to optimize the filesize of the newly converted .dvi file, let’s call it new-file.dvi and fromth console in the dir where you’ve got this file, run:
Note: For compatibility with earlier versions of VirtualBox, the “convertdd” command is also supported and mapped internally to the “convertfromraw” command.
'''Here is a quick example of an actual conversion'''


LD_LIBRARY_PATH=/opt/VirtualBox* ./vditool SHRINK new-file.vdi  
  '''tony@ubuntu:~$ sudo apt-get install qemu
  '''[sudo] password for tony:
  '''Reading package lists... Done
  '''Building dependency tree     
  '''Reading state information... Done
  '''The following packages were automatically installed and are no longer required:
  '''linux-headers-2.6.32-24 linux-headers-2.6.32-24-generic
  '''Use 'apt-get autoremove' to remove them.
  '''The following extra packages will be installed:
  '''bridge-utils libaio1 qemu-common qemu-kvm seabios vgabios
  '''Suggested packages:
  '''mol-drivers-macosx openbios-sparc kvm-pxe ubuntu-vm-builder uml-utilities
  '''The following NEW packages will be installed:
  '''bridge-utils libaio1 qemu qemu-common qemu-kvm seabios vgabios
  '''0 upgraded, 7 newly installed, 0 to remove and 0 not upgraded.
  '''Need to get 2,769kB of archives.
  '''After this operation, 8,192kB of additional disk space will be used.
  '''Do you want to continue [Y/n]? Y
  '''Get:1 http://us.archive.ubuntu.com/ubuntu/ lucid/main bridge-utils 1.4-5ubuntu2 [32.6kB]
  '''Get:2 http://us.archive.ubuntu.com/ubuntu/ lucid/main libaio1 0.3.107-3ubuntu2 [9,512B]
  '''Get:3 http://us.archive.ubuntu.com/ubuntu/ lucid/main seabios 0.5.1-0ubuntu2 [48.2kB]
  '''Get:4 http://us.archive.ubuntu.com/ubuntu/ lucid/main vgabios 0.6c-2ubuntu1 [78.5kB]
  '''Get:5 http://us.archive.ubuntu.com/ubuntu/ lucid-updates/main qemu-common 0.12.3+noroms-0ubuntu9.2 [30.1kB]
  '''Get:6 http://us.archive.ubuntu.com/ubuntu/ lucid-updates/main qemu-kvm 0.12.3+noroms-0ubuntu9.2 [2,556kB]
  '''Get:7 http://us.archive.ubuntu.com/ubuntu/ lucid-updates/universe qemu 0.12.3+noroms-0ubuntu9.2 [3.9kB]                   
  '''Fetched 2,769kB in 17s(156kB/s)                                                                                           
  '''Selecting previously deselected package bridge-utils.
  '''(Reading database ... 148121 files and directories currently installed.)
  '''Unpacking bridge-utils (from .../bridge-utils_1.4-5ubuntu2_i386.deb) ...
  '''Selecting previously deselected package libaio1.
  '''Unpacking libaio1 (from .../libaio1_0.3.107-3ubuntu2_i386.deb) ...
  '''Selecting previously deselected package seabios.
  '''Unpacking seabios (from .../seabios_0.5.1-0ubuntu2_all.deb) ...
  '''Selecting previously deselected package vgabios.
  '''Unpacking vgabios (from .../vgabios_0.6c-2ubuntu1_all.deb) ...
  '''Selecting previously deselected package qemu-common.
  '''Unpacking qemu-common (from .../qemu-common_0.12.3+noroms-0ubuntu9.2_all.deb) ...
  '''Selecting previously deselected package qemu-kvm.
  '''Unpacking qemu-kvm (from .../qemu-kvm_0.12.3+noroms-0ubuntu9.2_i386.deb) ...
  '''Selecting previously deselected package qemu.
  '''Unpacking qemu (from .../qemu_0.12.3+noroms-0ubuntu9.2_i386.deb) ...
  '''Processing triggers for ureadahead ...
  '''Processing triggers for man-db ...
  '''Setting up bridge-utils (1.4-5ubuntu2) ...
  '''Setting up libaio1 (0.3.107-3ubuntu2) ...
  '''Setting up seabios (0.5.1-0ubuntu2) ...
  '''Setting up vgabios (0.6c-2ubuntu1) ...
  '''Setting up qemu-common (0.12.3+noroms-0ubuntu9.2) ...
  '''Setting up qemu-kvm (0.12.3+noroms-0ubuntu9.2) ...
  '''qemu-kvm start/running
  '''Setting up qemu (0.12.3+noroms-0ubuntu9.2) ...
  '''Processing triggers for libc-bin ...
  '''ldconfig deferred processing now taking place
  '''tony@ubuntu:~$ su
  '''Password:
  '''root@ubuntu:/home/tony# cd /tmp/Ubuntu_VMware
  '''root@ubuntu:/tmp/Ubuntu_VMware# qemu-img convert Ubuntu_VMware.vmdk /tmp/Ubuntu_VMware.bin'''
  '''root@ubuntu:/tmp/Ubuntu_VMware# VBoxManage convertfromraw /tmp/Ubuntu_VMware.bin /tmp/Ubuntu_VBox/Ubuntu_VBox.vdi
  '''The program 'VBoxManage' is currently not installed.  You can install it by typing:
  '''apt-get install virtualbox-ose
  '''root@ubuntu:/tmp/Ubuntu_VMware# apt-get install virtualbox-ose
  '''Reading package lists... Done
  '''Building dependency tree     
  '''Reading state information... Done
  '''The following extra packages will be installed:
  '''dkms libaudio2 libmng1 libqt4-network libqt4-opengl libqtcore4 libqtgui4 virtualbox-ose-dkms virtualbox-ose-qt
  '''Suggested packages:
  '''nas qt4-qtconfig virtualbox-guest-additions
  '''The following NEW packages will be installed:
  '''dkms libaudio2 libmng1 libqt4-network libqt4-opengl libqtcore4 libqtgui4 virtualbox-ose virtualbox-ose-dkms
  '''virtualbox-ose-qt
  '''0 upgraded, 10 newly installed, 0 to remove and 0 not upgraded.
  '''Need to get 20.2MB of archives.
  '''After this operation, 70.4MB of additional disk space will be used.
  '''Do you want to continue [Y/n]? Y
  '''Get:1 http://us.archive.ubuntu.com/ubuntu/ lucid/main dkms 2.1.1.2-2fakesync1 [70.1kB]
  '''Get:2 http://us.archive.ubuntu.com/ubuntu/ lucid/main libaudio2 1.9.2-3 [81.0kB]
  '''Get:3 http://us.archive.ubuntu.com/ubuntu/ lucid/main libmng1 1.0.9-1ubuntu1 [209kB]
  '''Get:4 http://us.archive.ubuntu.com/ubuntu/ lucid-updates/main libqtcore4 4:4.6.2-0ubuntu5.1 [1,722kB]
  '''Get:5 http://us.archive.ubuntu.com/ubuntu/ lucid-updates/main libqt4-network 4:4.6.2-0ubuntu5.1 [444kB]                     
  '''Get:6 http://us.archive.ubuntu.com/ubuntu/ lucid-updates/main libqtgui4 4:4.6.2-0ubuntu5.1 [4,010kB]                       
  '''Get:7 http://us.archive.ubuntu.com/ubuntu/ lucid-updates/main libqt4-opengl 4:4.6.2-0ubuntu5.1 [265kB]                     
  '''Get:8 http://us.archive.ubuntu.com/ubuntu/ lucid/universe virtualbox-ose 3.1.6-dfsg-2ubuntu2 [8,265kB]                     
  '''Get:9 http://us.archive.ubuntu.com/ubuntu/ lucid/universe virtualbox-ose-dkms 3.1.6-dfsg-2ubuntu2 [501kB]                   
  '''Get:10 http://us.archive.ubuntu.com/ubuntu/ lucid/universe virtualbox-ose-qt 3.1.6-dfsg-2ubuntu2 [4,678kB]                 
  '''Fetched 20.2MB in 2min 3s (164kB/s)                                                                                         
  '''Selecting previously deselected package dkms.
  '''(Reading database ... 148269 files and directories currently installed.)
  '''Unpacking dkms (from .../dkms_2.1.1.2-2fakesync1_all.deb) ...
  '''Selecting previously deselected package libaudio2.
  '''Unpacking libaudio2 (from .../libaudio2_1.9.2-3_i386.deb) ...
  '''Selecting previously deselected package libmng1.
  '''Unpacking libmng1 (from .../libmng1_1.0.9-1ubuntu1_i386.deb) ...
  '''Selecting previously deselected package libqtcore4.
  '''Unpacking libqtcore4 (from .../libqtcore4_4%3a4.6.2-0ubuntu5.1_i386.deb) ...
  '''Selecting previously deselected package libqt4-network.
  '''Unpacking libqt4-network (from .../libqt4-network_4%3a4.6.2-0ubuntu5.1_i386.deb) ...
  '''Selecting previously deselected package libqtgui4.
  '''Unpacking libqtgui4 (from .../libqtgui4_4%3a4.6.2-0ubuntu5.1_i386.deb) ...
  '''Selecting previously deselected package libqt4-opengl.
  '''Unpacking libqt4-opengl (from .../libqt4-opengl_4%3a4.6.2-0ubuntu5.1_i386.deb) ...
  '''Selecting previously deselected package virtualbox-ose.
  '''Unpacking virtualbox-ose (from .../virtualbox-ose_3.1.6-dfsg-2ubuntu2_i386.deb) ...
  '''Selecting previously deselected package virtualbox-ose-dkms.
  '''Unpacking virtualbox-ose-dkms (from .../virtualbox-ose-dkms_3.1.6-dfsg-2ubuntu2_all.deb) ...
  '''Selecting previously deselected package virtualbox-ose-qt.
  '''Unpacking virtualbox-ose-qt (from .../virtualbox-ose-qt_3.1.6-dfsg-2ubuntu2_i386.deb) ...
  '''Processing triggers for man-db ...
  '''Processing triggers for ureadahead ...
  '''Processing triggers for desktop-file-utils ...
  '''Processing triggers for python-gmenu ...
  '''Rebuilding /usr/share/applications/desktop.en_US.utf8.cache...
  '''Processing triggers for python-support ...
  '''Setting up dkms (2.1.1.2-2fakesync1) ...
  '''Setting up libaudio2 (1.9.2-3) ...
  '''Setting up libmng1 (1.0.9-1ubuntu1) ...
  '''Setting up libqtcore4 (4:4.6.2-0ubuntu5.1) ...
  '''Setting up libqt4-network (4:4.6.2-0ubuntu5.1) ...
  '''Setting up libqtgui4 (4:4.6.2-0ubuntu5.1) ...
  '''Setting up libqt4-opengl (4:4.6.2-0ubuntu5.1) ...
  '''Setting up virtualbox-ose (3.1.6-dfsg-2ubuntu2) ...
  ''' * Stopping VirtualBox kernel modules                                                                    [ OK ]
  ''' * StartingVirtualBoxkernelModules                                                                                           
  ''' * No suitable module for running kernel found                                                          [fail]
  '''invoke-rc.d: initscript virtualbox-ose, action "restart" failed.
  '''Setting up virtualbox-ose-dkms (3.1.6-dfsg-2ubuntu2) ...
  '''Loading new virtualbox-ose-3.1.6 DKMS files...
  '''First Installation: checking all kernels...
  '''Building only for 2.6.32-25-generic
  '''Building for architecture i686
  '''Building initial module for 2.6.32-25-generic Done.
  '''vboxdrv.ko: Running module version sanity check.
  '''- Original module
      '''- No original module exists within this kernel
    '''- Installation
      '''- Installing to /lib/modules/2.6.32-25-generic/updates/dkms/
  '''vboxnetadp.ko: Running module version sanity check.
    '''- Original module
      '''- No original module exists within this kernel
    '''- Installation
      '''- Installing to /lib/modules/2.6.32-25-generic/updates/dkms/
  '''vboxnetflt.ko: Running module version sanity check.
    '''- Original module
      '''- No original module exists within this kernel
    '''- Installation
      '''- Installing to /lib/modules/2.6.32-25-generic/updates/dkms/depmod..............
  '''DKMS: install Completed.
    '''* Stopping VirtualBox kernel modules                                                                                  [ OK ]
    '''* Starting VirtualBox kernel modules                                                                                  [ OK ]
  '''Processing triggers for python-central ...
  '''Setting up virtualbox-ose-qt (3.1.6-dfsg-2ubuntu2) ...
  '''Processing triggers for libc-bin ...
  '''ldconfig deferred processing now taking place
  '''root@ubuntu:/tmp/Ubuntu_VMware# VBoxManage convertfromraw /tmp/Ubuntu_VMware.bin /tmp/Ubuntu_VBox/Ubuntu_VBox.vdi
  '''Sun VirtualBox Command Line Management Interface Version 3.1.6_OSE(C) 2005-2010 Sun Microsystems, Inc. All rights reserved.
  '''Converting from raw image file="/tmp/Ubuntu_VMware.bin" to file="/tmp/Ubuntu_VBox/Ubuntu_VBox.vdi"...
  '''Creating dynamic image with size 17179869184 bytes (16384MB)...
  '''root@ubuntu:/tmp/Ubuntu_VMware#


Now we’re all setted up. Let’s run Virtual Box. At this point, you have to create a new Virtual Machine, set it up as you like and choose the new-file.dvi as disc image. If everything is okay, the machine will run, even if it will have to be settep up again a bit from inside the OS you’re using. For example, Windows has got a lot of problems in this part.  
Run VirtualBox, use the (File Menu) Virtual Media Manager and 'Add' the newly cloned drive. This makes Virtual Box 'aware' of the drive. Then go though the normal creation steps and choose this as the drive to use for the virtual machine.


When I started my old disc image converte into a new compressed .vdi file inside a new Virtual Machine created with VBox, WinXP refused to start. I had to insert in the CD-Rom my original WinXP Cd to boot from cd and restore the windows installation! Windows, this way, reconfigured and installed each new virtual peripheral so that at reboot everything was okay and all my programs where left installed where they were.  
You should be able to boot up the newly created virtual machine.


Multiple vmdk files to vdi
Enjoy your migration to Virtual Box!


A lot of people have been asking me about this. I sincerely didn’t have a clue on how to convert multiple vmdk vmware virtual disc images into a vdi VB virtual disc image. Luckily, Leonardo Cosmai just provided us with a solution in one of the comments on this post! You can see that post for yourself.


What you have to do is:


1) Downloading and installing VMWare Server for your platform, it is freeware but proprietay software, it is opensourced but you’ll need to subscribe for a license to use it. We’ll just use this to convert multiplevmdk images into a single one. You can find VMWare Server here.
Refrences:


2) Run a terminal, move in the dir where you store your multiple vmdk disc images and run:  
http://thedarkmaster.wordpress.com/2007/03/12/vmware-virtual-machine-to-virtual-box-conversion-how-to/


vmware-vdiskmanager -r source_multiples.vmdk -t 2 single_file.vmdk
https://wiki.ubuntu.com/UbuntuMagazine/HowTo/Switching_From_VMWare_To_VirtualBox:_.vmdk_To_.vdi_Using_Qemu_+_VdiTool


And that’s all! The multiple vmdk images will be converted into one single vmdk image file. At that point you’ll be able to normally use this guide to convert the newly obtained vmdk disc image into a single .vdi file!
http://www.cyberciti.biz/tips/converting-from-vmware-images-to-virtualbox-images.html#comments


I sincerely hope this helped a lot of people out there. It is almost impossible to find a way to use vditool in Google for now. No matter how much you google, I spent the all day trying to find something. Thanks to the guys from the VBox IRC Channel for helping me out, I wasn’t going to get out from this problem alone. And a lot of people in Ubuntu Forum where in my same conditions, so…. Enjoy your migration to Virtual Box!
http://download.virtualbox.org/virtualbox/UserManual.pdf

Latest revision as of 17:16, 7 December 2010

If you want to switch to VirtualBox and have a Vmware Virtual Machine you want to use? You can convert a Vmware .vmdk file into a VirtualBox .vdi file that you can use on VirtualBox.

First, download qemu, open a Console and execute:

  sudo apt-get install qemu 

Next, open a console and go to your .vmdk virtual disc image folder and type this:

  qemu-img convert "harddrive-name".vmdk /filelocation/"harddrive-name".bin 

Change "harddrive-name" with the name of your .vmdk file and raw-file with the name of the new converted file you want to create. This takes a few minutes, After the conversion is completed. A raw hard disk image has been created.

To convert a raw disk image to a VirtualBox Disk Image (.vdi) file use this command.

The syntax is as follows:

  VBoxManage convertfromraw /filelocation/"harddrive-name".bin <outputfile>

Example:

  sudo VBoxManage convertfromraw /home/tony/.VirtualBox/HardDisks/HardDisk1.bin /home/tony/.VirtualBox 

[--format VDI|VMDK|VHD]

[--variant Standard,Fixed,Split2G,Stream,ESX]

  VBoxManage convertfromraw stdin <outputfile> <bytes>

[--format VDI|VMDK|VHD]

[--variant Standard,Fixed,Split2G,Stream,ESX]


What the parameters mean:

format - Selects the disk image format to create. Default is .vdi.

variant - Allows to choose a file format variant for the output file. It is a comma-separated list of variant flags. Not all combinations are supported, and specifying inconsistent flags will result in an error message.


The second form forces VBoxManage to read the content for the disk image from standard input(useful for using that command in a pipe).


Note: For compatibility with earlier versions of VirtualBox, the “convertdd” command is also supported and mapped internally to the “convertfromraw” command.

Here is a quick example of an actual conversion

  tony@ubuntu:~$ sudo apt-get install qemu 
  [sudo] password for tony:
  Reading package lists... Done
  Building dependency tree       
  Reading state information... Done
  The following packages were automatically installed and are no longer required:
  linux-headers-2.6.32-24 linux-headers-2.6.32-24-generic
  Use 'apt-get autoremove' to remove them.
  The following extra packages will be installed:
  bridge-utils libaio1 qemu-common qemu-kvm seabios vgabios
  Suggested packages:
  mol-drivers-macosx openbios-sparc kvm-pxe ubuntu-vm-builder uml-utilities
  The following NEW packages will be installed:
  bridge-utils libaio1 qemu qemu-common qemu-kvm seabios vgabios
  0 upgraded, 7 newly installed, 0 to remove and 0 not upgraded.
  Need to get 2,769kB of archives.
  After this operation, 8,192kB of additional disk space will be used.
  Do you want to continue [Y/n]? Y
  Get:1 http://us.archive.ubuntu.com/ubuntu/ lucid/main bridge-utils 1.4-5ubuntu2 [32.6kB]
  Get:2 http://us.archive.ubuntu.com/ubuntu/ lucid/main libaio1 0.3.107-3ubuntu2 [9,512B]
  Get:3 http://us.archive.ubuntu.com/ubuntu/ lucid/main seabios 0.5.1-0ubuntu2 [48.2kB]
  Get:4 http://us.archive.ubuntu.com/ubuntu/ lucid/main vgabios 0.6c-2ubuntu1 [78.5kB]
  Get:5 http://us.archive.ubuntu.com/ubuntu/ lucid-updates/main qemu-common 0.12.3+noroms-0ubuntu9.2 [30.1kB]
  Get:6 http://us.archive.ubuntu.com/ubuntu/ lucid-updates/main qemu-kvm 0.12.3+noroms-0ubuntu9.2 [2,556kB]
  Get:7 http://us.archive.ubuntu.com/ubuntu/ lucid-updates/universe qemu 0.12.3+noroms-0ubuntu9.2 [3.9kB]                     
  Fetched 2,769kB in 17s(156kB/s)                                                                                             
  Selecting previously deselected package bridge-utils.
  (Reading database ... 148121 files and directories currently installed.)
  Unpacking bridge-utils (from .../bridge-utils_1.4-5ubuntu2_i386.deb) ...
  Selecting previously deselected package libaio1.
  Unpacking libaio1 (from .../libaio1_0.3.107-3ubuntu2_i386.deb) ...
  Selecting previously deselected package seabios.
  Unpacking seabios (from .../seabios_0.5.1-0ubuntu2_all.deb) ...
  Selecting previously deselected package vgabios.
  Unpacking vgabios (from .../vgabios_0.6c-2ubuntu1_all.deb) ...
  Selecting previously deselected package qemu-common.
  Unpacking qemu-common (from .../qemu-common_0.12.3+noroms-0ubuntu9.2_all.deb) ...
  Selecting previously deselected package qemu-kvm.
  Unpacking qemu-kvm (from .../qemu-kvm_0.12.3+noroms-0ubuntu9.2_i386.deb) ...
  Selecting previously deselected package qemu.
  Unpacking qemu (from .../qemu_0.12.3+noroms-0ubuntu9.2_i386.deb) ...
  Processing triggers for ureadahead ...
  Processing triggers for man-db ...
  Setting up bridge-utils (1.4-5ubuntu2) ...
  Setting up libaio1 (0.3.107-3ubuntu2) ...
  Setting up seabios (0.5.1-0ubuntu2) ...
  Setting up vgabios (0.6c-2ubuntu1) ...
  Setting up qemu-common (0.12.3+noroms-0ubuntu9.2) ...
  Setting up qemu-kvm (0.12.3+noroms-0ubuntu9.2) ...
  qemu-kvm start/running
  Setting up qemu (0.12.3+noroms-0ubuntu9.2) ...
  Processing triggers for libc-bin ...
  ldconfig deferred processing now taking place
  tony@ubuntu:~$ su
  Password: 
  root@ubuntu:/home/tony# cd /tmp/Ubuntu_VMware
  root@ubuntu:/tmp/Ubuntu_VMware# qemu-img convert Ubuntu_VMware.vmdk /tmp/Ubuntu_VMware.bin
  root@ubuntu:/tmp/Ubuntu_VMware# VBoxManage convertfromraw /tmp/Ubuntu_VMware.bin /tmp/Ubuntu_VBox/Ubuntu_VBox.vdi
  The program 'VBoxManage' is currently not installed.  You can install it by typing:
  apt-get install virtualbox-ose
  root@ubuntu:/tmp/Ubuntu_VMware# apt-get install virtualbox-ose
  Reading package lists... Done
  Building dependency tree       
  Reading state information... Done
  The following extra packages will be installed:
  dkms libaudio2 libmng1 libqt4-network libqt4-opengl libqtcore4 libqtgui4 virtualbox-ose-dkms virtualbox-ose-qt
  Suggested packages:
  nas qt4-qtconfig virtualbox-guest-additions
  The following NEW packages will be installed:
  dkms libaudio2 libmng1 libqt4-network libqt4-opengl libqtcore4 libqtgui4 virtualbox-ose virtualbox-ose-dkms
  virtualbox-ose-qt
  0 upgraded, 10 newly installed, 0 to remove and 0 not upgraded.
  Need to get 20.2MB of archives.
  After this operation, 70.4MB of additional disk space will be used.
  Do you want to continue [Y/n]? Y
  Get:1 http://us.archive.ubuntu.com/ubuntu/ lucid/main dkms 2.1.1.2-2fakesync1 [70.1kB]
  Get:2 http://us.archive.ubuntu.com/ubuntu/ lucid/main libaudio2 1.9.2-3 [81.0kB]
  Get:3 http://us.archive.ubuntu.com/ubuntu/ lucid/main libmng1 1.0.9-1ubuntu1 [209kB]
  Get:4 http://us.archive.ubuntu.com/ubuntu/ lucid-updates/main libqtcore4 4:4.6.2-0ubuntu5.1 [1,722kB]
  Get:5 http://us.archive.ubuntu.com/ubuntu/ lucid-updates/main libqt4-network 4:4.6.2-0ubuntu5.1 [444kB]                      
  Get:6 http://us.archive.ubuntu.com/ubuntu/ lucid-updates/main libqtgui4 4:4.6.2-0ubuntu5.1 [4,010kB]                         
  Get:7 http://us.archive.ubuntu.com/ubuntu/ lucid-updates/main libqt4-opengl 4:4.6.2-0ubuntu5.1 [265kB]                       
  Get:8 http://us.archive.ubuntu.com/ubuntu/ lucid/universe virtualbox-ose 3.1.6-dfsg-2ubuntu2 [8,265kB]                       
  Get:9 http://us.archive.ubuntu.com/ubuntu/ lucid/universe virtualbox-ose-dkms 3.1.6-dfsg-2ubuntu2 [501kB]                    
  Get:10 http://us.archive.ubuntu.com/ubuntu/ lucid/universe virtualbox-ose-qt 3.1.6-dfsg-2ubuntu2 [4,678kB]                   
  Fetched 20.2MB in 2min 3s (164kB/s)                                                                                          
  Selecting previously deselected package dkms.
  (Reading database ... 148269 files and directories currently installed.)
  Unpacking dkms (from .../dkms_2.1.1.2-2fakesync1_all.deb) ...
  Selecting previously deselected package libaudio2.
  Unpacking libaudio2 (from .../libaudio2_1.9.2-3_i386.deb) ...
  Selecting previously deselected package libmng1.
  Unpacking libmng1 (from .../libmng1_1.0.9-1ubuntu1_i386.deb) ...
  Selecting previously deselected package libqtcore4.
  Unpacking libqtcore4 (from .../libqtcore4_4%3a4.6.2-0ubuntu5.1_i386.deb) ...
  Selecting previously deselected package libqt4-network.
  Unpacking libqt4-network (from .../libqt4-network_4%3a4.6.2-0ubuntu5.1_i386.deb) ...
  Selecting previously deselected package libqtgui4.
  Unpacking libqtgui4 (from .../libqtgui4_4%3a4.6.2-0ubuntu5.1_i386.deb) ...
  Selecting previously deselected package libqt4-opengl.
  Unpacking libqt4-opengl (from .../libqt4-opengl_4%3a4.6.2-0ubuntu5.1_i386.deb) ...
  Selecting previously deselected package virtualbox-ose.
  Unpacking virtualbox-ose (from .../virtualbox-ose_3.1.6-dfsg-2ubuntu2_i386.deb) ...
  Selecting previously deselected package virtualbox-ose-dkms.
  Unpacking virtualbox-ose-dkms (from .../virtualbox-ose-dkms_3.1.6-dfsg-2ubuntu2_all.deb) ...
  Selecting previously deselected package virtualbox-ose-qt.
  Unpacking virtualbox-ose-qt (from .../virtualbox-ose-qt_3.1.6-dfsg-2ubuntu2_i386.deb) ...
  Processing triggers for man-db ...
  Processing triggers for ureadahead ...
  Processing triggers for desktop-file-utils ...
  Processing triggers for python-gmenu ... 
  Rebuilding /usr/share/applications/desktop.en_US.utf8.cache...
  Processing triggers for python-support ...
  Setting up dkms (2.1.1.2-2fakesync1) ...
  Setting up libaudio2 (1.9.2-3) ...
  Setting up libmng1 (1.0.9-1ubuntu1) ...
  Setting up libqtcore4 (4:4.6.2-0ubuntu5.1) ...
  Setting up libqt4-network (4:4.6.2-0ubuntu5.1) ...
  Setting up libqtgui4 (4:4.6.2-0ubuntu5.1) ...
  Setting up libqt4-opengl (4:4.6.2-0ubuntu5.1) ...
  Setting up virtualbox-ose (3.1.6-dfsg-2ubuntu2) ...
   * Stopping VirtualBox kernel modules                                                                    [ OK ]
   * StartingVirtualBoxkernelModules                                                                                            
   * No suitable module for running kernel found                                                           [fail]
  invoke-rc.d: initscript virtualbox-ose, action "restart" failed.
  Setting up virtualbox-ose-dkms (3.1.6-dfsg-2ubuntu2) ...
  Loading new virtualbox-ose-3.1.6 DKMS files...
  First Installation: checking all kernels...
  Building only for 2.6.32-25-generic
  Building for architecture i686
  Building initial module for 2.6.32-25-generic Done.
  vboxdrv.ko: Running module version sanity check.
  - Original module
     - No original module exists within this kernel
   - Installation
     - Installing to /lib/modules/2.6.32-25-generic/updates/dkms/
  vboxnetadp.ko: Running module version sanity check.
   - Original module
     - No original module exists within this kernel
   - Installation
     - Installing to /lib/modules/2.6.32-25-generic/updates/dkms/
  vboxnetflt.ko: Running module version sanity check.
   - Original module
     - No original module exists within this kernel
   - Installation
     - Installing to /lib/modules/2.6.32-25-generic/updates/dkms/depmod..............
  DKMS: install Completed.
   * Stopping VirtualBox kernel modules                                                                                  [ OK ] 
   * Starting VirtualBox kernel modules                                                                                  [ OK ] 
  Processing triggers for python-central ...
  Setting up virtualbox-ose-qt (3.1.6-dfsg-2ubuntu2) ...
  Processing triggers for libc-bin ...
  ldconfig deferred processing now taking place
  root@ubuntu:/tmp/Ubuntu_VMware# VBoxManage convertfromraw /tmp/Ubuntu_VMware.bin /tmp/Ubuntu_VBox/Ubuntu_VBox.vdi
  Sun VirtualBox Command Line Management Interface Version 3.1.6_OSE(C) 2005-2010 Sun Microsystems, Inc. All rights reserved.
  Converting from raw image file="/tmp/Ubuntu_VMware.bin" to file="/tmp/Ubuntu_VBox/Ubuntu_VBox.vdi"...
  Creating dynamic image with size 17179869184 bytes (16384MB)...
  root@ubuntu:/tmp/Ubuntu_VMware# 

Run VirtualBox, use the (File Menu) Virtual Media Manager and 'Add' the newly cloned drive. This makes Virtual Box 'aware' of the drive. Then go though the normal creation steps and choose this as the drive to use for the virtual machine.

You should be able to boot up the newly created virtual machine.

Enjoy your migration to Virtual Box!


Refrences:

http://thedarkmaster.wordpress.com/2007/03/12/vmware-virtual-machine-to-virtual-box-conversion-how-to/

https://wiki.ubuntu.com/UbuntuMagazine/HowTo/Switching_From_VMWare_To_VirtualBox:_.vmdk_To_.vdi_Using_Qemu_+_VdiTool

http://www.cyberciti.biz/tips/converting-from-vmware-images-to-virtualbox-images.html#comments

http://download.virtualbox.org/virtualbox/UserManual.pdf