Getting Ubuntu 7.10 working in Microsoft Virtual PC 2007

The new "Gutsy Gibbon" version of Ubuntu was officially released this week. While some of the developers at Teamprise use Ubuntu as their primary OS, I personally prefer Windows Vista, however I keep an Ubuntu image around so that I can quickly test any new UI code I write in an alternate OS. Getting Ubuntu to install in VMWare is pretty trivial - the standard installation seems to work just fine. However getting it to work in Microsoft Virtual PC is a little more complicated - the various tricks are located in various forum and bug posts around the web that I can never find when I need them so I am collating them here for my own use later - hopefully you may also find them useful. Please bear in mind that I know enough about Linux to be dangerous rather than useful, so this may not be the "best" way - however it is my way ;-)

There are a few basic issues with getting Ubuntu 7.10 working inside Virtual PC.

Installation:

In Virtual PC, create a new virtual machine by pressing "New..." in the console. I use the following settings:

In the OS selection select "Other"

Ram 512Mb

New Disk of 8192 Mb

One created, go back into settings and Enable Hardware Virtualization if available (only available if you have a modern processor, and even then you probably had to enable this in your host machines BIOS first). This can make a serious difference if your hardware supports it, however having the flag enabled makes the image less portable as some machines cannot support this option so they have to switch it off before using the image for the first time.

Start the VM. Then go to Edit, Capture ISO Image... and select the downloaded Ubuntu install image. You may need to restart your Virtual PC to get it to boot from the mounted DVD

When the ubuntu install menu comes up, move down to "Start Ubuntu in safe graphics mode" then press "F6" for more options.

In the boot options, add the text "i8042.noloop" without the quotes. This is a parameter we are passing to the kernel to get the emulated Virtual PC mouse to work correctly. You entire boot options line should look like this:file=/cdrom/pressed/ubuntu.seed boot=casper xforcevesa initrd=/casper/initrd.gz quiet splash -- i8042.noloop

Press enter to start the boot into the installation live cd. Sometime when I do this, when the UI comes into view and the mouse is captured but it is like the virtual PC is only showing the top left hand corner of the screen. Not sure why, but to fix it hit CTRL-ALT-F1 to go into a console and then CTRL-ALT-F7 to restart the window manager. You should be able to see the whole screen now.

Install by double-clicking on the Install icon on the desktop. I use the guided partition manager to assign the whole virtual disk.

Once the install has completed, unmount the DVD from Virtual PC by going to "CD" and Release "ubuntu-7.10-desktop-x386.iso" (remembering that in Virtual PC, the right ALT button releases your mouse from the guest machine). Then go to Action, Reset to restart the VPC.

Initial Configuration:

When you boot for the first time, there are a few things that you need to do to get everything working properly. We need to get all the things (including the mouse etc) working again. These changes will then be stored on the virtual machine disk so you won't need to do them again for this image.

Log in (remember the mouse isn't working yet), so press CTRL-ALT-F1 to drop into a console.

Let's now get the mouse working again. type sudo nano /boot/grub/menu.lst. Page down to the bottom of the file and find the first kernel line after the phrase " ## ## End Default Options ##".

Add i8042.noloop clock=pit to the kernel parameters. You'll recognize the i8042.noloop thing from before, the clock=pit is a fix for the time drift issues (KB918461)

Now we want to ensure the modules are loaded for the Virtual PC soundcard and Network card. type sudo nano /etc/modules. At the end of the file add the lines tulipsnd-sb16Ensuring that each is on a line of it's own, followed by a carriage return.

Then we want to remove the fancy Ubuntu splash screen that has some issues under Virtual PC. Type sudo apt-get remove usplash -y

Restart by typing sudo reboot

When you restart your soundcard will be working - you might want to get rid of the login/logout sounds... System, Preferences, Sound, Sounds, setting Log out and Log in to "None".

As this is a virtual pc, depending on the usuage you may also want it to automatically log-in with the user account created on install. In which case go to System, Administration, Login Window, Security and check the "Automatic login" box - selecting your user. Also, because this is a virtual PC you may also want to disable the display power-management (System, Preferences, Power Management, Display) and disable the screen saver (System, Preferences, Screen Saver, uncheck Activate Screensaver when computer is idle).

To get networking fully enabled, I've found that I have problems with the "Roaming Mode" introduced in 7.10. Therefore I go to System, Adminitstation, Network. Click on the Wired Network and select properties. Disable the "enable roaming mode" check box and then select DHCP configuration then press ok. Finally, check the checkbox next to the "Wired connection" box to make this the default connection used on startup.

Configuring to run Teamprise

Now I have a booting Ubuntu instance, I usually want to configure it with Java, Eclipse and Teamprise. This part may be of interest to less folks, but I need to do it so I'll write down the steps but feel free to ignore.

Installing Sun Java. Teamprise needs some encryption stuff to support NTLM authentication that is not available in the CGJ - therefore another JVM needs to be installed - in this case I'll use Sun's. Go to Applications, Add/Remove programs, change the drop down to "All available applications" and then in the search box type "Sun Java". In my case I'm going to pick Sun Java 6 Console then I press "Apply".

Next is Eclipse. Easy way is from Add/Remove programs, search for "Eclipse" and Apply - however that was Eclipse 3.2 at the time of writing. Nothing wrong with Eclipse 3.2 of course, I just like to be on the Early Adopter curve so I go to the Eclipse.org site and download the latest for linux.

Then finally, I install Teamprise. That part is easy for me (copy paste the update site URL into Eclipse and unzip Teamprise Explorer)

I just attempted virtualizing ubuntu7.10 with virtualPC and encountered exactly the same problems with the mouse and video resolution. Is there "better" virtualization software that would make this easie?

Great tips. When editing menu.lst, though, it is better practice to update the Automagic Kernels List portion of the file. Modify either the "default kernel options" or "additional options to use with the default boot option, but not with the alternatives" section. (Follow the comments in menu.lst.) After you've made the change, run update-grub to rebuild the boot choices. This method ensures that your custom options will be included when you install kernel updates.

Also, instead of removing the usplash package, which breaks a dependency for the ubuntu-desktop metapackage, you can just disable it by removing the "splash" kernel option from menu.lst.

For networking all I selected was manual and dhcp and everything connected fine through my host pc through a router and a cable modem.The remove Usplash has totally destroyed my linux installation gives this error and wont load.
Kernel Panic - not syncing: VFS unable to mount root fs on unknown wn-block(0,0) so thanks for that now I have to reinstall it.

Hey Martin
i have setup ubuntu 7.10 in virtual pc 2007 with win xp sp1 as host.
Can you tell me step by step instructions to access the ubuntu from my host using telnet? Because right now i cannot telnet to my virutal pc ubuntu ?