HOW TO: Virtualise Ubuntu on Vista

James Bannan22 March 2007, 9:50 PM

Want to try out your own installation of Linux but don't want to stuff around with repartitioning your drive? Here's how to use Microsoft's free Virtual PC software to install Ubuntu.


Scenario

You want to create a virtual machine using Microsoft Virtual PC 2007 and install Ubuntu 6.10 as the guest operating system.

Tutorial Summary

In this tutorial we’re going to create a Virtual PC 2007-based virtual machine and install Ubuntu 6.10 as that machine’s operating system. While Virtual PC will accept Linux as the guest OS, it’s not designed to support it natively so we need to make some modifications to Ubuntu to get it working.

This has been tested using Virtual PC 2007 on two machines, one running Windows XP SP2 and one running Windows Vista Ultimate.

What you need

Windows Vista

Ubuntu 6.10 Alternate Install Image (free)

Microsoft Virtual PC 2007 (free)

Get Started

We’ll assume that you’ve already downloaded and installed Virtual PC 2007. If not, you can download it from here.

The first step is to download the correct Ubuntu install image. In this scenario we can’t use the normal image (ubuntu-6.10-desktop-i386.iso) for one simple but important reason: the Virtual PC 2007 graphics adaptor only supports 16-bit colour depth for its virtual machines, and the Ubuntu Live CD as well as the operating system itself defaults to 24-bit. There’s no denying that Ubuntu looks great, but as a virtual machine it renders as a garbled mess.

So to get Ubuntu working in Virtual PC 2007 we need to use a text-based installation which doesn’t use the xserver. The install image you need is the alternate install image – ubuntu-6.10-alternate-i386.iso. It’s just as big as the normal desktop image (713MB), so the download could take a while.

Next, create a new virtual machine from the Virtual PC Console.

Virtual PC 2007 - New MachineVirtual PC 2007 - New Machine

Virtual PC 2007 - Create MachineVirtual PC 2007 - Create Machine

Name the machine appropriately (eg: “Ubuntu”).

Virtual PC 2007 - Name MachineVirtual PC 2007 - Name Machine


When prompted for the operating system, select “Other” from the drop-down list.

Virtual PC 2007 - Choose OSVirtual PC 2007 - Choose OS


The default amount of RAM assigned to the machine is 128MB. You’ll really need at least 256MB, and 512MB is better still.

Virtual PC 2007 - Choose RAMVirtual PC 2007 - Choose RAM


Create a new virtual hard disk and make it around 10GB in size. Ubuntu doesn’t need this much, but it’s handy for installing updates and future applications (ignore the amount in the screenshot!)

Virtual PC 2007 - Virtual DiskVirtual PC 2007 - Virtual Disk


Finally, highlight the virtual machine in the Console and select Settings. Modify any features you need to – I prefer to change the networking adaptor to NAT and disable both the floppy drive and sound adaptor.

Virtual PC 2007 - SettingsVirtual PC 2007 - Settings


Install Ubuntu

Start the newly-created virtual machine. Before it boots too far, click on the CD menu and select which physical drive you want to use or choose “Capture ISO image” and navigate to the alternate Ubuntu image. You can also pause the machine by pressing RIGHT_ALT+P. Pressing the same keys again resumes the machine.

Virtual PC 2007 - Install UbuntuVirtual PC 2007 - Install Ubuntu


When the boot menu loads, press F4 for VGA options. Choose a resolution that’s going to work well on your display, but make sure it’s at 16-bit colour depth (eg: 800 x 600 x 16). Then select “Install in text mode” and press Enter.

Virtual PC 2007 - F4 OptionsVirtual PC 2007 - F4 Options


Choose the installation language then press Enter, then choose the location and press Enter.

Install Ubuntu - Choose LanguageInstall Ubuntu - Choose Language

Install Ubuntu - Choose LocationInstall Ubuntu - Choose Location


When prompted to auto-detect the keyboard layout select No and press Enter.

