A LAMP Server for Windows Virtual PC

My first Linux VM was a very easy one to setup because the setup had already been done. It’s a  Downloadable Quick & Dirty LAMP Server from Tim Wray.

While it works to simply extract out the settings and virtual hard drive files and run the VM, I noticed that the setting XML file is substantially different for Windows Virtual PC than it was for Microsoft Virtual PC 2007. This includes the amount of video RAM so I decided to create a new settings file and, with Tim’s great instructions on how to fix the one problem that crops up, it is painless. The following instructions assume you know how to use basic Linux commands as well as the openSUSE text mode Yast configuration program.

  1. Extract the OpenSUSE 10.2 LAMP Server (PHP 5.2.11 MySQL 5).vhd file to the location for your installation. Should be C:UsersxxxxxxAppDataLocalMicrosoftWindows Virtual PCVirtual Machines where xxxxxx is your user name.
  2. Open Windows Virtual PC.
    Continue reading “A LAMP Server for Windows Virtual PC”

Linux as a Guest OS in Windows Virtual PC

To be absolutely clear what I’ll be writing about in this and future posts is the Windows 7 Pro (and higher) add-on Windows Virtual PC (WVPC). It is a descendant of the general purpose Microsoft Virtual PC but is different in that it was modified specifically to facilitate the Win7 XP Mode feature. Basically Microsoft intends WVPC to allow the running of XP, Vista and Windows 7 guests on a Windows 7 host, they do not support any other guest OSs. However they did not remove the capability to run other OSs they simply did not update some useful features for other OSs and they removed the integration components for Windows versions older than XP.

Getting any Linux distro setup on WVPC is not something the average user should attempt. If you want to try out different Linux distros and have all their features work you should definitely use different virtualization software. VirtualBox and VMWare are much easier to use and will let you properly evaluate distros.

I decided to play around with Linux on WVPC for a number of reasons.

  1. I already use it for XP Mode and when an app is running it isn’t obvious that VPC is running. If I had another virtualization platform installed I could accidentally run it at the same time which could crash Windows badly. So to be safe only VPC will ever be installed on my Win7 PC.
  2. I occasionally need to run software that is only available on Linux e.g. the libpst library
  3. Having played around with Linux on and off since 1998 I actually find it fun to dig into the OS guts to get it working on unsupported hardware. I still remember the thrill of compiling a newer version of the kernel for the first time and it making a new system work.

In later posts I’ll detail how I got specific distros running but for now I just want to cover a few generic tips. The first tip is don’t expect to find a lot of useful information on the net. Most discussion threads about this topic quickly end with the person asking for help being convinced to give up and just use VirtualBox or VMWare. Most of the blog posts you’ll see are for Microsoft Virtual PC 2004 or 2007, products that officially supported Linux as a guest OS so they often are not applicable to WVPC.

Tip number two is lower your expectations, don’t expect to run X-Windows in high resolution, watch video or listen to music. Much of the problem stems from the fact that there are no integration components supplied for newer Linux distros. If you look in  “C:\Program Files\Microsoft Virtual Server\Virtual Machine Additions” you’ll see that the old additions for Linux are there but since they have not been updated since 2007 they are basically useless.

The third tip is to expect that you will need to add kernel boot parameters to get any install going reliably and then you may need to manually add some of them to the GRUB configuration after a successful install. In my playing around so far I have found that noreplace-paravirt, i8042.noloop and clocksource=pit (clock=pit for older kernels) are the minimum. In some cases you may also need a vga=788 option as well. There is an old blog post from 2009 that explains the first options fairly well. In addition to what is said in that old post about the clocksource option, Ben Armstrong of Microsoft posted in 2006 about how the clock option prevents a key repeat problem. For even greater detail on the clocksource option read this Microsoft Knowledge Base article.

The next tip is only if you are a die hard numeric keypad user like me. I hate when Num Lock gets turned off, an accountant at work showed me how much more efficient data entry is with the keypad way back in the 1980s. After all this time my hand instantly goes to the keypad anytime I’m entering more than a couple digits so I find I just can’t live without it. To ensure the Num Lock stays on you have to set the VM BIOS option and usually set it in the OS as well. To set the BIOS option, press the Delete key as soon as the VM window opens to access the VM BIOS settings. Change the Advanced-Boot Setting Configuration-Bootup Num-Lock setting to On. Then press F10 to save and exit the BIOS settings.


A final note on Num Lock, some guest OSs will toggle Num Lock on/off during the boot process. If the VM window looses focus during this time the Num Lock state may end up set incorrectly.

The last tip is about WVPC video RAM, the default setting when you create a new VM is 16 meg, the maximum supported, but it can be decreased by manually editing the XML file if you wish to save on host RAM. Although the VM has 16M, so far I’ve found that the amount detected by Linux is never 16MB. Some query mechanisms have returned 64M but all the ones that count always seem to detect only 4MB. I suspect the only way to resolve this would be to write a custom display driver, a task that presently I don’t think is worth the effort.

Blogroll is back

The blogroll on the left side has been empty for a long while. It used to be automatically updated via a  Google Reader feature but since the demise of Reader it stopped working. I hadn’t found any way to replace it with another automated system so today I manually created a blogroll. To avoid typing too much I exported my feeds from Feedly as OPML then converted that to a CSV file using this utility web service. Finally I re-arranged, cleaned up and deleted the extra data from the CSV in LibreOffice Calc and added a formula to make <a href> links out of the names and urls. Then I simply pasted the resulting list into a WordPress text widget.