2007-05-01

Delphi 2007 in a RADical build - Part 2

After a sour harm and a rough weekend, here's part 2 of 4 in setting up your Delphi RADical Build.

In this part, we will configure the OS inside the VM to make it start/shutdown faster, require less memory and less CPU. This will shorten the time needed to get your dev environment up and running, even if for normal usage you can simply suspend it between usages which will make it restore faster when needed.

Option: Disabling Shutdown Event Tracker
Why...: Make it shutdown faster and unattended
How...: Run Group Policy Editor (start->run->gpedit.msc)
Browse to "Computer Configuration"->"Administrative Templates"->"System"
Double-click Display Shutdown Event Tracker from the System Setting list
Select the Disabled option button
Click OK and close Group Policy Editor

Option: Set a fixed-size Swap file
Why...: Avoid needless fragmentation of the swap file
How...: Right-Click My Computer, Properties, Advanced, Performance, Settings, Advanced, Virtual Memory, Change
If you allocated less than 1 GB of RAM to your VM, use a value equal to twice the allocated amount, otherwise you can use a smaller value.

Option: Modify performance settings
Why...: A server OS will default to give preference to services instead of applications.
How...: Right-Click My Computer, Properties, Advanced, Performance, Settings, Advanced
Select "Programs" in both options shown.

Option: Adjust Visual Effects
Why...: Not really needed for a dev machine and slow things down
How...: Right-Click My Computer, Properties, Advanced, Performance, Settings, Visual Settings
I disable all except "Show shadows under mouse pointer" as that one does improve the pointer a bit. If you absolutely like some other option, just leave it in.

Option: Disable Automatic Updates
Why...: Since we'll be reverting to a clean state on shutdown, it's pointless to have it auto-update
How...: Right-Click My Computer, Properties, Automatic Updates
Un-check the "Keep my computer..."
In part 1 (http://memyselfanddelphi.blogspot.com/2007/04/delphi-2007-in-radical-build-part-1.html), you should have already installed the critical updates, so your system won't be that outdated.

Option: Disable Memory Dump creation
Why...: Defaults to the same size of your memory, and for the most part is useless
How...: Right-Click My Computer, Properties, Advanced, Startup and Recovery
Select "None" on the bottom in the "Write debugging information" section.
You may also unselect "Automatically restart" (so you can see what's happening) and "Send an Administrative Alert".

Option: Disable Password Expiration
Why...: Pointless to change password when you revert to snapshot on shutdown
How...: Run Group Policy Editor (start->run->gpedit.msc)
Navigate to "Computer Configuration"->"Windows Settings"->"Security Settings"->"Account Policies"->"Password Policy"
Set "Maximum password age" to 0.

Option: Cut down on active services
Why...: Many services serve no use for a dev VM, so just keep the following.
How...: Using Service Manager, just set all non-essential services that are started and set to automatic to disabled. The following is the list of started services on my VM: it's a semi-conservative list where I leave some things enabled such as "Shell H/W Detection", that can be disabled afterwards before creating the snapshot.
Disable all started services except the following ones:
  • COM+ Event System
  • Cryptographic Services
  • DHCP Client
  • DNS Client
  • Event Log
  • HTTP SSL
  • IIS Admin Service
  • IPSEC Services
  • Logical Disk Manager
  • Network Connections
  • Network Location Awareness (NLA)
  • Plug and Play
  • Print Spooler
  • Protected Storage
  • Remote Procedure Call (RPC)
  • SBCore Service
  • Secondary Logon
  • Security Accounts Manager
  • Server
  • Shell Hardware Detection
  • Simple Mail Transfer Protocol (SMTP)
  • System Event Notification
  • TCP/IP NetBIOS Helper
  • VMware Tools Service
  • Windows Management Instrumentation
  • Workstation
  • World Wide Web Publishing Service
Option: Enabling AutoLogon
Why...: Make it start faster and unattended
How...: You can either edit the registry directly or use TweakUI (http://www.microsoft.com/windowsxp/downloads/powertoys/xppowertoys.mspx)
Using TweakUI is as simple as selecting Logon->Autologon.
You can also directly edit the registry, but there's no good reason for that: even if you don't want to install TweakUI, you only need to copy the .EXE from another installation to your VM and run it there: it does not need any support files or configuration.
Note: with server OSes, it appears to only work for "next" logon instead of "all" logons. Since I'm kind of uninspired to search for more info, you can simply do this step as the last step before creating a snapshot of the working VM. Then, whenever it shutdowns and reverts to snapshot, next start up will work just fine. If I find the inspiration to do the right searches and find some more info, I'll update this post.

This is about everything I do to cleanup my dev VM.

Next part, 3 of 4, will be about setting up Subversion and the continuous build, plus some examples of how to start using it.

8 comments:

C4 said...

Fernando,

This is great info. Thanks for posting it.

Charles Hodgkins
Alameda, CA

Unknown said...

Under "Disable needless services", you show a "list of started services on my VM". So I'm not clear on whether the services you list are ones you keep enabled, or ones you disable.

Fernando Madruga said...

Joe, you're 100% correct! That's what one gets when starting something one way and making a 180 degree turn midway! :)

I'll update it to be more clear.

Anonymous said...

Hi,

I usually create a separate virtual disk for the swapfile. That way if I want to backup the VM I can leave out that disk. Saves about 500 mbytes.

twm

Fernando Madruga said...

I used to do that as well, Thomas, especially when I was sharing a swap file disk between VMs, but nowadays I simply keep it all together.

Anonymous said...

Hi Fernando,

I am in the process of changing my development environment and am using your tips in these articles. My question is if your are continuing this serie with part 3 and 4?

Regards,
Jeroen.

Fernando Madruga said...

Jeroen: I'm afraid not, at least for some more time yet... I had a problem while using a disk repartitioning utility on my external 320 GB HDD that messed it up and thus I lost that VM configure in Parts 1 and 2... Continuing with Part 3, I'd need to spend quite a few hours getting everything ready as per parts 1 and 2 and then a few more hours creating/testing Parts 3/4... I'm approaching a dead-line with my current project and thus can't afford that time not until October or so... (But don't hold me on that October!)

Anonymous said...

I understand. Of course I won't hold you on October or anything else.
I continue configuring my development environment starting with
Delphi 7 and VMware. VMware is new for me but works awesome.
My main reason was it's a hell of a job to set up and maintain an environment.
That's why I did all development on my desktop machine and never on my laptop at the client. With VMware I can create an environment and use it on the laptop and desktop machine. The source should be kept on the server in subversion (now I use cs-rcs) so I can access it from remote sites.
Automatic backup to a remote site is an issue I need to solve first.

Thanks for your info so far.