Install Ubuntu - Keyboard LayoutInstall Ubuntu - Keyboard Layout

Then choose U.S. English as the type (or origin) of the keyboard and press Enter again, and U.S. English again at the next screen, and Enter yet again.

Install Ubuntu - Keyboard OriginInstall Ubuntu - Keyboard Origin

Install Ubuntu - Keyboard Layout 2Install Ubuntu - Keyboard Layout 2


Ubuntu then goes through the hardware detection phase and starts loading hardware-specific components.

When prompted to change the hostname, it’s a good idea to make it something other than “ubuntu”. Change the name and press Enter.

Install Ubuntu - HostnameInstall Ubuntu - Hostname


When choosing where and how to install Ubuntu, select “Erase entire hard disk”. Ubuntu will automatically suggest a partitioning scheme, and when you’re prompted to write the changes to disk, select Yes.

Install Ubuntu - Partitition DisksInstall Ubuntu - Partitition Disks

Install Ubuntu - Partition Disks 2Install Ubuntu - Partition Disks 2


Choose your capital city for the correct timezone settings.

Install Ubuntu - Time ZoneInstall Ubuntu - Time Zone


When configuring the clock, select No to UTC and press Enter.

Install Ubuntu - Clock UTCInstall Ubuntu - Clock UTC


Next, type in the full name of the user to be created and hit Enter.

Install Ubuntu - UsernameInstall Ubuntu - Username

Then either accept the default account username Ubuntu chooses, or type one in of your own (must be lowercase) and press Enter. Then type in a password and press Enter, verify the password and Enter again.

Install Ubuntu - Username 2Install Ubuntu - Username 2


Ubuntu then starts the main installation of the base system, and then the main suite of software and applications.

Install Ubuntu - InstallingInstall Ubuntu - Installing


When prompted to configure the xserver, the acceptable resolutions should already be highlighted – 640x480, 800x600 and 1024x768. Press Enter to accept the defaults, and the installation continues. This bit takes the longest, so it’s probably cup of coffee time.

Install Ubuntu - ResolutionsInstall Ubuntu - Resolutions


Configuring Ubuntu

When the installation is finished, click on the CD menu and release the physical drive or ISO, and press Enter to restart.

Install Ubuntu - RebootInstall Ubuntu - Reboot

If you let Ubuntu load as normal, you’ll get a scrambled screen as it attempts to render at 24-bit colour depth. To fix this, hit ESC when the GRUB boot loader starts up to access the GRUB boot menu, and select to boot into recovery mode.

Install Ubuntu - Recovery ModeInstall Ubuntu - Recovery Mode


This loads Ubuntu but doesn’t launch the xserver, so you’re safely in command line mode. Now we can manually edit the xserver configuration to reduce the colour depth.

First, make a backup of the configuration. From the command line, type in:

sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup

Install Ubuntu - Backup xorg.confInstall Ubuntu - Backup xorg.conf


This creates a copy of the configuration file xorg.conf called xorg.conf.backup, which you can use to restore the configuration if things go wrong. Remember that Linux is case-sensitive, do make sure to type in X11 and not x11.

Then type in:

sudo nano /etc/X11/xorg.conf

Install Ubuntu - Edit xorg.confInstall Ubuntu - Edit xorg.conf


This opens the xorg.conf file in GNU Nano – a text editor. Press CTRL+W to launch Where Is and type in “DefaultDepth”. Nano then scrolls along to the DefaultDepth line entry, which is currently set to 24. Use the arrow keys to move the cursor over and then delete the entry. Then type in 16.

Install Ubuntu - DefaultDepthInstall Ubuntu - DefaultDepth

Press CTRL+O to save the changes and Enter to overwrite the existing file, then CTRL+X to exit.

Install Ubuntu - Save ChangesInstall Ubuntu - Save Changes

Then type in reboot, and Ubuntu restarts.

Install Ubuntu - RebootInstall Ubuntu - Reboot


