Wednesday, 8 June 2011

Hyper-V Home Lab Setup

It's been about a year since I started this blog, and coincidently about a year since I last posted anything...


...so, I find myself with some time, lets try again.


For this post I'm going to detail the steps I've gone through to set up an old work laptop as a Hyper-V test lab; here goes.


Hyper-V Home Lab Setup
For my lab I will be using an IBM T60 laptop as the server, with VT enabled in the BIOS.
This 'server' will be a member of a Workgroup as will the machine I'll be using to perform remote management.
Step 1: Install Hyper-V Server 2008 R2
Available from here, Hyper-V server 2008 R2 is free to use and is a nice and simple install so I'll not go in to any details, the tricky stuff comes later.

Step 2: Configure Hyper-V Server for Remote Management

Tools Used
The following tools are used for this task:
net user – Already installed on the Server Core install of Hyper-V Server 2008 R2
net localgroup– Already installed on the Server Core install of Hyper-V Server 2008 R2
hvremote.wsf – Downloadable script that automates the various tasks required to configure Hyper-V for remote management
cmdkey - Already installed on the Server Core install of Hyper-V Server 2008 R2

Walkthrough


  1. On the client download and install the Hyper-V Manager, part of the RSAT SP1 tools for Windows 7.
  2. Create user account on the new Hyper-V server using the net user command. In my case I’ll be using the same accountname and password as I’ll be using to log on to the client.  
    Net user accountname password /add
  3. Verify via net user, without parameters.
    Net user
  4. Make the new account a member of the local Administrators group via net localgroup, this isn't strictly necessary but I'd like to have full admin rights for this account in my lab setup.
    net localgroup Administrators /add accountname
  5. Run the hvremote.wsf script on the server.
    cscript hvremote.wsf /add:accountname
  6. Reboot the server.
  7. On the client, run hvremote.wsf to Allow Anonymous Logon remote DCOM access.
    cscript hvremote.wsf /anondcom:grant
  8. On the client, run cmdkey to add credentials, entering the password when prompted.
    cmdkey /add:servername /user:servername\account /pass
  9. On the client, run hvremote.wsf to set exceptions in the firewall.
    cscript hvremote.wsf /mmc:enable
  10. Edit the local Hosts file on both the Server and the Client, adding entries to facilitate lookup if you don’t have a local DNS infrastructure.
  11. On the client, run hvremote.wsf to check for errors.
    cscript hvremote.wsf /show /target:servername
  12. On the server, run hvremote.wsf to check for errors.
    cscript hvremote.wsf /show /target:clientname
  13. Open up Hyper-V Manager (Administrative Tools).
  14. Right Click ‘Hyper-V Manager’ in the left hand TOC, and click Connect to Server.
  15. Enter the name of the server in the ‘Another computer’ field, click OK.
  16. You should now be connected to your Hyper-V server.
  17. All done, time move on to Step 3
Step 3: Configure Virtual Network

In order to connect to the virtual machines from other devices on the network, and to allow the virtual machine to get to the internet, they will need an externally connected virual network configured.

  1. Click Virtual Network Manager... in the action pane of the Hyper-V Manager, select New Virtual Network and choose External, then click Add
  2. Name your new virtual network, select the physical adapter to use, then click OK.

  3. All done, on to step 4.
Step 4: Install Virtual Operating System
Right, finally it's time to actually create some virtual machines
  1. Open up Hyper-V Manager and connect to the Hyper-V server.
  2. Right click on the server name then expand New and click on Virtual Machine… The ‘New Virtual Machine Wizard’ will appear, click Next.
  3. Name the virtual machine, change the storage location if needed, click Next.
  4. Assign memory to the virtual machine, click Next.

  5. Select the virtual network you want, click Next.
  6. Choose a size for the virtual Hard Drive (remember this is dynamic), click Next.
  7. Point to the install media, click Next.
  8. Review your settings, click Next.
  9. In Hyper-V Manager, Start the new virtual machine then connect to open a console and install the OS. 
Right, now repeat to create virtual machines as required for your lab environment.

I'll try to get slightly better with the formating for the next post.

1 comment:

  1. I've been hunting down some not too bad stuff on the subject and haven't had any fortunes up until this point, You just got another greatest fan!.. HOA Management Solutions

    ReplyDelete