VM setup for Virtual Server

I have some notes I made on setting up Virtual Machines to run under Virtual PC 2007 and as I’ve moved over to using Virtual Server 2005 RC2 and Remote Desktop I thought I’d write them up for Virtual Server. I’m installing XP VMs into a Virtual Server on Vista Business. YMMV.

Here are some general points about creating a tidy VM that you can then use as the parent for a differencing disk.

  • The default is a 16GB NTFS partition. Fixed disk sizes would be a problem as I create a hierarchy of differencing disks. Adding more disks is fine but it’s a pain to manage (other than perhaps a ‘Data’ disk that can be attached to any VM – pretty handy). The supposed performance gains aren’t documented. I’d set my base disk to be a 32768MB dynamically expanding disk in most cases.
  • Enable NTFS file compression on dynamically expanding disks. Right-click on the .vhd > Properties > General > Advanced > Compress contents to save disk space.

After doing the base install of the OS you’ll want to set up a few essentials:

  • Turn on Microsoft Update.
  • Install Sysinternals Contig on the host machine and create a scheduled task (Control Panel > Scheduled Tasks in XP or Administrative Tools > Task Scheduler in Vista) to defrag the .vhd every day.
  • Set up a task inside the VM to regularly defrag the virtual hard disk. This apparently makes a difference.
  • Exclude VMs from antivirus scans. I’ve installed AVG Free Edition Anti-Virus and it seems to ignore the .vhd files in real time scans. You should still install antivirus and firewall apps into the VMs of course.
  • Turn off the VM’s bleep:

    net stop beep
    sc config beep start= disabled

  • Disabling GUI effects is likely to be a small performance gain and anyway can be managed through your Remote Desktop configuration.
  • This one is only relevant to a Server 2003 install. Turn off the Shutdown Event Tracker (annoyance) through the Group Policy Object Editor Console:

    $> gpedit.msc

    Computer Configuration > Administration Templates > System
    “Display Shutdown Event Tracker”
    disabled

    $> gpupdate /force

  • Turn off screensavers, etc..
  • Empty the DLL cache

    sfc /cachesize=1
    sfc /purgecache

  • Create an empty paging file by doing the following. Configure no paging file, restart the VM, create a normal paging file.
  • Obviously, compact the virtual hard disk. Easily done through the Virtual Server Administration Website. The compact option is available only for dynamically expanding virtual hard disks. Note that you can’t compact a differencing disk. To create a smaller VM that you could cut to, for instance, a DVD then merge with the parent into a new file and do the compaction then.
  • Sysprep. If you’re going to have more than one copy of the VM on a network then you’ll need to sort out the MAC etc.. I tried to do this but it required the Server service to be bounced as it was complaining “there is an incompatibility between this tool and the current operating system”. Then it decided it wouldn’t do it for “computer that is a member of a network domain”. I don’t know enough AD admin to sort this out. So I’d resort to using Sysinternals NewSID if it’s required.

Also, and this is just for the sake of ease of use, you really want to go through the settings on apps like IE and set them up how you like them. I’d also recommend going through the Windows Components and uninstalling all the cruft (Games, MSN, Outlook Express, Windows Media Player, Windows Messenger etc.).

It’s up to you whether you want to install Office, VS.NET and SQL Server to this base install to make your dev machine or just Office or whether you want to kick off a differencing disk now. Another option is just to take a copy of the virtual hard disk in case you want to set up a different set of apps on a base install later. A final note; I seem to get along just fine with 1GB of RAM given over to each VM, 512MB for Server 2003.

Technorati Tags: , ,

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s