Friday Jun 04, 2010

Migrating from VMware to VirtualBox (Part 2): Windows

In part 1 of this mini-series about how to move from VMware to VirtualBox we described how to move an Oracle Enterprise Linux vm. In this instalment we'll look at moving a Windows XP vm. It's worth noting that the same basic process will be followed:

  1. Pre-migration tasks - uninstall VMware tools and drivers
  2. Export from VMware - we'll use OVF as the mechanism to transfer the disk and vm configuration
  3. Import to VirtualBox - the VirtualBox import wizard makes this very easy;
  4. Post-migration tasks - finally we'll install the VirtualBox Guest Additions (analogous to VMware tools) 

OK so here is our starting point: A Windows XP vm running inside VMware Workstation 7.1:

VMware Workstation

Pre-Migration Tasks

Uninstalling VMware Tools is straightforward in Windows by choosing Add/Remove Programs in the Windows Control Panel and clicking on Remove:

Uninstall VMware Tools

Once you have removed VMware Tools you can shutdown Windows and Close the VM.

Export from VMware 

From the VMware Workstation File... menu we can now Export the vm:

Export

In the Conversion Wizard, the Source type should be "Other" because this is a Workstation vm:

Source Type

...and select the VMware vmx configuration file:

Select the vmx file

At this point, the Conversion Wizard warned me that it cannot configure the source image, but this can be safely ignored:

Warning

 ...and you can continue selecting which disks to export:

Disks

 When we reach the point in the Conversion Wizard where we select the destination type, we should choose "Virtual Appliance":

Virtual Appliance

...before choosing the filesystem location for the exported appliance. Here, I am just calling it "MyXPPC" and dropping it on my Desktop:

Name of destination appliance

If required you can describe a few more details about this virtual appliance:

Appliance details

 ...before choosing how to package the appliance. Here I chose a "Folder of Files" and did not create a manifest file, which is a digest or checksum file. (With Workstation 7.1 and VirtualBox 3.2 there seems to be a disagreement on the SHA1 digest so we're not using one here).

Packaging choices

The network dialog is the last stage:

Network

Then we confirm our selections and the export process starts: 

Exporting...

This time it takes to complete this stage is a function of the size of your disk but can take some time. But on completion you have a folder which contains:

  • .ovf file - an XML description of the vm (e.g. number of CPUs, amount of RAM, etc.)
  • .vmdk - a Compressed VMDK file containing the contents of the vm's hard drive(s)

 Here are the results of my export process:

Folder of files

Importing into VirtualBox

Having exported the vm we can now import it into VirtualBox. BTW you can move this vm onto a totally different physical machine at this point, but I'm going to simply pull it into VirtualBox on the same Windows 7 host.

So close VMware Workstation and start up VirtualBox, and from the File menu choose Import Appliance:

Import Appliance...

The VirtualBox Appliance Import Wizard will ask you to choose the appliance (.ovf file) you want to import, so let's select MyXPPC.ovf:

Choose appliance

The wizard reads the ovf data and shows the settings it is about to use. At this point you can modify the settings by double clicking on a value.

Now this is an important bit....For me, the Guest OS Type was set to "Other/Unknown" but we need to set it to "Windows XP": (for the experts: this instructs VirtualBox to turn on IO-APIC) 

Windows XP guest type

So here are my final settings:

Import settings

Clicking on Finish starts the Import process:

Importing...

Again, the time this takes depends on your vm's disk size but at the ned of the import process you will have a vm in the VirtualBox GUI window with the name of the appliance, in our case "MyXPPC":

VirtualBox GUI

Post-Migration Tasks

 If you start up the vm at this point you'll see something like this:

VirtualBox without Additions

But for best results you now need to install the Guest Additions. To do this, choose Device...Install Guest Additions:

Install Guest Additions

And follow your nose:

Guest Additions

After installing the Guest Additions you will need to reboot:

Reboot after Guest Additions

 But after you've done this you have a fully migrated Windows XP vm!

Windows XP running under VirtualBox

Easy, right? 


Epilogue (Advanced users only)

For those people who read to the end of a blog before jumping in, here's a bonus ;-).... 

There is a faster alternative to step 2 and 3 above for people who know what they are doing.

After performing Step 1 you could simply take the VMware disk image (.vmdk) and plug this into an appropriately configured VirtualBox vm. This effectively relies on the user creating a vm which is similar to the vm configuration in VMware, instead of relying on the ovf export and import (Steps 2 and 3 above) process.

To take this shortcut:

Create a New vm in VirtualBox for Windows XP:

new VM

When you asked about a Virtual Hard Disk, tell the Wizard that you want to use an existing disk and specify the original VMware vmdk by clicking on the folder icon and adding it to the Virtual Media registry:

Existing Disk

Before you turn this vm on, be sure to change a setting in the System...MotherBoard tab, to enable IO APIC:

IO-APIC

Now start up the VM. Don't forget to install the post-migration step of installing the Guest Additions.

- FB 

Tuesday Feb 09, 2010

Migrating from VMware to VirtualBox (Part 1): Oracle Enterprise Linux

There are a growing number of people asking the question: how do you move a VMware virtual machine to VirtualBox. So it is about time the Fat Bloke rolled up his sleeves and showed us how. (BTW you can click on screenshots below to magnify)

People typically want to do this because they have spent time installing a guest OS together with a software stack and they don't really want to go thru all this again. But moving a vm from one virtualization platform to another is analogous in the real world to unplugging a hard drive(s) from one computer and plugging it into a different manufacturer's computer. You may find that the guest operating system gets upset when it boots up and sees virtual hardware which is different than it was expecting. Different guest operating systems react differently to this situation (Linux is typically more accommodating than Windows in this respect).  In fact some guest operating systems get so upset, they may BSOD (Blue Screen of Death) on you.

Secondly, some of the software that you have installed above the OS, such as VMware Tools, may also be relying on specific virtual hardware.

So the Fat Bloke's First Rule of VM Migration is: Don't, if you can help it. If you can create a new vm from scratch on the new virtualization platform, you probably should. That way the guest OS installs the right drivers for your particular virtual hardware, and you are not left with orphaned software which needs a specific virtualization layer.

That said, there are still going to be people looking to avoid a complete reinstallation and willing to live dangerously, so let's discuss what is possible. Note that because different guests behave so differently we're going to focus on one guest OS in this blog: Oracle Enterprise Linux, and we'll move it from VMware Workstation 7 to VirtualBox 3.1. Here is our start state, the vm running in VMware Workstation 7 on Windows 7:

Starting Position

Step 1 - Preparing to Migrate 

It's a good idea to take a copy of the vm that we're trying to migrate just in case you make a mess of things. With VMware Workstation you can clone a vm to do this or copy the machine in some other way such as copying files.

Clone

To prepare for migration we're going to remove virtualization platform-specific components:

  1. Remove VMware tools
  2. Reset the Display and Input device  configuration
  3. Remove incompatible devices 

The Fat Bloke's Second Rule of VM Migration is that it is easier to unpick platform-specific software on the native virtualization platform. So let's start up the vm under VMware to prepare for migration

Removing VMware Tools 

This is easy enough: 

vmware-uninstall-tools.pl

and you should see something like this:

uninstall tools

Resetting the Display Device and Input Devices

When Oracle Linux was first installed the display was set as a VMware display adaptor and input devices as a VMware keyboard and mouse. By the time we're finished this won't be the case, so let's prepare for that by moving aside the the OEL X.org conf file like this:

mv /etc/X11/xorg.conf /etc/X11/xorg.conf.vmware

This file will get recreated later when we run on the VirtualBox platform.

Now let's shutdown the guest. 

Shutdown

Remove Incompatible Devices

The VMware soundcard device is different from the one that VirtualBox exposes so let's remove this device from the vm configuration in the VMware Settings dialog:

Remove Soundcard

Step 2 - Exporting the Virtual Machine

A Virtual Machine consists of :

  • configuration information (in VMware a .vmx file)
  • virtual hard drive(s) which the guest is installed on. (in VMware, typically .vmdk files)

An emerging standard for encapsulating this information to allow vm's to be transported more easily is the OVF or Open Virtualization Format. So in theory you should be able to Export this vm from VMware Workstation and Import into VirtualBox. Sadly, the VMware conversion wizard (File...Import or Export...) doesn't support Oracle Enterprise Linux as a guest:

can't export

But there is a command line ovftool that can be downloaded from VMware's site.

So in a Windows command.exe window you can run:

cd C:\\Users\\fatbloke\\Documents\\Virtual Machines\\Clone of Oracle Enterprise Linux 
"\\Program Files\\VMware\\VMware OVF Tool"\\ovftool.exe "Clone of Oracle Enterprise Linux.vmx" OEL.ovf 

And eventually you end up with 3 files:

  1. OEL.ovf - configuration information
  2. OEL-disk1 - compressed disk format file
  3. OEL.mf -  digital signatures (SHA1) of the other files.

 We can now move these to the destination system for import by VirtualBox.

Step 3 - Importing into VirtualBox 

You can import an ovf file into VirtualBox from the graphical user interface or the command-line.

Import OVF

Importing this takes a while as the compressed disk is converted to a usable format, but your should end up with a new entry in your vm list in VirtualBox like this:

Imported vm

 Now the moment of truth, Start it up...and we should see Oracle Enterprise Linux boot up under VirtualBox

OEL under VirtualBox

 Step 4 - Install the VirtualBox Guest Additions

 Finally don't forget to install the VirtualBox Guest Additions which is the mirror image operation to removing the VMware Tools.

Install Guest Additions

Once you have mounted the Guest Additions iso image you can run install them from the mounted directory using the command:

sh VBoxLinuxAdditions-x86.run 

 Like this:

Install GA

And after a restart of the guest you are all set to go.

Migration is complete! 

Epilogue (Advanced users only)

There is an alternative to step 2 and 3 above for people who know what they are doing.

After performing Step 1 you could simply take the VMware disk image (.vmdk)  and plug this into a manually configured VirtualBox vm. This effectively relies on the user to create an appropriately similar vm instead of relying on the ovf export and import (Steps 2 and 3 above) process. Note that the default disk controller used by VMware is an LSI SCSI controller, so when manually creating a VirtualBox vm you need to configure it appropriately. 

Add SCSI Controller

You still need Step 4 for optimal performance and ease of use. And don't forget the tip about Speeding up Linux Guests too.

Good Luck!

- FB 

Wednesday Apr 30, 2008

FatBloke in love?

FatBloke has been absent for quite some time....and to what do we owe this absence:

  • vacation - FatBlokes are machines! They don't need vacation.
  • beer - hmmm, FatBlokes like beer but even so, 2 months absence is a bit rich.
  • love - That's it! FatBloke has a new love in his life and her name is VirtualBox

For sometime now, FatBloke has had an opinion on topics around Desktop Virtualization. Most of the time he has solved the need for:

  • a more secure desktop
  • a more functional desktop
  • a more available desktop

 ...by taking a server based computing and SGD approach to life. This approach used servers and wires to deliver a richer, but more secure desktop than could be delivered traditionally.

And while this is a great approach, which delivers on the needs above, VirtualBox is a different client-side based approach which is compact, self contained and very elegant.  Let me explain...

VirtualBox is a Type-2 hypervisor which means it installs like a program on top of your existing system. So you don't need to wipe your existing machine. Once installed, you create Virtual Machines into which you can install your desired OS's. So here's what it looks like on a Mac host running OpenSolaris and Windows XP:

Screen shot 

 It can install on:

 

  • Windows Hosts - Windows XP, Windows Vista, Windows Server 2003, Windows 2008;
  • Linux Hosts - Ubuntu, RedHat, SuSE, Debian....
  • Solaris Hosts - Solaris 10u5, OpenSolaris (beta at the moment);
  • Mac OS X Hosts - 10.4 and 10.5 (Beta)

 

And Guests can be:

  • Windows Guests - Windows XP, Windows Vista, Windows Server 2003, Windows 2008, Windows NT, Windows 98, Windows 2000...
  • Linux Guests - Ubuntu, RedHat, SuSE, Debian....
  • Solaris Guests - Solaris 10u5, OpenSolaris (beta at the moment);
  • FreeBSD
  • OS/2
  • (more)

So on his MacBook Pro the FatBloke has all he needs: Mac, Windows, Solaris, Linux apps all at once.

In the next few posts I'll cover cool features of VirtualBox and explain why this is the coolest piece of technology that Sun has acquired in a long time. 

And the first reason is that VirtualBox is FREE (as in free beer) and Open Source (as in free speech).

So go download this roughly 20Mb gem and join the VirtualBox community.

 

-FB 

 

About

Fat Bloke

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today