Installing Linux on Microsoft Virtual PC

출처 : http://www.computerbits.com/archive/2004/0600/virtuallinux.html

Installing Linux on Microsoft Virtual PC

Undocumented by Microsoft ... by Michael Jackman

If you run both Windows and Linux for testing or for cross-platform purposes, you may be surprised to learn that you can run Linux within Windows using Microsoft's Virtual PC 2004, a competitor to the more expensive, but more robust, VMware.
Many Linux users were concerned when MS purchased the former Virtual PC maker, Connectrix Corp., in January 2003. Microsoft's product release last December only continued the misunderstandings, as documentation for installing and running Linux was nonexistent. Rumors flew that Microsoft had entirely removed Linux guest support. Fortunately, this is not the case. As expected, Microsoft simply offers no official support for BSD, Unix, Linux, NetWare and Solaris. But these OSs will install on Virtual PC, and run well.
Also missing from the repackaged product are Linux Virtual Machine Additions. These additions, available for Windows guest OSs, accelerate virtual machine performance. The tools also provide file sharing, copy/paste, and drag/drop between guest and host OS, automatic mouse pointer focus change to the guest system, undo disks and differencing disks. However, even without the additions, Linux performance is good.

Installing Virtual PC

Other than some reported incompatibilities with AMD processor systems, installing VPC presents no difficulties. (Microsoft is working on a fix for the AMD problem.)
Once installed, users work through the Virtual PC Console. The console lists installed guest operating systems and provides quick access to settings. Guests run in separate windows.
Set global program options through File | Options. For the most flexibility, configure Virtual PC so that it has priority when running in the foreground, and set the host to have priority when VPC is running in the background.

A Linux Virtual Machine

