다음을 통해 공유


QuickStart: Using Hyper-V 2008 R2 for Developer Virtualization

So I embarked on setting up a new server to run my Windows Virtual images and decided to use the barebones but powerful Windows Hyper-V 2008 R2 instead of a more conventional Windows 2008 R2 server with Hyper-V installed on top. If you’re new to the concept of a Windows Server “Core installation” it can be daunting at first…no UI, no way to get around…but don’t throw in the towel just yet. If all the server’s going to do is boot up and spawn a few of your VPC images, then don’t waste the resources on a full server just so you can have a GUI. Here’s the quick start to tackling this project:

  • Burn Windows Hyper-V 2008 R2 from your MSDN Subscription to a DVD and boot it – run the install like you normally would
  • Once you log in the first time, you’ll see a blue screen with some basic configurations – nothing fancy here…just walk it through, then exit to a command prompt
  • Command Prompts can be the standard ones, or PowerShell prompts. To get elevated permissions from the standard command line, simply type

C:\Powershell

this will return the following:

PS C:\

  • Once in Powershell, you can do anything else we need to do
  • Map a drive letter from your new Hyper-V server over to your laptop or workstation which you’ll use to download stuff & remotely manage your VPC images

PS C:\ net use Z: \\workstationname\sharename /user:domain\user pwd

If you’d like a quick list of common server commands, go here

  • Now go download a couple scripts & utilities:

Core Configurator 2.0 for Windows 2008 R2 – download & docs are here
this utility basically lets you run it from the PS C:\ prompt, launches a GUI, which lets you tweak the basic OS, networking, firewall & essential things. I recommend downloading the .cab file (instead of the ISO)

HVRemote – download is here, good blog entry is here
this utility quickly configures the Hyper-V server to be remotely administered, and configures your remote laptop/workstation to hit the server via a Hyper-V admin console that is installed with the Remote Server Administration Tools for Windows 7 (think of this as a Windows Update).

Remote Server Administration Tools for Windows 7 - download here.

  • Once everything’s downloaded, do the folowing:
    • Install the Remote Server Admin Tools for Win7
    • Go into Control Panel, Programs, Turn Windows Features On/Off, find the Remote Server Admin Tools, Role Administration Tools & select Hyper-V Tools
    • Map the network drive from your new Hyper-V server core back to your laptop/workstation if you didn’t already do it
    • copy the HVRemote.wsf & CoreConfig.cab files to the server
    • unzip the CoreConfig.cab to a directory, such as c:\CoreConfig using the command:

expand CoreConfig.cab -f:* C:\CoreConfig

    • Run the CoreConfigurator from a PS C:\ prompt by typing:

PS C:\ cscript c:\coreconfig\start_coreconfig.wsf

    • Run the HVRemote from a PS C:\ prompt on the Hyper-V server first by typing:

PS C:\ cscript HVRemote /add:workstationname\user

    • Run the HVRemote from an elevated command line on the workstation machine second by typing:

C:\ cscript HVRemote /mmc:enable
C:\ cscript HVRemote /AnonDCOM:grant

    • To test everything out and make sure there are no other gotchas on the Hyper-V server, run the following command on BOTH the server & workstation, and correct anything you find either using normal utilities or using the aforementioned Core Configurator script/GUI

PS C:\ cscript HVRemote /show (on Hyper-V server)
     C:\ cscript HVRemote /show (on workstation)

  • If there is anything failing about permissions connecting, make sure you’ve run the unique commands specific to a mix of workgroup/domain machines listed here (ie the cmdkey commands).
  • Now that everything is configured properly, let’s run the workstation’s Hyper-V MMC and see if we can connect to the remote Hyper-V server. Open either MMC.msc from a command line or Run prompt and add the Hyper-V snap-in, or just run the Hyper-V Manager that is now under your workstation’s Administrative Tools menu.
  • The rest should be self-explanatory

I hope this helps some of you get going. Thanks as always to those who contributed all of the hard work for getting this stuff working…John Howard & the CoreConfig team!

Comments

  • Anonymous
    January 18, 2010
    Hi, As I understood, in this post you will need to have 2 machines (one running the Windows Hyper-V 2008 R2 and another to have the visual tools and Remotely manage the Windows Hyper-V 2008 R2). Unfortunatly, I want to create a demos laptop that is the only machine available to present demos to the clients. How am I going to configure the Hyper-V create/delete/start/stop the VMs without a second machine? Thanks in advance, Tiago.

  • Anonymous
    January 18, 2010
    If you want to use the Hyper-V that is with Windows Server "Core," you would either need 2 machines (one running Hyper-V and the other to configure it for the first time), or you'd simply want to get versed in PowerShell scripting :-). If you're wanting a demo laptop/all-in-one, my personal recommendation is to do one of two things:1) dual-boot between your primary "client" OS and a full Windows 2008 R2 w/Hyper-V (which on boot, runs Windows 2008 R2 host & your demo VPC image)2) just install your laptop's primary OS as Win2008 R2 w/Hyper-V. By default the server OS is your OS, and when you need to demo, spin up the desired virtual machine image.Hope this helps!