When the virtual machine loads up, allow Ubuntu to start normally, and it will load correctly using 16-bit colour.

Install Ubuntu - Install CompletedInstall Ubuntu - Install Completed

Post your comment



Comments

RSS feed Email alert

tin:

Or you could use VMWare. It just works, and if you move to Linux full time, it's available there aswell.

29 February 2008, 8:30 PM (4 years ago)report abuse Send to a friend reply

justthething84:

Buy a small item from a computer store such as some blank CDs and they can give you an OEM version of WINDOWS VISTA ULTIMATE for $250. That's a saving of $530. There is a shop near me that is doing this and I think it's an absoulte crack up.

The ONLY difference is that the OEM version does not come with the pretty box - but let's face it who cares about a box haha they aren't worth $530. Come on Microsoft is ripping the World off again!!!!!!

29 February 2008, 8:39 PM (4 years ago)report abuse Send to a friend reply

x@y.z:

Hi there... I think you need to read the license agreement more carefully. An OEM version is linked to your system. If you change your system you may not install that OEM version on that new system. With a regular version you are allowed to do so. In other words: an OEM license is linked to the CPU of your computer.

29 February 2008, 8:40 PM (4 years ago)report abuse Send to a friend reply

James:

Great work mate! But I have had that resoloution problem in the past too. I Try to run any Linux in 24bit colour on Virtual PC and its a nightmare. I dont understand why noone, not even the Linux Distros havent resolved the problem with an update or a (independent make of VPC additions) update for it. As Virtual Server has the exact same issue. I know theres VMware but its still not compatible with Vista and Virtual Server is a much better option for me.

Otherwise its good to see your success

29 February 2008, 8:30 PM (4 years ago)report abuse Send to a friend reply

raindog:

interesting, though I doubt the stability will be anything like that natively offered by Ubuntu. I've seen many people write off Linux because of problems with virtualization emulation or dual boot systems.

Virtual machines have a big advantage over boot solutions but offer a performance hit.
This is a good way to dabble but no software system will ever replace the flexibility and convenience a 2nd box and a KVM offer, when you routinely wish to run two op systems.

29 February 2008, 8:30 PM (4 years ago)report abuse Send to a friend reply

Robert:

Somewhat of a pointless exercise.

APC has become consumed by Linux lately which is disappointing. There's nothing that interesting in the workshop section nowadays.

29 February 2008, 8:39 PM (4 years ago)report abuse Send to a friend reply

raindog:

At a time when we buried in a plethora of rewrites about how Vista has rearranged the windows menu items yet again, it is refreshing to see areas like APC workshop show a balance of sections including Linux, Vista, XP, web creation, graphics, database etc.

Don't want to know about Linux? Then don't read that article? simple really! Thousands of others appreciate the read!


29 February 2008, 8:40 PM (4 years ago)report abuse Send to a friend reply

alex a:

nah, I agree with Robert - most PC users run Windows. Linux can go on and on about how its a free OS, and if it does what you want it to do (or hate MS so much, you wont use Windows), that's great, but most people run Windows as their main, stable OS.

I had a subscription to APC, but let it expire last year, because the workshops are all very flippant tutorials with almost no practical guidelines. APC needs to get back to practical tutorials, like the one in this article, and not install x, do b, then magically, you'll have c. Doing projects you always run into issues - it's those little things (ie. errors, or this may happen) that you miss out.

These types of tutes are good - screenshots are important - step by step is important. By the way, your dual boot guides are good - but you miss out those of us who do have 2 HDD's (most people would have an old HDD lying around doing nothing). I had vista and ubuntu on 2 seperate HDD's, and couldn't figure out how to get a menu to boot from one or the other. I had to switch it at BIOS level basically. Now that would be a good tutorial. It doesn't have to be specific, just how to boot 2 OS'es off 2 HDD's.

