Showing posts with label virtualbox. Show all posts
Showing posts with label virtualbox. Show all posts

Friday, June 18, 2010

Convert VDI file to VHD virtual hard disk format file

I had a dilemma , where I needed to run my VirtualBox virtual Windows XP OS, in another PC running Microsoft Virtual PC 2007. As you would know, Virtual PC 2007 would require the virtual OS harddisk file to be in VHD format. But my virtual Windows XP OS is in a VDI format file. So how ?

A check on the Internet shows VirtualBox comes with a command-line tool called VBoxManage, which includes functions to convert VDI files to VHD files. Cool !

Below is the command sequence which allowed me to convert the VDI file to VHD file. Phew !

Problem solved !

Command sequence as below :

a) Location of VBoxManage.exe -> d:\Program Files\Sun\VirtualBox
b) Location of VDI virtual OS file -> d:\virtual_os\Windows_2003_R2_30GB_11june10.vdi
c) Target output filename to D drive -> d:\sharepoint.vhd

========================================

d:\Program Files\Sun\VirtualBox>vboxmanage.exe clonehd d:\virtual_os\Windows_200
3_R2_30GB_11june10.vdi d:\sharepoint.vhd --format vhd
Sun VirtualBox Command Line Management Interface Version 3.1.6
(C) 2005-2010 Sun Microsystems, Inc.
All rights reserved.

0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Clone hard disk created in format 'vhd'. UUID: bfb203e0-c7f0-43fe-a4a3-dcd02877b
b91

d:\Program Files\Sun\VirtualBox>


========================================

Check link below for more info on the VBoxManage command :

http://forums.virtualbox.org/viewtopic.php?t=687&highlight=convert+virtual

You can also check the Sun VirtualBox Help files included, as it contains extensive documentation on usage of the VBoxManage command & it's parameters.

My experience with Sun VirtualBox

I remembered of a problem I had when I purchased my Celcom CSL brand broadband modem, worth RM249 , back in year 2009.

For some reason, my broadband would not work in my Windows 7 laptop , & my Windows Vista laptop ! Modem installation & setup went fine, but when it comes to dialing to the ISP, it just would not connect. A check at the local Celcom booth , did not help. They kept saying "Please ue & run the modem in Windows XP, I don't know about Windows Vista".

I searched the Internet for a solution. Eventhough some sites hinted the source of the problem as the firmware of the modem, the CSL website did not offer any latest firmware for my modem (got the hint from articles mentioning Huawei modems require firmware upgrade for Windows Vista support). In fact , there was no section for firmware upgrade download :(.

As such , I decided to run a virtual Windows XP using the freeware Sun VirtualBox virtual OS software. I had chosen VirtualBox over Microsoft Virtual PC 2007, mainly because of the USB support that comes with Virtual Box, which Virtual PC does not have. Besides , deployment of virtual Windows & non-Windows guest OS using VirtualBox is more pain-free, compared to Virtual PC which does not support much Linux/Unix virtualisation , and requires additional preboot parameters.

Using the Windows XP virtual guest OS running from VirtualBox, I was able to connect my USB broadband modem, install the dialer software , and connect to the Internet using the ISP dialup.

You can either access the Internet within the virtual OS itself , or by installing a freeware proxy server (ex FreeProxy), set the host OS IE proxy setting to point to virtual OS IP , and using the host OS ( in this case the Windows 7 or XP) IE to surf the Internet via virtual OS proxy + Internet connection.

Problem solved.

Note : Certain application like Youtube may not download or view properly if using the proxy server method.












The picture above shows a Windows XP virtual guest OS running on my Windows 7 physical laptop.