This installation was tested on Red Hat 8.0. However, you should have no trouble doing a standard Linux install on other versions. Check the resources listed in the Virtual PC mini-faq for information about your distribution.
To begin installation, click the Virtual PC Console's New button. This summons the New Virtual Machine Wizard.
Click Next. Select Create a Virtual Machine. Click Next.
Enter a drive, folder, and name for the new virtual machine. If the folder does not exist, Virtual PC will offer to create it for you. Click Next.
From the lengthy drop down list of supported Microsoft guests choose Other. Click Next.
When Virtual PC suggests a RAM allocation for the new virtual machine, accept the default value or choose the option to modify this value. When you opt to adjust the default value, a slider bar will appear. RAM can be allocated in 1 MB increments (you can reallocate RAM any time a guest is powered down). Click Next.
In the Virtual Hard Disk Options screen, create a new VHD by clicking the radio button marked A New Virtual Hard Disk. Click Next.
Enter a drive, folder, and name for the new virtual hard disk (you'll probably want to store it in the same folder as your configuration file). Click Next.
Configuration is almost complete. Check your settings at the following summary screen. Use the Back button to return to any settings you wish to modify, otherwise click Finish.
Your new virtual machine will now appear in the Console, marked Not Running. You're ready to install Linux.

Installing Linux

Highlight the new virtual machine. Click Settings if you need to make any adjustments. For example, under Networking, use the drop down list to select NAT (Network Address Translation), to set up network sharing between the virtual and host NIC.
Next, place the first Linux installation CD in the CD-ROM and click Start. The new VM will power up in a separate window.
If you receive the following error message: Reboot and Select Proper Boot Device Or Insert Boot Media in Selected Boot Device.
you need to specify the location of your CD-ROM.
Select CD from the menu. Available drives will be listed, as well as the option, Capture ISO Image. Choose the drive letter containing the Linux installation CD.
Now the Linux CD install program will start.
To enter installation information, click the mouse pointer in the Linux window. This places focus in the guest OS.
Note: Any time you need to return focus to the host, press the right Alt key to release the pointer.
To install the guest operating system in Full Screen Mode press the right side Alt-Enter key combination. The same key combination will cancel full screen mode when you need to access the host OS
Configure the Linux installation as usual for your system, noting the following:
Setting video emulation
Regardless of the actual video card your physical hardware uses, the Linux installation program will find an S3 Trio64 card. Accept this card. The S3 Trio is the graphics driver emulated by Virtual PC.
Ignoring VM Additions
When you receive the warning, Virtual Machine Additions Is Not Installed on the Machine, click OK. There are no Additions for Linux.
Configuring your mouse
Choose a generic PS/2 mouse, either a two-button wheel mouse or a two button mouse.
Selecting a system
Red Hat 8.0 allows you to choose a preconfigured system, i.e. desktop, workstation, server, or to choose a custom installation. Choose the type of installation you prefer.
Creating a virtual disk
When the installation program prompts you to partition a virtual hard drive, don't be alarmed. Your actual physical hardware is not about to be erased. Partitioning will simply create a file on your hard drive that contains the virtual partition.
Note that unless you originally specified your virtual hard drive to be created at a fixed size, the size of the virtual disk will grow dynamically, as needed.
Click Yes to initialize the drive.
Virtual drives are simply large disk files that appear to be physical drives to the guest operating system. Partition them with no worries.
Configuring networking
During network configuration, accept the default Ethernet card eth0. Accept the DHCP settings unless you need to manually configure IP settings.
Configuring a firewall
During the Red Hat firewall configuration screen, accept the default medium security setting or modify it to suit your type of installation. It should be adequate.
That's it for manual entry. The setup program will now format the Linux file system and install the kernel and the packages you chose. The only difference from a hardware installation you'll notice is that it will take considerably longer through the virtual machine.

Configuring the X System

Toward the end of installation, you'll be asked to configure the Linux X system graphical interface. As noted above, the configuration program should detect an S3 Trio64 card. Accept this card. (Alternatively, you might try VESA 2.0 drivers, if available on your Linux install. Some people report they run better than the virtual S3 Trio drivers.)
No matter how many MB of video memory are suggested, only enter the value 8MB to match the virtual driver. If you don't, your screen may become truncated or garbled.
Make sure you choose only 16 or 32 bit color. 24 bit color is not supported.
In the monitor selection, accept the default value of unprobed monitor.

Recovering a Bad X Config

Let's say you ignore the above advice, as I did during the testing. When you run into problems with the X graphic system, i.e., your screen becomes frozen or useless, here's how to recover (actual commands may vary on your distribution):
First, reset the virtual machine. From the menu on the VM window, choose Action | Reset. Since Linux is all but installed at this point, you should be able to start Linux, though it will default to the console rather than the graphic mode.
If Linux reports problems with the file system, restart again, and when prompted, select a Forced System Integrity Check. Linux should self-repair the journaling system.
Next, log in with the account you set up during configuration and manually configure your X system. At the command line, enter redhat-config-xfree86. Use the suggested values this time.
Linux should then load normally. You may need to type StartX at the console.

Correcting time sync

Unlike supported OSs, Linux guests cannot sync the system time with the host (the previous workaround available for Connectrix Virtual PC no longer works). The current workaround is to configure Linux to use NTP (Network Time Protocol) to sync the time with an Internet-based time server.
In Linux, select Date/Time Properties from the main menu, or type at a terminal prompt (in Red Hat) redhat-config-date. When the interface opens, check the box marked Enable Network Time Protocol. Select a server from the drop down list. The NTP daemon will start and sync the time.

Emulating a sound board

To enable sound under Virtual PC, set up Linux to recognize a SoundBlaster SB16 sound card. Doing so many require that you run the program sndconfig in a terminal screen. If your system didn't install this device option by default, you will need to do so manually.
Run sndconfig as superuser in a terminal window.
Choose Sound Blaster 16 from the drop down list. Suggested card settings are:
  • I/O Port: 0x220
  • IRQ: 5
  • DMA 1: 1
  • DMA 2: 5
  • MPU I/O: 0x330
If the Sound Card Test doesn't play a sound, try adjusting your speaker volume. If it still doesn't work, prompt to overwrite the old configuration file with a new one.

Speeding the machine

These are a few standard methods for squeezing extra performance out of any guest OS:
  • Invest in RAM. More memory for the guest means faster virtual machine performance.
  • Use a separate hard drive for your virtual disks to increase data throughput.
  • Defragment the drive before installing virtual disks.
  • Consider using a fixed size virtual disk. Disks that grow dynamically are slower due to the extra file operations.
Since not every Linux distribution contains the same paths or programs, you may have to scratch your head a bit before successfully completing your installation. However, the effort is worth it, as VirtualPC runs a nice virtual Linux, even if Microsoft doesn't admit it.

About the Author

Michael Jackman is a freelance writer, columnist, and WFPL radio commentator based in Louisville, Ky. His tech articles appear frequently in Computerbits, CNET's TechRepublic.com, and The Snitch, for which he writes a monthly column on Technology and Crime. For more information and to contact Michael, see www.mjfreelancer.com.





Post a Comment

다음 이전