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.
    Step 2
  3. Click Create virtual machine.
    Step 3
  4. Enter OpenSUSE 10.2 Generic LAMP Server as the Name:.
    Step 4
    Then click Next.
  5. Set the RAM: to 256 MB and make sure Use computer network connections is checked.
    Step 5
  6. Select the Use an existing virtual hard disk radio button and then browse to the VHD file.
    Step 6
    Then click Create.
  7. With the virtual machine selected click Open to run the VM, when the following screen shows, press the Esc key.
    Step 7a
    Now you can see why it takes a little bit longer to start up on the first run than normal.
    Step 7b
  8. Login as root, start Yast and fix the networking as per Tim’s web page.
  9. If you want Num-Lock always on, then go to Hardware-Keyboard Layout, Expert Settings and set Num Lock On to Yes.
  10. Next add these kernel boot options at System-Boot Loader, openSUSE 10.2. Add noreplace-paravirt i8042.noloop clock=pit between splash=silent and showopts elevator= .  Note: I found that without the clock=pit option the clock gains 1 to 3 seconds every minute.
  11. The last setting to change in Yast is under System-Date and Time. Change Hardware Clock Set To from UTC to Local Time.
  12. Exit Yast and reboot.
  13. Login as root then enter the poweroff or halt command and wait for the message The system will be halted immediately.
    Step 13
    Click the standard Windows close icon, select Turn Off from the drop down list and click OK to force the VM to the Powered down state. (This may be an openSUSE 10.2 bug)
  14. The next configuration change is done by manually editing a file, so this is a good time to turn on the Undo Disks feature of WVPC. Open the settings for the VM, check the Enable Undo Disks option and click OK.
    Step 14
  15. The default configuration for most Linux Distros is to blank the screen after ten minutes of inactivity. This is a good idea for real computers but totally unneeded for a VM. To disable the screen blanking, open the VM, login as root then edit /etc/init.d/boot.local, to add setterm -blank.
  16. Shutdown then restart the VM, login and let it sit idle for more than ten minutes to verify that the settings change worked. If it works then shutdown the VM, go to the VM settings Undo Disks section and click the Apply Changes button.

That completes my modification and testing of the VM, now I have a functional LAMP server to play with. There is still one issue with this VM, for some reason root’s bash history does not seem to update. I tried deleting the history file but that didn’t help, someday I’ll figure it out and update this post.