<

Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x

HOW TO: ENABLE and RUN Microsoft Hyper-V in a VMware vSphere Virtual Machine

Published on
38,833 Points
28,033 Views
8 Endorsements
Last Modified:
Andrew Hancock (VMware vExpert / EE MVE^2)
MVE^2, Expert of the Year 2016-2011, Scribe 2016-2012, Author of the Year 2016,2013-2012 VMware vExpert 2016-2011 27 years of experience.
In my previous Experts Exchange Articles, most have featured Basic and Intermediate VMware and Virtualisation Topics.

If you would like to read my Basic VMware articles, they are listed at the end of this article for your convenience.

VMware vSphere has the special ability to nest hypervisors, e.g. Host a Hypervisor as a virtual machine. But it is not enabled by default; if you try to add the Hyper-V role to a Microsoft Windows Server, you will receive the following error message:-
 
Hyper-V cannot be installed: A hypervisor is already running.
2014-12-10-12-39-23-Greenshot.jpg
 This is correct, because this virtual server FS01, is being hosted by a VMware vSphere (ESXi) 5.5 Server.

In this article, I’m going to take time out from writing a Basic VMware Article, and show you HOW TO: ENABLE and RUN Microsoft Hyper-V in a VMware vSphere Virtual Machine.

You will find that running Microsoft Hyper-V virtual machines in a virtual machine does degrade performance slightly compared to running Hyper-V on a bare metal server.

So why do we do it? A few reasons:
 
  • if you have no physical hardware and you only have a VMware vSphere estate and you need to test Microsoft Hyper-V for training or certification purposes.
 
  • Software Development environment using VMware Horizon View with Windows 8.1 Pro and Microsoft Visual Studio 2012/2013, Hyper-V needs to be enabled in the virtual machines, to execute the Windows Phone Emulator. (We have deployed such an environment successfully in Production with no performance issues in using the Windows Phone Emulator). 

We've installed Microsoft Windows 2012 Server as shown in my Experts Exchange article HOW TO: Create your first Windows Virtual Machine on a VMware vSphere Hypervisor 5.1 (ESXi 5.1) Host Server.

Shut down the virtual machine, because we need to edit the virtual machine configuration settings (the VMX file).

2014-12-10-13-17-13-Greenshot.jpg
At the VMware vSphere (ESXi) inventory, Remove the Virtual Machine from the Inventory. To do this, Right Click the virtual machine, and select Remove from Inventory.

2014-12-10-13-22-21.jpgThe next few steps can be done in many different ways. Essentially, you need to edit the virtual machine VMX file on the VMware vSphere ESXi host server. I've listed some methods here: 
 
  1. Download the VMX file using the datastore browser, edit the VMX file in Windows notepad, and then upload the VMX file back to the host, overwriting the original.
  2. At the ESXi console, or remoely via SSH, edit the VMX file using vi.
  3. Use WinSCP, connect to the VMware vSphere (ESXi) server and edit the file directly.

I'm going to demonstrate Option 3 in this tutorial. It's quicker.

Download WinSCP from here - http://winscp.net/eng/index.php and start WinSCP. Enter the 
 
  • hostname, IP Address or fully qualified domain name (fqdn)
  • username
  • password

and Click Login to login and connect to your VMware vSphere (ESXi) host.

WinSCP.jpg
Select the virtual machine machine datastore and folder. In this tutorial, the virtual machine is stored on datastore /vmfs/volumes/nfs_datastore8_dcs_san2a

WinSCP1.jpg
Right Click the vmx file in the right hand pane. In this tutorial the file is called fs01.vmx and click Edit:

2014-12-10-14-29-02-FS01---WinSCP.jpg
Notepad will launch, add the following lines to the VMX file
 
vhv.enable = "TRUE"
hypervisor.cpuid.v0 = "FALSE"

Open in new window


2014-12-10-14-41-08--vmfs-volumes-2868ea
Save the file, and exit WinSCP. Browse to the location of the virtual machine folder on the datastore, and register the VMX file with the Inventory.

Right Click the VMX File > Add to Inventory

2014-12-10-14-45-00-vcenter.net.dcs.hull
TOP TIP: If the files icon appears like a "blank notepad" -- examples of this are the files beneath the FS01.vmx file -- the VMX file you have updated is not correct or corrupted. This could be something as simple as missing quotation marks!

Power-up and start the virtual machine.

2014-12-10-14-56-01-FS01.jpg
Login to the server, and add the Hyper-V Role. Select Add roles and features


2014-12-10-15-33-32-FS01.jpg
Click through the wizard, and select the Hyper-V role.


2014-12-10-15-39-03.jpg
Click Add Features.


2014-12-10-15-43-48-Greenshot.jpg
Follow by Next to continue (it's at this point usually the error message is displayed, 
Hyper-V cannot be installed: A hypervisor is already running.
as shown at the start of this article).


2014-12-10-15-45-06-Greenshot.jpg
Continue with the wizard, and Click Install to complete the installation of Hyper-V. Tick the box to Restart the destination server automatically if required.

2014-12-10-15-49-05-Greenshot.jpg
The installaton will start.


