Are you out in the field more than you’re in the office, with little to no access to a lab for issue reproduction or product testing? Maybe you’re looking for an easy way to demonstrate a feature to your customer, but you don't like the idea of lugging around a separate system. If either of these scenarios sound like yours, then read on.The purpose of this article is to demonstrate an alternative build option that will allow for multi-product testing and feature evaluation when multiple physical machines or remote virtual host environments are unavailable. This article (and the associated Sniper-V TechNet blog) covers building a Windows client platform that you can use for corporate applications and productivity, as well as a Windows Server platform, with Hyper-V enabled, that you can use for testing and customer demos.
This configuration is ideal when you’re creating documentation, performing demos, or simply verifying a setting or feature. Customers typically have an issue with vendors placing their devices on the production network, and air card signals can also be a challenge.If you’re comfortable with installing OSs (whether from DVD, Preboot Execution Environment—PXE— booting, or a USB thumb drive), following Diskpart directions, and backing up and restoring your system, you have all the expertise you need to set up your machine with this clean, functional, multi-boot configuration—a configuration that also makes backing up and restoring your lab machine a breeze because you’d be dealing with Virtual Hard Disk (VHD) files.
The Boot OptionsLook at each choice below, and choose the correct boot option based on your desired image.
- Installing from PXE boot. Perform the PXE boot, and press F12. Select a Windows client\server installation image that doesn’t use the Operating System Deployment (OSD) wizard. (You need to get to the default Windows installation screen.)
- Installing from DVD. Verify that the BIOS is configured to boot from DVD. Then, boot from DVD and allow files to load until you get to the default Windows installation screen.
- Installing from USB. Verify that the BIOS is configured to boot from USB. Then, boot from USB and allow files to load until you get to the default Windows installation screen.
The first thing you’ll need to do is boot your laptop using a Windows 7 DVD, PXE Boot, or USB bootable drive. At the Windows installation screen, press Shift+F10 to open a command prompt. You’re going to clean the existing hard disk and create both VHDs. To do so, follow these steps:
1. Type diskpart, and press Enter.
2. Type list disk, and press Enter.
3. Type select disk #, and press Enter (where # is the number of the disk on which you want to create your VHD)
4. Type clean, and press Enter. (Warning: This step will remove references to any data on the disk.)
5. Type list disk, and press Enter. (You should see the disk you selected, with all the disk space free)
6. Type create part pri, and press Enter.
7. Type format fs=ntfs quick, and press Enter.
8. Type list vol, and press Enter. (You should see a new volume created and selected, formatted NTFS.)
9. Type select volume # (where # is the number of the volume where you want to create your VHD).
10. Type assign, and press Enter.
11. Type list vol, and press Enter. (A drive letter should now be assigned to the volume.)
12. Type create vdisk file=“C:\win7.vhd” maximum=40000 type=fixed, and press Enter. *
13. Type create vdisk file=“C:\Srv2K8R2.vhd” maximum=40000 type=fixed, and press Enter. *
Figure 1 shows the two VHDs that are created.
In the final two steps, the drive letter and file path should match those of your configuration. Drive size is optional (This example uses 40GB.) We recommend setting both to fixed size, rather than dynamic, to support BitLocker. In the next section, we’ll talk about selecting the proper VHD and installing the OS.
OS InstallationNow that your two VHDs have been created, you’ll select the Windows 7 virtual disk, format it, and install the OS. When you’re done, you’ll have a working Windows 7 installation within the VHD. While still within the command prompt window, follow these steps to select the VHD, format the virtual partition:
1. Type select vdisk file=“C\win7.vhd”, and press Enter.
2. Type attach vdisk, and press Enter.
3. Type create part pri, and press Enter.
4. Type format fs=ntfs quick, and press Enter.
5. Type list vol, and press Enter. (You should see the VHD volume without a drive letter.)
6. Type list disk, and press Enter. (You should see the VHD disk in addition to your physical disk.)
7. Type exit, and press Enter to end the Diskpart utility.
8. Type exit, and press Enter to return to the Windows installation screen.
9. Follow the onscreen OS installation steps as you normally would, making sure to select the 40GB partition as the destination drive.
A note about Windows Server 2008 R2: After you successfully install Windows 7, and you’re ready to proceed with installing Server 2008 R2, you’ll need to boot your system with the Server media, then press Shift+F10 at the Windows installation screen. Type diskpart, and press Enter. Next, you’ll repeat the same steps (above), with the only exception being the first step, which you will replace with
1. Type select vdisk file= “C:\Srv2K8R2.vhd”, and press Enter.
Hyper-V RoleTo run multiple OSs concurrently on a single CPU, a hypervisor is required. The Microsoft Hyper-V role in Server 2008 provides this functionality and is easy to implement. To avoid confusion, this article refers to running Hyper-V as a role inside Server 2008 (or later) as opposed to the standalone product labeled as Hyper-V Server 2008. You manage the Server 2008 Hyper-V role via a GUI or PowerShell. In this article, we discuss configuring the GUI. It’s important to note that Hyper-V works only with hardware-assisted virtualization (which is available in processors that include a virtualization option—specifically processors with Intel Virtualization Technology or AMD Virtualization technology) or when hardware-enforced Data Execution Prevention (DEP) is available and enabled.
Hyper-V is installed through the Server Manager as a role. On your newly installed server OS, open the Server Manager, right-click the Roles node, and click Add Roles. In the Server Roles dialog box, select Hyper-V and Next. The wizard will prompt you to select a primary NIC adapter. Select your primary NIC; however, note that this selection will change later. Follow the remainder of the prompts to complete the Hyper-V role installation. At the end of the installation, the OS will need to restart.Once the machine has restarted, Hyper-V will be accessible via the Hyper-V Virtual Machine Manager under Start, Administrative Tools. From this tool, virtual machines (VMs) can be created, deleted, started, stopped, and accessed via a remote desktop console.
Setting up the virtual network based on a wireless adapter is complex. The following five-step procedure uses the 172.16.1.1/24 subnet (can be substituted) and should be followed in order.
1. Enable the wireless adapter feature in the host Server 2008 OS. In Server Manager under Features Summary, click Add Features. Select the Wireless LAN Service, and follow the installation prompts. Configure the wireless adapter to function with your wireless network.
2. Create a VPN based on the loopback adapter in Hyper-V Network Manager. Open the Hyper-V Manager to open the Virtual Network Manager. Create a virtual network by selecting Internal and then Add. In the New Virtual Network dialog box, name the interface EXT-LOOPBACK and click OK. Configure the EXT-LOOPBACK interface via the Network and Sharing Center. To avoid confusing this adapter with any other adapter, rename the interface from Local Area Connection XX to EXT-LOOPBACK. Set the IP address to a private IP in a class C subnet that isn’t used within your organization. For example, use 172.16.1.1 with a subnet of 255.255.255.0. Be sure to leave all the other fields empty! No default gateway and no DNS information should be populated.
3. Add RRAS via the Network Policy and NPAS in Server Manager. Open the Server Manager interface and select the Network Policy and Access Services role. As part of the Add Roles wizard for NPAS, choose to install RRAS with Remote Access Service and Routing. Configure NPAS in Server Manager by right-clicking Network Policy and Access and choose Custom Configuration. In the RRAS Setup Wizard, select NAT and LAN Routing. Now, start the RRAS service.
4. To configure RRAS, expand Routing and Remote Access in Server Manager. Expand the IPv4 node, and right-click NAT to add a new interface. Choose the wireless connection (or primary interface), and select Public Interface with Enable NAT on this interface selected. Click OK, and then right-click NAT again, this time selecting EXT-LOOPBACK. In the NAT properties dialog box, select Private interface connected to private network and click OK.
5. Configure the VM to leverage the private network. Open the settings for the desired VM and choose Network Adapter. Select EXT-LOOPBACK as the network, and click OK. Internal to the guest OS, configure the network adapter to use any usable IP address on the private network. In this example, we used 172.16.1.1/24, which provides a usable address range from 172.16.1.2-254 and a default gateway of 172.16.1.1.