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.
- The default display color settings use a higher color depth than Virtual PC supports
- Ubuntu has a hard time recognizing the emulated Virtual PC mouse
- Networking does not work initially
- Time syncronization with the host can be a little off.
- Soundcard does not work initially
- 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).
- 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.
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 ##".
i8042.noloop clock=pitto the kernel parameters. You'll recognize the
i8042.noloopthing from before, the
clock=pitis 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
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.