Tag/tag.png

Content Cleanup Required
This article should be cleaned-up to follow the content standards in the Wiki Guide. More info...

How To - Configure Ubuntu for Microsoft Virtual PC 2004/2007

Please Note, Microsoft Virtual PC 2004 is no longer existent. The new version is Microsoft Virtual PC 2007 which does not natively support Ubuntu or other Linux!

First read over these instructions to get a feel for what might have to be done to get it to work. You should have more than one version of Ubuntu available, preferably in ISO form on a local drive. Start with an old version and the required mods to get that to work (like, using 7.10 with 350MB of ram and the i8042.noloop flag), get to the install screen and then work your way up to your desired version. UbuntuX86 7.10 desktop does run in VPC07 in WinXPsp3 on my Core2 e1705 laptop. After 30 minutes of trying and failing to get 8.04 to even boot I followed the primrose path to Suns' xVM VirtualBox: http://www.virtualbox.org/wiki/Downloads

5 minutes I had the closed-source version up and running, another 15 minutes to install Ubuntu-x86 v8.04.1.

I'm sure that MS has broken support for Ubuntu in VPC2007 (or else there is some sort of command-flag that will get it to work) but hey another good reason to use Sun SW instead of MS sw (they even have an open-source version) and I'm good for it.

Also Sun has a version of this for Linux, so if you really want to run a MS OS why not give that a try Smile :) cheers & good luck

To get Ubuntu working in Microsoft Virtual PC 2007, you need to make some changes manually. The default color depth is configured to 24 bits per pixel, Virtual PC only supports 16 bits per pixel. To install Ubuntu 8.04 Desktop for Virtual PC 2007:

  • Create a new virtual machine
  • Start the Live CD version of Ubuntu from a CD or the ISO file in safe graphics mode
  • Install Ubuntu onto the new virtual hard disk and reboot
  • Interrupt the reboot at the GRUB prompt and select the (recovery mode) option
  • Edit the xorg.conf file to fix the color depth
  • Reboot

Basic Installation

Create a new virtual machine

1. Start Microsoft Virtual PC 2007.

2. Create a new virtual machine by clicking the "New" button. This starts the New Virtual Machine Wizard.

  1. Select the "Create a virtual machine" option. Click "Next".
  2. Name the virtual machine. For example: "Ubuntu 8.04 Desktop". Click "Next".
  3. Select "Other" for the Operating System. Click "Next".
  4. Recommended RAM of 128MB is too small. Select "Adjusting the RAM" and configure for at least 256MB. I would give at least 512 mb if your system can give it Click "Next"

  5. Select the virtual disk option. I always create "A new virtual hard disk". Click "Next"
  6. Specify the Virtual Hard Disk Location. Click "Next"
  7. Click "Finish" to create the new virtual machine.

Start the Live CD version of Ubuntu 8.04 from CD or the ISO file

You can install directly from a downloaded ISO file without burning the ISO to a CD, or you can install from a Ubuntu CD.

3. Start your new virtual machine. The "BIOS" will boot and then ask for an operating system disk. If you want to install from the ISO file, click the CD menu of Virtual PC 2007 and select "Capture ISO Image..." then browse to the downloaded "ubuntu-6.06-desktop-i386.iso" file. If you want to install from a CD, click the CD menu of Virtual PC and select the physical drive that contains the Ubuntu CD. This will start the Ubuntu Live CD boot process.

Install Ubuntu onto the new virtual hard disk and reboot

4a. To avoid the display problem when booting the Live CD version, select "Start Ubuntu in safe graphics mode" (optionally you may try 4b.) by hitting the down arrow then "Enter". Ubuntu will boot, and eventually, the desktop will appear with an "Install" icon. Double-click the "Install" icon to start installing Ubuntu onto your virtual hard disk. You will see the usual progress bar; installation can take a long time (30-60 minutes) depending on your system. Eventually, you will be asked to "Restart Now". Make sure you eject the CD from your drive or release the ISO image using Virtual PC's "CD" menu before you reboot. If, for some reason, the virtual machine does not restart when you click "Restart Now", you can reset the virtual machine using the Action->Reset menu item from the Virtual PC menu bar.

  • Be prepared to hit the Esc key when the GRUB loader appears.