2014-12-10-15-50-46-Greenshot.jpg
A Progress bar is displayed as installation progresses


2014-12-10-15-51-22-Greenshot.jpg
A Progress bar is displayed as installation progresses.


2014-12-10-15-51-40-Greenshot.jpg
The server will restart to add the Hyper-V role and features.


2014-12-10-15-52-02-Greenshot.jpg
Click the Hyper-V Manager icon on the start menu.


2014-12-09-16-26-12-Greenshot.jpg
The Hyper-V Manager will show the Inventory. You are now ready to create virtual machines.


2014-12-10-15-55-41-Greenshot.jpg
Congratulations you have successfully ENABLED and RUN Microsoft Hyper-V in a VMware vSphere Virtual Machine.

Basic VMware Articles Series: 

During this series of articles VMware released VMware vSphere 5.5 and VMware vSphere Hypervisor ESXi 5.5. These articles are also applicable to VMware vSphere Hypervisor ESXi 5.0 and 5.5. For consistency, I have used VMware vSphere Hypervisor ESXi 5.1 throughout this series.
 
 
 
 
 
 
 
 
 
 
 
 
 

****************************************************************************
Thank you for reading my article, please leave valuable feedback. If you liked my VMware article and would like to see more Articles from me, please click the Yes button near the: Was this article helpful? at the bottom of this article just below and to the right of this information. Thank You. Do not forget if you have a question about this article or another VMware, Virtualisation, Windows Server 2012 question, why not post a Question for me and the other Experts Exchange Experts in the VMware, Virtualisation, Windows 2008, Windows 2012 Zones. I look forward to hearing from you. - Andy :- twitter @einsteinagogo
****************************************************************************
 
8
Comment
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 22

Expert Comment

by:Matt V
In the latest version of vSphere you can actually edit the vmx parameters from the GUI.

Under "Edit Settings" choose the VM Options tab, exapnd Advanced and click the button to "Edit Configuration..." for the "Configuration Parameters" section.

You can Add Row to add:

hvh.enable = TRUE
hypervisor.cpuid.v0 = FALSE
0
 
LVL 123

Author Comment

by:Andrew Hancock (VMware vExpert / EE MVE^2)
@Matt - Thanks...

and they don't always stick, if the VM is registered in the Inventory!

Andy
0
 

Expert Comment

by:Marlene Tighe
This is great!  I have a vmware development box now and a hyper-v production.  I was going to wipe the vmware and load hyper-v from scratch but now I don't have to.  I have a vmware vm on that box that runs backups.
0
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 
LVL 123

Author Comment

by:Andrew Hancock (VMware vExpert / EE MVE^2)
thanks for your comments
0
 

Expert Comment

by:Bob B
Should this work in regards to the vswitch capabilities?  I was able to set up Hyper-V, however when I try to route data from the guest to anywhere else on the network it does not work.  I can only hit the Hyper-V server.  I have the vswitch set up as external, and am staying within the same vlan.  The Hyper-V host can access other servers in my VMware network, but my Hyper-V guest cannot.

Is this a limitation, or are others able to get this to work?

Another really strange part of all of this is it must be able to route somewhere, because it hits my DHCP server...gets the correct addresses (DHCP registers it and assigns it the correct gateway, dns servers) but then I am unable to even ping the DHCP server.  (No firewalls in the middle, and this is all within VMware's VSwitch and Hyper-V's Vstwitch).
0
 
LVL 123

Author Comment

by:Andrew Hancock (VMware vExpert / EE MVE^2)
@Bob Thanks for reading my article, please post a question and myself or other Experts, can get a chance to discuss at length, for the benefit or other readers and Experts.
0
 

Expert Comment

by:Bob B
@Andrew,
I was able to get the nested v-switch working by setting the vswitch on the VMware side to allow "Promiscuous Mode".  So I'm all set now.  Thanks for the article!

On a side note, after I signed up  submit a comment here I received a ton of spam mail and random people emailing me asking me to email them so I promptly unsubscribed.
0
 
LVL 123

Author Comment

by:Andrew Hancock (VMware vExpert / EE MVE^2)
@bob not sure what is going on their, you need to discuss with Customer Support, I don't work for EE, I just write articles!
0
 

Expert Comment

by:Victor Rudenco
Thank you Andy , nice article , well explained. On my server the Hyper-V is already configured and a few virtual machines already installed. Whenever I want to start any virtual machine from Hyper-V Manager it shows the following error message :
"An Error occured while attempting to start the selected virtual machine(s).
  Failed to start the virtual machine ' <<VM name>>' because one of the Hyper-V components is not running.
........................................................................
  The Virtual Machine Management Service failed to start the virtual machine '<<VMName>>' because one of the Hyper-V components is not running ( Virtual Machine ID ........ )."

It would be useful to have the possibility to add images here so to not type so much.

Service 'vmms' is started. OS : Windows Server 2012 R2. 6GB of RAM. Intel XEON CPU.

Regards,
Victor
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Join & Write a Comment

Teach the user how to install log collectors and how to configure ESXi 5.5 for remote logging Open console session and mount vCenter Server installer: Install vSphere Core Dump Collector: Install vSphere Syslog Collector: Open vSphere Client: Config…
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month