Synergy
THE COMPANY . CONTACT
Home > Blog > MOSS Blog > Posts > Building a Dev Environment on Windows Server 2008 and Hyper-V

 Posts

Building a Dev Environment on Windows Server 2008 and Hyper-V
Randy Williams

As a trainer and consultant, one of the common questions I get is how to build a development environment. Those who know me well understand that I usually answer this by doing as much development locally. That is, using shared development servers for multiple developers usually causes many problems with required IISRESETs, remote debugging, managing different configuration states, etc. It's just a real pain.

Ok, so we will develop locally. Do we go with XP, Vista, 2003 server or the new 2008 server? XP is pretty good, but it's getting old and future support is questionable. I know I'm not the only person alive frustrated by various annoyances in Vista. These are particularly troubling as a .NET developer. Server Operating Systems (OS) work well but may be expensive from a licensing standpoint. Of course, please check with your IT admin team to be sure you are in line with corporate standards.

Virtualization

Another challenge is how to deal with the different configuration environments we might need. This is where virtualization technology comes in nicely. Whether you are using VMWare or Microsoft products, this adds enormous value and flexibility to a development team. If you are not currently using virtualization for your dev environment, you should be.

Those following the Windows Server 2008 (W2K8) product might be aware that Microsoft has recently released Hyper-V, which is their hypervisor engine. It replaces their Virtual Server 2005 product and is intended to better compete with VMWare VSX technology.

So, recognizing two immutable facts: #1, I really don't like Vista and #2, I love virtualization, I decided to rebuild my laptop (Dell Latitude D830) with W2K8. Let me provide a bit of background with my needs and prior dev environment:

My focus is on SharePoint development nowadays which has a number of moving parts such as SQL Server, IIS, Visual Studio, and, oh yeah, SharePoint itself. My host operating system (OS) had been Vista (32 bit) running Virtual PC 2007. I have 4GB of RAM, and I usually dedicate 2GB for my guest OS's. I usually work with several different virtual machines (VMs), but normally only one at a time.

W2K8 Installation

For the W2K8 install, I had two options: 32 bit or 64 bit. Well, of course, who wants the smaller number of bits?!? My laptop supported it, so let's go for it: I backed up necessary files to my external hard disk (such as the VM VHD's) and reformatted the disk for a fresh 64 bit install. The install went great, and I made a number of configuration changes to enable the desktop experience and Wireless LAN support. There are a number of great posts that already discuss how to configure W2K8 as a desktop OS, so I recommend reading them to save you some time. Here is one and another. I also installed my usual suite of apps (Office 2007, Skype, Office Communication Server, Acrobat, iTunes, etc). When possible, I tried to find 64-bit versions to ensure best compatibility and performance.

I then installed the final release of Hyper-V and reconfigured my existing Virtual PC VMs inside Hyper-V. This wasn't a trivial step because of the incompatibility between Virtual Machine Extensions and Integration Services (the equivalent technology inside Hyper-V). These enable you to more seamlessly work with the VM. For example, it's easier to use the mouse to work within the VM or outside of it. For some VMs, I was able to uninstall the Virtual Machine Additions, in other cases, the uninstall would fail. Without uninstalling, I was unable to install Integration Services. My workaround was to uninstall Hyper-V and install Virtual PC 2007. I then fired up each remaining VM and uninstalled Virtual Machine Additions. I then uninstalled Virtual PC 2007 and reinstalled Hyper-V. It was a pain but only cost me about an hour of time.

The first thing I noticed was the performance boost. I did some informal timings, and I would guess that overall, the VM inside Hyper-V ran about 20% faster compared to Virtual PC inside Vista. Nice. Keep in mind these VMs are all 32 bit (more on this later).

Drawbacks

The second thing I noticed where three drawbacks to this environment. 1) Inside Hyper-V, you cannot connect your VM to your Wireless NIC. This would be great when I am travelling around (to include my kitchen) and want Internet access from my VM. There are some workarounds that are mentioned in blog articles, but nothing that is easy that I found. 2) Unlike Virtual PC (but just like Virtual Server 2005), you cannot just drag and drop files from the host OS to the VM. This is a bummer as I do it a lot and is super convenient. 3) Copy/Paste features do not transfer between host OS and VM. Ok, this is almost a show stopper as I am doing this all the time. Workarounds exists for #2 and #3, but not for #1.

My workaround for #2 and #3 is to set up the VM with a secondary network adapter. I configured this to use the IP address of 10.0.0.x (mask of 255.255.255.0). On my host OS, I set the Virtual NIC (added by Hyper-V) to use 10.0.0.100 (mask of 255.255.255.0). Ok, so I can now connect between host and guest using this private network. I then enabled remote desktop in each of my VMs. From the host OS, instead of connecting to the VM using the Hyper-V interface, I just use remote desktop. I also adjusted the Local Resources to ensure the guest VM automatically has a network connection to my host disks (see Figure 1). This is an acceptable workaround for #2. Since I'm using remote desktop, copy and paste (#3) also works.

RDP Settings

Figure 1: Using Remote Desktop to connect to host OS from VM

64 Bit Guest VMs

I already mentioned the performance gain when running my 32-bit VMs inside Hyper-V. At this point, I was dying to see how a pure 64-bit image would work inside Hyper-V. So, I proceeded to build out a fresh VM with 64-bit W2K8, 64-bit SQL Server, 64-bit Visual Studio 2008, and 64-bit MOSS. Even during the install, I noticed that everything hummed along very quickly. I had everything installed and ready to go in less than four hours. (Note: I've had bare-metal installs with the 32-bit versions of these tools take longer).

What was the net performance gain during my real testing? Wow. I would guess that it is at least twice as fast as the original 32-bit install I had when under Vista. It truly flies. For example, in SharePoint development, you are often running IISRESET or resetting app pools. When I would do this under my 32-bit world, a refresh of the main portal in the browser would take about a minute. It now takes about 20 seconds. I should add that part of this is because it's native 64 bit, and part of it is improvements in IIS 7 and W2K8.

One caveat I should add is that my 64 bit VM cannot be used with Virtual PC 2007. So, for at least this VM, I am committed to Hyper-V. I'm fine with that!

Conclusion

To conclude, I am very happy with my new 64-bit world. W2K8 is a vastly improved OS when compared to Vista. Performance is great from both the host and guest side, and I've had to sacrifice very little. I strongly recommend to others that are considering an upgrade to their environment to give this a shot. I doubt you'll be disappointed, and I'm sure you won't miss the 32-bit days… Good luck.

Final Note: For those that are developing for SharePoint using VS.NET 2008, you should be aware that the Visual Studio Extensions for WSS v1.2 is not currently compatible with a 64-bit OS. John McBride has posted an excellent, but unsupported workaround for those in need. Hopefully, this will be corrected soon.

Comments

There are no comments yet for this post.
Items on this list require content approval. Your submission will not appear in public views until approved by someone with proper rights. More information on content approval.

Title *


Body *


Posted By *


Attachments

Phone Number CLIENT LOGIN . CHANGE LOCALE . LIVE MEETING LOGIN . BLOG . PRIVACY POLICY . SITE MAP