Getting Ubuntu 7.10 working in Microsoft Virtual PC 2007

| 21 Comments

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.

  1. The default display color settings use a higher color depth than Virtual PC supports
  2. Ubuntu has a hard time recognizing the emulated Virtual PC mouse
  3. Networking does not work initially
  4. Time syncronization with the host can be a little off.
  5. Soundcard does not work initially
  6. The ubuntu splash screen "usplash" causes problems when shutting down/restarting.

Anyway, here we go.  Obviously first things first, you need Virtual PC 2007 and Ubuntu 7.10 (x86 desktop).

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
    tulip
    snd-sb16

    Ensuring 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)

Hope that helps if you are going on a similar journey.

21 Comments

Fantastic tips, I actually had to disable hardware virtualization before I could get anywhere, but that wasn't the first time that a *nix flavor rejected my BIOS.

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?

Thank you for your tips! I found myself lovin' it!

Your help is much appreciated, I can now here and touch.

Cheers.

Enos,

As mentioned, VMWare works with Ubuntu no problems.

Martin.

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.

Wow, Martin! Very detailed yet simple instructions! Thanks you for taking the time to share with us linux noobs.

> 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

I had the same problem. On the boot screen remove the "splash" from the options as well.

Linux newbie here!
I tried and I guess I did exactly as adviced, but I can't get the mouse to work.

It worked for a while between liveboot and installation.

Maybe I do somethin wrong but I can't figure out what.

Cheers,
J-J

Thanks alot! You definitely saved me a lot of time fixing that mouse issue.

Happy Holidays!

Thanks for the great article. I wrote a similar article at http://arcanecode.wordpress.com/2007/10/18/installing-ubuntu-710-under-virtual-pc-2007/
today that describes my experience with getting Ubuntu 7.10 running on Virtual PC 2007; I ran into a couple of additional issues not described here, so my steps are slightly different.

Great info, and thanks Dan for the very helpful comment too!

Between this and the ArcaneCode blog entry, I got things working nicely...

Thank You so much! Really appreciate it.

thanks for ur help till now
but plz extend ur courtesy to help me install my wifi card and
use it for internet access

Still not got networkin working after following the steps. It worked on the Live CD though without any configuration :( - any help?

Very awesome tips. The 'tulip' in the modules got my network working like a champ.

I wonder why they force you to click "Wired" connection. Shouldn't that be the default?

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.

Thanks a billion! I've tried a whack of different web guides on how to get Ubuntu working on VPC2007 -- yours actually works!

I have tried the i8042.noloop command everywhere it just wont work, i have managed to install ubuntu already on the virtual hd, but the mouse will not work, what ever i try

I have tried the i8042.noloop command everywhere it just wont work, i have managed to install ubuntu already on the virtual hd, but the mouse will not work, what ever i try

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 ?

Archives

Creative Commons License
This blog is licensed under a Creative Commons License.