I’m working with Hyper-V since more than 1 year and now I’m migrating the developer images of my company from Virtual PC or Virtual Server 2005 to Hyper-V. For me the process is straightforward since I have done it a lot of times last year but I thought this might be interesting for someone else.

This guide doesn’t use any third party tools or the System Center Virtual Machine Manager and it doesn’t include clustering. For a list of Hyper-V supported guest operating systems please read About Virtual Machines and Guest Operating Systems. There are also a lot of information at TechNet:

If you are interested in Hyper-V networking with a Loopback Adapter you might want to take a look at the following articles:

In my case I had to migrate a virtual machine from Virtual PC 2007 SP1 to Hyper-V so you will see Virtual PC instead of Virtual Server 2005 in the screenshots.

Prepare the virtual machine

Before you can run the image with Hyper-V you need to prepare the virtual machine using Virtual PC or Virtual Server.

Document your virtual machine configuration

First of all you need to remember your virtual machine configuration so you can recreate it later with Hyper-V. Without 3rd party tools you need to write it down or to make a screenshot.

Remember your virtual machine configuration so you can recreate it later with Hyper-V.

As you can see in the picture I’m using 2 virtual network adapters: one for the communication between the images and one for getting access to resources outside your image (file share, internet). The communication between the images is faster using a local network adapter.

Important: “You cannot use a SCSI disk to boot a virtual machine in Hyper-V. If the boot disk of your virtual machine is not IDE, you should change it before migration. You can use a script for changing virtual machine disk type to automate changing the disk controller configuration type from SCSI to IDE. The script is available at http://go.microsoft.com/fwlink/?LinkId=135672.” (from the Virtual Machine Migration Guide)

Update your operating system with required updates and hotfixes

You need to update your image in order to meet Hyper-V guest operating system requirements. At the beginning of this guide you can find the requirements.

Installing Windows Server SP2. You need to update your image in order to meet Hyper-V requirements.

In my case I needed to update Windows Server 2003 SP1 to SP2. Otherwise you can’t install the Hyper-V Integration Services.

Uninstall the virtual machine additions

After installing all necessary updates you need to uninstall the Virtual Machine Additions. In Windows Server 2003 you can do this using Control Panel – Add or remove programs.

After installing all necessary updates you need to uninstall the Virtual Machine Additions.

After uninstall I restart the image in order to be sure everything worked fine.

Remove network settings and shut down virtual machine

Before you shut down your image you need to remove the network settings. Since Hyper-V Integration Services will install new network adapters you will get an error message when you try to reuse static IP settings.

After removing the network settings you need to shut down the image. Using a saved state will not work.

Create Hyper-V virtual machine

Now it’s time to get the image working with Hyper-V.

Create the virtual machine

At first I created the virtual machine using the Hyper-V wizard. Here you need the settings documented in the first step.

Creating a virtual machine configuration with the dopcumentes settings. 

Install Hyper-V Integration Services

When you connect to a Hyper-V image a console will open where you can select Action – Insert Integration Services Setup Disc from the menu (no need for searching the .iso file manually ;) ). This will automatically start the setup.exe inside the image.

Installing the Hyper-V Integration Services.
At first a new HAL will be installed and after rebooting the rest of the Integration Services will be installed which needs a second reboot. Please be aware that you need an install disc of your operating system if you deleted all drivers from your Windows folder. I did it when I created the image since it saved a lot of disc space and doing a copy of my image needed less time.

Recreating network settings

At the end you need to recreate the network settings since the Hyper-V Integration Services installed new network adapters.

Recreating the IP settings of the virtual network adapters.

If you didn’t remove static IP addresses at the end of the preparation process you will get an error message saying that the IP address is already assigned to an other network adapter. You can chose no if you don’t want to assign a new IP address. Using the same address worked for me without errors so far.

Conclusion

When doing a migration from Virtual PC or Virtual Server 2005 to Hyper-V you need to take care of a few things. Although I don’t have a cluster I can imagine that this might not be straightforward like it is written in this post.

Posted on: January 19, 2009  

Hyper-V – Tips and tricks – Part 1

Since I’m using Hyper-V in order to run my 64bit SharePoint 2007 / Windows Server 2008 development environment I have collected some useful tips and tricks over the time. Today I want to show you how you can clean your virtual hard disk from files taking up more than 3 GB of hard disk space.

Important: Since I use Hyper-V as my development environment I don’t recommend to do these things in a production environment!

Disk Cleanup

You can save up to 100 MB or 200 MB by e.g. removing temporary files.Usually you can do this by opening the properties of a local drive and then click the Disk Cleanup button. When using Windows Server 2008 you manually have to activate the features you need which makes Windows Server 2008 the better workstation for a SharePoint developer compared to Windows Vista .

In order to activate the Disk Cleanup button you need to install the Desktop Experience feature in Server Manager:

image

c:\windows\installer\

This folder took 2.67 GB of my hard disk space so I decided to remove the content of the folder which I don’t recommend in production environments. This folder stores files for the install and uninstall process of programs. Some files may be used in the future so removing the contents of the folder may lead to problems. For me as a developer deleting the content in my Hyper-V virtual image was ok.

image image

I removed the contents of this folder.

image image

Update 2009.01.22: Deleting the folders with the GUID is not a good idea because Office 2007 will not work and the Office Server links will loose their icons.

c:\msocache

If you install Office 2007 on your computer this folder is created to stores installation files. If you want to add components to your Office 2007 installation the installer takes the needed files from this folder. By deleting the contents of this I freed another 600 GB of hard disk space. If you want to add features to your Office 2007 installation you then need to insert the DVD or mount an image so the installer can access the needed installation files.

Conclusion

After deleting the files and folders you should defragment your virtual hard drive and after that you should compact the disk by using the Hyper-V Virtual Hard Disk Wizard.

image

I did comparable things with my Virtual PC 2007 and Virtual Server 2005 SP1 images and never experienced any problems as long as you use the virtual image as a developer image. You can do it too but you should take a closer look if this is suitable in your situation. Later on in the year 2009 there will be Solid State Disks for everyone and I think we don’t need to care about some GB of disk usage since you can copy large files with an incredible speed.

Update 2009.01.22: Please do it only if you understand and know what you are doing. ;)

This is the second part of installing Exchange Server 2007 with Service Pack 1 on Windows Server 2008. You can see the scenario and the required features and server roles here: Installing Exchange Server 2007 with Service Pack 1 on Windows Server 2008 - Part 1.

Installation screen of Exchange Server 2007 with Service Pack 1

Pre-installation

Before you can start the installation you have to install the following components:

  • .NET Framework 2.0
  • Microsoft Management Console
  • Microsoft Windows PowerShell

You can either install the PowerShell by using the command line or you can use the Server Manager to add the required PowerShell feature. If you want to use the command line run the following command:

  • ServerManagerCmd -i PowerShell

Installing PowerShell by command prompt.  Successfull installation of PowerShell by command prompt. 

You can also use the Server Manager:

Installing PowerShell by using Server Manager 

Finally we can start the installation of Exchange Server 2007.

Installation

  • Click next at the introduction screen.
  • You can then turn on or off the error reporting.

Click next at the introduction screen. You can then turn on or off the error reporting.

  • Choose the typical installation of Exchange Server.
  • If you have Outlook 2003 clients in your environment choose yes, if not choose no.

Choose the typical installation of Exchange Server. If you have Outlook 2003 clients in your environment choose yes, if not choose no.

  • After that your system will be analyzed if all required features are installed.
  • If all required features are installed you shouldn't the the following screen with the red bullets.
  • If you get the error message "Setup cannot detect an SMTP or Send connector with an address space of '*'." you can refer to the following article: http://support.microsoft.com/kb/556055/en-us.

After that your system will be analyzed if all required features are installed.  If all required features are installed you shouldn't the the following screen with the red bullets.

  • Now you can start the installation process.

Now you can start the installation process.

  • After finishing the installation you have successfully installed Exchange Server 2007 in your environment.

After finishing the installation you have successfully installed Exchange Server 2007 in your environment.

Please not that this is not a best practice article on how to deploy Exchange Server in a production environment.

In this article I will describe how to install Exchange Server 2007 with Service Pack 1 on Windows Server 2008. Scenario: I have installed Windows Server 2008 and configured the Active Directory role. Installing Exchange Server on a Domain Controller might not be suitable for a production environment. ;)

Installation screen of Exchange Server 2007 with Service Pack 1 

Prerequisites

Before we can start the installation we have to configure the Windows Server 2008 installation. Depending on the Exchange Server roles you have to install different Windows Server 2008 roles and features.

Exchange Server roles

These are the roles offered by Exchange Server 2007:

  • Hub Transport Server Role: Used for message routing.
  • Client Access Server Role: Provides the Outlook Web Access Interface.
  • Mailbox Server Role: Used for hosting mailbox stores.
  • Unified Messaging Role: Interface between Exchange and a compatible PBX phone system.
  • Edge Transport Role: Used to filter out viruses and spam before routing them to the internal network.

Exchange Server roles prerequisites

Since I don't need the Unified Messaging Role and the Edge Transport Role I will only install the prerequisites for the following roles:

Hub Transport Role Prerequisites

  • IIS6 Metabase Compatibility
  • IIS6 Management Console

Client Access Role Prerequisites

  • World Wide Web
  • IIS6 Metabase Compatibility
  • IIS6 Management Console
  • IIS7 Dynamic Content Compression
  • IIS7 Static Content Compression
  • IIS7 Basic Authentication
  • IIS7 Windows Authentication
  • IIS7 Digest Authentication