I'm also sick of people thinking Apple's or Linux are the best out there - they have to rely on software emulation. Most people just buy the real thing. Apple's can make good videos - that's it! That's all it's got over PC's. PC's can do the rest with free software. Apple's don't have the software range, and I've tried ubuntu - it was OK, but felt like a dog compared to Windows. Apple can keep making those stupid ads, but I wish Microsoft would slap them one back with an actual figures ad.... I always laugh at the PC guy anyway - way funnier than the mac guy.

29 February 2008, 8:30 PM (4 years ago)report abuse Send to a friend reply

raindog:

Some people like to paint by numbers. I'd rather an article just provides a little inspiration.

You say APC articles are all unexplained and just a series of steps yet you want articles littered with screenshots? How does that work?

For my money I'd like to see the magazine articles much as they are but to be followed up with feedback similar to what appears in this forum.

As for you being sick of Apple or Linux, well I'm sick of such narrow myopic views period. If you don't like to read about them then turn the page, its that simple! No one cares that you have a favorite.

29 February 2008, 8:40 PM (4 years ago)report abuse Send to a friend reply

prilvesh(FIJI):

well i guess you could run ubuntu virtually but oh the stress the pain which it may cause on your computers cpu and memory well it may work great withe newer pcs such as p4and above (i have a p4) but oh the pain and agony it will cause when you try and do that on p3 and p2 (yes p2 and p3 arnt totally dead yet pacific islands still use em ) ok so i had installed ubuntu on my p4 its good but i guess i didnt like it cause it did not allow me to explore my windows parttion unlike xandros so well i owuldnt be emulating any operating system as as a matter of fact when i could create seprate parttions and multiboot instead so far ive installed windows xp along with xandros and debian sarge so i have 3 choices at the boot to chose from thats great id prefer to use xandros and debian cause well compared to ubuntu there more flexible and have more suppourt i think hey but the the real matter is why emulate something when you could run it live or just install it along the partitions ay
running it virtually is a big no no for me cause it causes more load on your hardware and eveantually pooff goes your hardware..

29 February 2008, 8:30 PM (4 years ago)report abuse Send to a friend reply

jumphrey:

So you've gone through the pain of creating the vpc and vhd. Any chance of someone posting them for download?

29 February 2008, 8:30 PM (4 years ago)report abuse Send to a friend reply

Luke:

Great post James, thanks for the effort.

I had an issue with the display resolution running a fresh Debian install under Virtual PC 2007. Your walkthrough cleared it up.

29 February 2008, 8:31 PM (4 years ago)report abuse Send to a friend reply

rb:

Installed the alternate ubuntu 7.04 version. An error at he end says unable to install boot loader or lilo.
Any ideas?

29 February 2008, 8:31 PM (4 years ago)report abuse Send to a friend reply

Kris:

It is beyond me why you would want to take a stable and quick operating system, and load it in a virtual machine under an os that is clogged, slow, bloated and unreliable.. I wouldn't vm anything under vista, you want performance out of ubuntu? try running it on a seperate partition and do a dual boot, Not under a virtual machine in an os that requires 2G of ram to even become tolerable..

29 February 2008, 8:33 PM (4 years ago)report abuse Send to a friend reply

j_l_larson (New user):

This is awesome, I had no idea this was possible. Thank you. Any chance this could work with 64 bit ubuntu (my machine is 64 bit vista ultimate). Thanks!

02 May 2008, 2:03 PM (4 years ago)report abuse Send to a friend reply

j_l_larson (New user):

This is awesome, I had no idea this was possible. Thank you. Any chance this could work with 64 bit ubuntu (my machine is 64 bit vista ultimate). Thanks!

02 May 2008, 2:05 PM (4 years ago)report abuse Send to a friend reply

j_l_larson (New user):

This is awesome! I had no idea such a thing was possible. Thank you. Any chance of running 64 bit Ubuntu under this scenario (my machine is 64 bit Vista Ultimate). Thanks!

02 May 2008, 2:05 PM (4 years ago)report abuse Send to a friend reply

anonymous user Anonymous user


May APC out  now!

Tags