Sunday 2 November 2008

How to install Ubuntu on XP as a Virtual Machine

Ok gentle reader

Last night I geeked out and stuck an UBUNTU V8.10 new VM on my thinkpad
Now I know that there are a large number of folk out there that know how
to do this but there may be those out there who have gone "eh?" every time
they hear one of the illuminatii mention that they have this or that as a
virtual machine. This was brought up clearly to me when sprog asked me
what I was doing and I found out he was unaware that you could do this.

So this is a "HOW TO DO" for those of you out there that might want to have
a look at Linux in general and Ubuntu in particular but you haven't got
a) The spare hardware to do it on another machine
b) The budget to allow you to get new hardware
c) The "I [heart] Ubunto" factor isn't strong enuff for you to drop your
XP or Vista partitions.
d) You don't know your arse from your elbow when it comes to "Virtual Machines"

Well I am here to tell you it is free, it is reasonably easy to do and should
take no longer than an hour or so. The longest task are the downloads.

Right! I did this on a Thinkpad T60 with 1Gb of memory, 40gb of free space on
my HD and XP SP 2 as the parent Operating system and this is the way I did it.

Step 1 :- Download QEMU from here
This little program allows you to create a "virtual disk" on your hard drive.

Step 2 :- Install this program. I installed it into a dir called c:\Ubuntu and this is reflected below

Step 3 :- Open a command window in XP
START / Programs / Accessories / Command Prompt
Type cd\
Type cd\Ubuntu
Type qemu-img.exe create -f vmdk Ubuntu.vmdk 10G
Type exit
This will create a file called ubuntu.vmdk which will be used as your "virtual disk" for your ubuntu install.

Step 4 :- Download the ubuntu ISO image file from here and save it in c:\Ubuntu . The file name will be ubuntu-8.10-desktop-i386.iso

Step 5 :- Download VM Player from VMWare here, it is free but you do have to register

Step 6 :- Install the VM Player, just accept all the defaults

Step 7 :- Create a text file in the c:\Ubuntu directory and paste the following into it
config.version = "8"
virtualHW.version = "3"
ide0:0.present = "TRUE"
ide0:0.filename = "Ubuntu.vmdk"
memsize = "500"
MemAllowAutoScaleDown = "FALSE"
ide1:0.present = "TRUE"

#ide1:0.fileName = "auto detect"
#ide1:0.deviceType = "cdrom-raw"

ide1:0.fileName = " ubuntu-8.10-desktop-i386.iso"
ide1:0.deviceType = "cdrom-image"

ide1:0.autodetect = "TRUE"
floppy0.present = "FALSE"
ethernet0.present = "TRUE"
usb.present = "TRUE"
sound.present = "TRUE"
sound.virtualDev = "es1371"
displayName = "Ubuntu"
guestOS = "ubuntu"
nvram = "Ubuntu.nvram"
MemTrimRate = "-1"

ide0:0.redo = ""
ethernet0.addressType = "generated"
uuid.location = "56 4d 80 3e f2 32 56 75-44 a6 45 89 2b 4a 03 4b"
uuid.bios = "56 4d 80 3e f2 32 56 75-44 a6 45 89 2b 4a 03 4b"
ethernet0.generatedAddress = "00:0c:29:4a:03:4b"
ethernet0.generatedAddressOffset = "0"

tools.syncTime = "TRUE"
ide1:0.startConnected = "TRUE"
uuid.action = "create"
checkpoint.vmState = ""
tools.remindInstall = "TRUE"
#gui.fullScreenAtPowerOn = "TRUE"
Step 8 :- Save this file as c:\ubuntu\Ubuntu.vmx
*NOTE* the memesize=500 can be changed to reflect
your currently memeory. I use 1/2 my 1Gb and allocate 500mb
*NOTE* the line below should reflect the file you downloaded in step 4.
ide1:0.fileName = " ubuntu-8.10-desktop-i386.iso"

Step 9 :- Start the VM Player, there will be a shortcut on the desktop

Step 10: - Select "open" and browse to c:\ubuntu and click on ubuntu.vmx

Step 11:- A VM Window will open and the UBUNTU install will start Enter all data you are asked for and you can just accept the defaults and all should be well.
*NOTE* the disk format instal will install into the Virtual disk so your PC and it's current install will be totally safe. You will see that UbUntu.vmdk gets bigger and bigger.

Step 12: Let Ubuntu restart itself, this will only happen within the VM window as soon as you get the reboot screen close the VM window

Step 13: Open c:\ubuntu\ubuntu.vmx and change these lines
#ide1:0.fileName = "auto detect"
#ide1:0.deviceType = "cdrom-raw"
ide1:0.fileName = "ubuntu-8.10-desktop-i386.iso"
ide1:0.deviceType = "cdrom-image"

to

ide1:0.fileName = "auto detect"
ide1:0.deviceType = "cdrom-raw"
#ide1:0.fileName = "ubuntu-8.10-desktop-i386.iso"
#ide1:0.deviceType = "cdrom-image"

This will give you an ordinary CD drive rather than the ubuntu install iso

Step 14: You can now delete the ubuntu install ISO image in c:\unbuntu

Step 15: Restart the VM Player open c:\ubuntu\ubuntu.vmx

Step 16: Logon to Ubuntu with the user name and password you created during the install
You may need to press + to use your keyboard in the VM window.

Step 17: Once Ubuntu starts, it will automatically start updating itself, as long as you
have an internet connection that is up and running the VM will use it and
you will be able to update your install with the most recent code. Let this
finish and perform an reboot when required.

Step 18: You are done, you have a running VM of Ubuntu on your PC running in a 10GB
hard drive in 500 mb of memory ... enjoy

Disqus for Domi-No-Yes-Maybe