Mailbox Role Prerequisites

  • World Wide Web
  • IIS7 Dynamic Content Compression
  • IIS7 Static Content Compression

Installation of Exchange Server roles prerequisites

  • Select the Web Server (IIS) role and add the required features.

Select the Web Server (IIS) role. Add the required features.

  • Select the ASP.NET feature and all the checked features you can see in the pictures.

Add ASP.NET features 

  • After that you can finish the installation.

If you have selected all features you can start the installation.The installation has finished. 

Now you have all the Windows Server 2008 roles and features configured so you can start the installation of Exchange Server 2007 with Service Pack 1.

As I have written several times I use a virtual environment to develop SharePoint 2007 solutions. Some of the articles are:

Right know I switch between Virtual Server 2005 and Hyper-V. If you are thinking about running SharePoint 2007 in a Hyper-V virtual environment the following articles by Microsoft  are a must read:

Hyper-V basics

Hyper-V Windows Server 2008 role picture

I have written about the basics at my companies SharePoint blog: Windows Server 2008 Hyper-V: Windows Server 2008 Hyper-V is the Hypervisor based Virtualization function of Windows Server 2008. As you know Virtualization has a lot of advantages like running more than one server on a physical machine or higher security when separating server functionality. Hyper-V uses the native Virtualization method where the Virtual Machine Manager runs directly on the hardware. This is a huge performance gain compared to hosted Virtualization where the Virtual Machine Manager gets the resources from the operating system.

If Hyper-V is activated the partition with the host operating system (parent partition) is treated like the partitions with the virtual machines (child partitions). Both of them consume resources from the Hypervisor. The Virtualization stack, the process and the wmi provider for managing the virtual machines are located in the parent partition.

Supported Hypervisor technology

SharePoint Products and Technologies supports

Hyper-V prerequisites

Hyper-V is a role that can be turned on if your Windows Server 2008 installation meets the following requirements:

  • The OS runs on a machine with a x64-based processor.
  • Your machine supports hardware-assisted Virtualization.
  • You have hardware data execution protection turned on.

Hyper-V recommendations

The following recommendations are written in the articles Using SharePoint Products and Technologies in a Hyper-V virtual environment and Performance and capacity requirements for Hyper-V. For more details please read the articles. A short summary:

In general

  • Use Windows Server 2008 as the guest operating system.
  • Install integration components (ICS).
  • Install the Hyper-V update for Windows Server 2008 (KB950050) on the host and guests.
  • "Do not use the Hyper-V snapshot feature on virtual servers that are connected to a SharePoint Products and Technologies server farm. This is because the timer services and the search applications might become unsynchronized during the snapshot process and once the snapshot is finished, errors or inconsistencies can arise. Detach any server from the farm before taking a snapshot of that server."

Networking

  • Use IPv4 as the network protocol for Hyper-V guests and disable IPv6. (Update 18. November: I don't recommend this when running an Exchange Server 2007 on your image)
  • Use Private or internal networks. "Private networks and internal networks do not use the physical network card or cable, so communications are faster and network congestion is minimized. You can take advantage of this network performance gain by creating an external network for the Web front-end servers and by creating a private or internal network for the application and SQL Server database servers."

CPU and hard disk

  • Use a fixed-size virtual disk for hosting the Index role or SQL Server. You can use a dynamically-sized disk for hosting the Query role or Web Server role.
  • "Do not use more virtual CPUs than there are physical CPUs on the Hyper-V host computer. Although Hyper-V will allow you to allocate more virtual CPUs than the number of physical CPUs, this causes performance issues because the hypervisor software has to swap out CPU contexts."

In Part1 I described the scenario consisting of a Loopback adapter which didn't work after installing Hyper-V.

Before installing the Hyper-V role I selected to use my Loopback Adapter as a "Hyper-V virtual network". After Windows Server 2008 configured the role I had a new network adapter with a similar naming as my Loopback Adapter. I don't know if this one was newly created or the original Loopback Adapter was modified. I have renamed the "new" adapter to clearly identify it as a Hyper-V virtual network adapter.

The new Hyper-V created virtual network adapter.

Anyway I had the "original" Loopback Adapter with all the items before I installed Hyper-V. All items? No, because my non Hyper-V Loopback Adapter had limited connectivity. As you can see in the next picture the "Virtual Machine Network Service" was not checked.

The Virtual Machine Network Services are not checked. The Virtual Machine Network Services are now checked again.

You have to check this item and then close the network connections. After that you need to recreate your Virtual Server 2005 virtual network because it is now missing. Click "Create..." and select your non Hyper-V Loopback Adapter. Now you can connect from your laptop to your image and from your image to the Internet.

Recreate your Virtual Server 2005 virtual network which used the Loopback Adapter.  The Loopback adapter has now connectivity.

If you still have limited connectivity reboot your host...