4b. Boot Live CD, select the "Start or Install Ubuntu". When you find yourself in the messy Xwindows environment. Press Crtl-Alt-F1 to get to a command line interface. At the prompt type "sudo dpkg-reconfigure xserver-xorg". You will now be in a ncurses interface, where the keyboard, tab, enter, and arrow keys should be sufficient. Choose the defaults by pressing enter, until you get to the monitor settings stage. When the color depth settings come up select "16". Finish dpkg-reconfigure by following the rest of the prompts, it will save your changes and dump you back to the command line. Now restart X by logging out and back in, or typing sudo /etc/init.d/gdm restart. Wait awhile for Ubuntu to reset you back into the graphical user interface. If you follow these directions you should be able to skip the steps below related to color depth.

  • TIP: If you don't want to go thru dpkg-reconfigure. You could use this command instead:

      sudo sed -e 's/DefaultDepth.*24/DefaultDepth 16/g' -i /etc/X11/xorg.conf 

If when pressing Ctrl+Alt+F1, the CLI is also corrupted:

4c. Disabling Splash: Boot Live CD, press F6 (Other Options) on "Start or Install Ubuntu". Go near the end of the line and remove the word splash, then press Enter. Notice the output will be very limited while starting up, please be patient. Continue as described on 4b.

Interrupt the reboot at the GRUB prompt and select the (recovery mode) option

5. When the system restarts, the GRUB loader briefly appears. Immediately hit escape, then the down arrow to select the recovery mode option. It will read something like "Ubuntu, kernel 2.6.15-23-386 (recovery mode)". Then press "Enter". Ubuntu will boot into a console text mode.

Edit the xorg.conf file to fix the color depth

6. Read the instruction below under the Video heading to change the default color depth.

Hang on initial reboot of installed system

Some users have encountered problems on the first reboot. If this happens,

  1. Select Action->Reset from the Virtual PC menu bar.

  2. Press escape as prompted by the GRUB loader and to boot into recovery mode.
  3. In the recovery mode, after the system has booted to the command prompt, issue the command:
    • sudo apt-get remove usplash -y && sudo reboot

General Notes

Furthermore you can't use "JFS" as filesystem, because grub- and lilo-installation doesn't work there.

If you have a hyperthreaded CPU and encounter a kernel panic immediately after the boot menu, restart the virtual PC and try the idle=poll boot parameter as a workaround.

Mouse

Versions of Ubuntu since 7.04, which include a Linux kernel later than 2.6.19 have a bug that causes the mouse to not work properly. To fix this issue add the following text as a kernel parameter at boot.

i8042.noloop

Captured Live CD

  1. Press F6 to access the Boot Options line.
  2. Type i8042.noloop at the end of the line.

  3. Press enter to accept the changes and then press enter again to boot.

Installed image

  1. At boot press the Esc key enter the grub menu screen.
  2. Make sure your kernel boot line is selected.
  3. Press e to edit the kernel boot line.
  4. Type i8042.noloop at the end of the line.

  5. Press enter to accept the changes and then b to boot.
  6. Once logged into Ubuntu, open the /boot/grub/menu.lst as root.
  7. Add i8042.noloop to the end of the kernel boot lines.

Video

