vmwaretovirtualbox.png

Introduction

VirtualBox is a free and OpenSource alternative to VMWare. A reasonable alternative! It is much more convenient than QEmu (Another OpenSource Virtualizer) for several reasons:

In this Guide I assume you know about Virtualizers and are actually using VMware Player, which is a free tool but not OpenSource Software. So, why is VirtualBox better than VMWare Player for you?

And Why would you prefer VMWare Player over VirtualBox?

So you like Virtual Box and want to switch to this wonderful Open Source software, but you already have a VMWare Virtual Machine you often use? Don’t worry, it is tricky but you can convert a VMWare virtual machine into one that will work on Virtual Box. How convenient is this conversion? Read my next post about How to Install Virtual Box and why you should do it.

Installing Virtual Box

Download Virtual Box for your Linux System here: http://www.virtualbox.org/wiki/Downloads Let's see the steps we need to install Virtual Box on Ubuntu Feisty / Edgy

vboxterminal.png

This will open the Users and Groups settings window, after you enter the system password.

vboxpermission2.jpg

Select your username, then click on the Manage Groups button. A new window will appear:

vboxpermission3.jpg

In this window select the vboxusers group from the list, and click on the "properties" button. In the following vboxusers properties window, add your username to the "Group Members" by selecting the tick-box next to your username. Click OK, exit all the menus and restart the PC. You are now a member of the vboxusers group.

Running Virtual Box

Now VirtualBox is installed and fixed, find it into the menù: Applications—>System Tools—>InnoTek VirtualBox. VirtualBox will run and you'll see the following screen:

vboxscreen1.png

Converting your existing .vmdk Virtual Disc Image To a .vdi File

NOTE: If you are converting a disk-image which contains a Windows installation, first follow the steps at http://www.virtualbox.org/wiki/Migrate_Windows

Now we need to convert your existing VMWare disc image into a format readable by VirtualBox. Don't worry, you won't lose any data but, just in case, you can always create a backup copy of your VirtualDisk before we start!

NOTE: If you have multiple vmdk-files like "vm.vmdk, vm-flat.vmdk, vm-0001.vmdk", you have to reorganize your .vmdk-files with: vmware-vdiskmanager -r vm.vmdk -t 0 hardrive-name.vmdk

Naturally, you’ll have to 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. After a few minutes, the conversion will be completed. Now we’ve got a raw hard disk image and we want to transform it into a .vdi file!

NOTE: The commands under "Notes for AMD64 users" below work for Ubuntu 8.04 Hardy 32 bit and are much easier than downloading the same file again. Please try that first.

NOTE: To download vditool using a web browser, 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 using the download manager "Aria", which is in the Ubuntu repositories.

executable.png

<< UPDATE - Feb 2009 - if vditool is already installed by VirtualBox, run this command instead:

Warning /!\ VBoxManage convertdd old-file.bin new-file.vdi is the right way to do this now. Note that the old source file is first and the new destination file is second -- if you do it backwards, VBoxManage will complain: File="new-file.vdi" open error: File not found.

Where new-file.vdi is the file that will be outputted by vditool 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 these invented names for real ones.

NOTE: 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.

Notes for AMD64 users. The vditool executable above only works on 32 bit systems. If you have a 64bit system then use the "vditool" image and library path from your existing VirtualBox installation. The following commands suit an AMD64 system running Ubuntu 7.10:

(These commands should actually work on both 32bit and 64bit systems).

Multiple vmdk files to single vdi

The problem is simple. Very often, maybe due to Fat32 partition limits, people split their VMWare disc images into multiple files. So how do you convert multiple .vmdk files into a single .vdi file for Virtual Box?

What you have to do is:

NOTE: You can simply download the vmware server binary tar.gz distribution, extract the archive and copy the vmware-vdiskmanager utility from the bin folder instead of installing vmware server.

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 use this guide as normal to convert the newly obtained vmdk disc image into a single .vdi file!

Creating a new VirtualMachine

Just click on the "New" button on the upper left side of the window:

vboxscreen2.png

Now you can follow the Wizard.

vboxscreen3.png

Here are the guided steps:

vboxscreen4.png

vboxscreen5.png

vboxscreen6.png

Running and setting up your new Virtual Machine

The Machine has been created but we need to set it UP a bit. Some very quick and simple steps:

When I started my old disc image converted 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 of my original WinXP CD, boot from CD and restore the windows installation! Windows reconfigured and installed each new virtual peripheral so that at reboot everything was okay and all my programs were left installed in their original locations.

Conclusions

VirtualBox is a wonderful Virtualization Tool, but you'll probably want some more information about it, since this is not intended as a user guide. Read the entire manual (linked to in the above Chapter) and also have a look at this page in the VirtualBox Website for interesting information about Network, Sharing Files between guest and host OSes and much more: http://www.virtualbox.org/wiki/User_HOWTOS

UbuntuMagazine/HowTo/Switching_From_VMWare_To_VirtualBox:_.vmdk_To_.vdi_Using_Qemu_+_VdiTool (last edited 2009-11-03 15:22:04 by emt200-31-198-34)