Now that Hyper-V Server 2012 has been released, I thought it would be interesting to virtualize it and tinker around in the lab. I found two great posts on running nested hypervisors, one on VirtuallyGhetto (here) and another on Thep Huck (here). However, while the content posted in these locations were enough for me to piece together the whole puzzle, I wanted to lay out the process in a clear and concise manner for those specifically using Hyper-V Server 2012 on ESXi 5. Much of the content on the links I provided go over obstacles that simply don’t exist when using hardware version 8 on ESXi 5 (yay).
Prepare The ESXi 5 Host
Your first step is to follow the directions outlined in this post by William Lam. We need to set a configuration value to True on the host itself, which can be done without a reboot.
Either use SSH or the DCUI to connect to the host. Log in as root. Navigate and edit the config file located here:
To do so, I used the VI command:
Then, press the “i” key to change to Insert mode. Navigate to the last line in the file and insert a new row. Add the following:
vhv.allow = "TRUE"
Then, press the ESC key to leave Insert mode and type the following to write the changes and quit the VI editor.
Create The Hyper-V Server 2012 Virtual Machine
The next step is to create the virtual machine for Hyper-V Server 2012. Create a new VM and choose to do a “Custom” configuration. Accept the defaults and your own personal preferences except were noted below:
Virtual Machine Version
Make sure to use Version 8 for the virtual machine version. This assists in a number of tweaks that were required with Version 7 but are handled by 8.
Guest Operating System
For now, just choose “Other” and “Other (64-bit)” as the Operating System. Later, we will change it to ESXi 5 (64-bit), but that option is not available while creating the VM.
You’ll need to use the E1000E adapter for the network. I decided upon 2 NICs.
Go with the LSI Logic SAS controller, which has been the default choice for Windows since 2008.
Edit The Virtual Machine
Finish answering any other questions required to create the VM. Once it has been created and placed into your inventory, do the following edits:
Edit Guest Configuration
Edit the VM, click on the Options tab, then click on the “General” Settings item. In the lower right corner there will be a “Configuration Parameters…” button. Click it, then add a configuration entry to the VM with a value of FALSE by using the “Add Row” button.
Change Guest Operating System
Edit the VM, click on the Options tab, make sure the “General Options” setting is highlighted, and change the Guest Operating System type to “VMware ESXi 5.X” as shown below.
Insert the Installation DVD
As a final step, insert the install ISO and power on the VM. I put the media on a datastore and mounted it to the VM.
The installation process of Hyper-V Server 2012 is rather straight forward. Just follow the prompts to complete the install. Make sure to dismount the DVD / ISO once finished.
Below is the finished product showing the installation of Windows 7 on a Hyper-V VM.
Update 11/20/2012 – ESXi 5.1 Required Step
If you’re using ESXi 5.1, there’s one thing you’ll have to do in order to get this to work. It’s documented in a few places, but notoriously difficult to pin down exactly unless you know what the error is in the first place (which means you are probably frustrated right now). When trying to install the Hyper-V role the error is:
The processor on this computer is not compatible with Hyper-V. To install this role, the processor must have a supported version of hardware-assisted virtualization, and that feature must be turned on in the BIOS.
Before you power on the VM (if you powered it on, power it off) you’ll need to check a box in the vSphere Web Client. The old “thick” client will not work!
Edit the VM from the vSphere Web Client and expand the “CPU” field. Check the box for “Hardware virtualization”. I’m including a photo below of my Hyper-V 2008 virtual machine.
Make sure to accept the change. Now you can power it on and install the Hyper-V role.
Installing VMware Tools
If you’d like, you can also install the VMware Tools on the Hyper-V Server 2012 VM.
First, mount the tools ISO to the VM. Click on the “Connect to ISO image on a datastore…” option, then navigate to vmimagestools-isoimageswindows.iso file.
Then, from the console of the Hyper-V VM, click on the cmd prompt window. Change to the D: drive and launch Setup64.exe.
Follow the VMware Tools installation GUI prompts. Once finished, you will be asked to restart the server.
If you forget to modify the host as described in the first section, you will get this error when you try to power on a VM: virtual machine could not start because the hypervisor is not running. (Microsoft KB 2490458)
Make sure to edit the ESXi host’s config file and add the entry vhv.allow = “TRUE” entry.
This means that you forgot to edit the ESXi host config file
Also, don’t vMotion the VM around. It tends to get cranky and stop responding.
While this process has been documented in a few place, I felt some clarity was in order to streamline things, and to emphasize that this process works for the newly released Hyper-V Server 2012.
2,204 total views, 24 views today