Ubuntu currently auto-configures XFree86 during the installation process, asking the user only what resolutions they'd like to enable.The default color depth is automatically set to 24-bpp, and Microsoft Virtual PC 2007 does not support 24-bpp color depth. In practice, this results in garbled graphics output when the X Server starts and the login screen is displayed. To fix this problem, you may manually change the default color depth setting in the XFree86 config file. These directions assume that you have installed Ubuntu as your guest operating system normally, have rebooted, and have seen the garbled graphics output.

  1. In Microsoft Virtual PC, select Action-->Reset to reboot the virtual machine.

  2. Watch for the GNU GRUB prompt (don't blink or you'll miss it) and hit ESC when you see it.
  3. Select the option in GRUB for recovery mode, and wait for Ubuntu to boot into the shell.
  4. Type: su root (you may have to type your password at this point.
  5. cd /etc/X11
  6. emacs XF86Config-4

Now, scroll down in emacs to Section "Screen" and find the entry named "DefaultDepth". Change the setting you find there from 24 to 16.

  1. Hit F10, f, s to save your changes
  2. Hit F10, f, e to exit emacs
  3. Reboot the virtual machine again as described in step 1.

The virtual machine should now boot successfully into the Ubuntu login screen.

From KjellM.G.Eines Sat May 28 17:31:29 +0100 2005 From: Kjell M. G. Eines Date: Sat, 28 May 2005 17:31:29 +0100 Subject: Alternative configuration of Ubuntu for Microsoft Virtual PC 2004 Message-ID: <20050528173129+0100@https://www.ubuntulinux.org>

There seems to be changes in the 5.04 releases of Ubuntu that may cause confusion with users who are new to configuring X. Whilst the process above is correct, there are a few modifications. Follow the procedure above but with the following adjustments:

4. Note that you may already be root making this unnecessary

6. nano xorg.conf

Now, scroll down in nano to Section "Screen" and find the entry named "DefaultDepth". Change the setting you find there from 24 to 16

Saving in nano:

1. Once you are done making your changes hit ctrl+X to exit.

2. Nano will ask if the modification should be saved before exit. Hit Return to accept, and overwrite the original file.

3. Reboot.

Virtual Terminals

If you face console display issue with virtual terminals when pressing on alt-ctrl f1-f6, you may also need to edit /etc/modprobe.d/blacklist-framebuffer (comment out "blacklist vesafb" and "blacklist vga16fb", and add "blacklist s3fb").

ConsoleFramebuffer Bug #129910


Soundcard

Virtual PC emulates a Sound Blaster 16 ISA PnP sound card. If your sound is not working, try doing this:

1. From the desktop, choose Applications - System Tools - Root Terminal

2. Enter your password (or the root password, depending on how you're set up) when prompted

3. At the prompt, type "gedit" (without the quotes) and press Enter

4. In gedit, open the file /etc/modules

5. Add "snd-sb16" (without the quotes) on a line by itself at the end of the file, followed by a carriage return

6. Save and close the file, close the Root Terminal window, and reboot.

You can also do this by running the command "modprobe sb" at the Root Terminal prompt, and then stopping and starting the sound server (System - Preferences - Sound - Enable sound server startup: uncheck, then close, then reopen, recheck, and close again), but that will only remain in effect for the current login session. You really want to modify /etc/modules so it will always work.


Network Card

Virtual PC emulates an Intel/DEC 21140 network card. Most Linux distributions use the "tulip" driver to provide support for this card. While Ubuntu will normally detect the emulated card automatically, here are some things to look at if your network card doesn't seem to be working:

1. In the main Virtual PC Console dialog in Windows (with the Ubuntu virtual machine turned off), open the "Settings" dialog for the Ubuntu virtual machine, and then go to the "Networking" section. Make sure that "Adapter 1" is set as the primary (and working) network adapter on your computer.

2. From the Ubuntu desktop, choose System - Administration - Networking. If it says that "the interface eth0 is not configured", click once on the "Ethernet Connection" entry and then click the "Properties" button. From the dialog that comes up, check the "This device is configured" box and set the configuration to either "DHCP" or "Static IP Address" with appropriate IP settings. Click OK to save the new properties, and then click the "Activate" button on the main Network Settings screen. This should start the network adapter. Click OK on the main Network Settings screen to save the changes to the /etc/network/interfaces file.

This can also be done manually in /etc/network/interfaces by adding the line "auto eth0" just before the line starting with "iface eth0".

3. To see whether or not you're getting a DHCP configuration, you can run the "ip addr" command from a Root Terminal window (Applications - System Tools - Root Terminal). If your card is configured for DHCP (see step 2 above), you can attempt to manually get a DHCP connection with the "ifup eth0" command.

4. If you're concerned that the adapter simply isn't getting detected, you can manually add the tulip driver to /etc/modules and reboot (add a line with the word "tulip" to /etc/modules, in the same way you added "sb" to that file in the soundcard configuration above). Normally, this should not be necessary though.

If you are behind the NVIDIA firewall

Warning: This technique disables a firewall setting, do it at your own risk.

If you are behind the NVIDIA firewall and are unable to setup networking, do the following:

1. Open the "Web based interace" by navigating to "Start->Programs->NVIDIA Corporation->Network Access Manager->Web-based interface."

2. In the web based interface navigate to "Firewall->Advanced Configuration."

3. Uncheck "Block outbound spoofed IP packets."

4. Click on "Apply."

Note: This has been tried against NVIDIA firewall 4.65 and Ubuntu 7.06.

Remote access

To install the ssh server, run "sudo apt-get install openssh-server".

To allow thin X clients to connect, open "/etc/X11/gdm/gdm.conf" and locate the "[xdmcp]" section. In here change "Enabled=false" to "Enabled=true", and restart gdm. Now any X terminal may query the Ubuntu host and get a login screen. For Microsoft Windows install the X server software with Cygwin, and run "Xwin -query _address_".

See Also

Ubuntu emulated in Windows with QEMU


CategoryVirtualization

HowToConfigureUbuntuForMicrosoftVirtualPC2004 (last edited 2011-05-16 15:37:16 by jengelh)