您的位置:首页 > 其它

在同一台机器使用Hyper-v和VMWare

2013-08-02 17:49 260 查看
Booting Hyper-V and VMWare on the Same
Headless Machine




General
Written by Darwin Sanoy
Thursday, May 6, 2010 3:34am
Share
on email
Share on favoritesShare
on printShare
on twitterShare
on twitthisShare
on diggShare
on technoratiShare
on linkedinShare
on igoogleShare
on googlebuzzShare
on googleShare
on stumbleupon

More
Sharing Services

This week I built a virtualization server on the cheap. I wanted to be able to test with both Hyper-V and VMware workstation on the same configuration. However, once you add the Hyper-V server role, the parent partition becomes virtualized as well.
VMWare Workstation detects this situation and simply shows an abort message.

I found
this excellent article that tells of how to create a boot option to turn off Hyper-V. If you do not disable Hyper-V then VMWare Workstation gives the error “VMware Workstation and Hyper-V are not compatible. You must remove the Hyper-V role from
your system to run VMware Workstation.” when you attempt to start a virtual machine. Here are the steps from the above link outlined:

At the command prompt, type the following:

bcdedit /copy {default} /d "No Hypervisor"
The above command should say: The entry was successfully copied to {guid}. Copy that guid to the clipboard including the curly braces.
Now, type the following command:

bcdedit /set {guid_hvoff} hypervisorlaunchtype off

In the above command, replace {guid_hvoff} with what you copied in step 2. The above command just sets a property in the boot entry that will not load the hypervisor on boot.

Now I had just one more problem – the machine I am using will be headless and in another location. So how to switch back and forth between the options? Here is how to create two shell scripts to swap back and forth.

Like this script? Subscribe to our newsletter (without loosing your place in this article).

(Please ensure that the confirmation email clears your spam filter so that you will see future mailings.)

In a file called Restart-HyperV-OFF.cmd copy and edit this text:

@echo off

bcdedit /default {guid_hvoff}

echo.

echo Press any key to restart or CTRL-C to cancel

pause

shutdown /r /t 0 /d p:0:0

Note that {guid_hvoff} is the same guid that you just copied for the bcdedit command above.

This shell script can now boot with Hyper-V off. The only way to know the guid of the “Hyper-V on” guid is to boot into Hyper-V off and enumerate the existing guids.

Run Restart-HyperV-OFF.cmd
After the reboot, run the following command:

bcdedit /enum
Find the “Windows Boot Loader” section that has the setting “hypervisorlaunch Auto”
Copy the {guid_hvon} from the “identifier” field of the same Windows Boot Loader section.

(Note: If the identifier says “{current}” then you did not successfully boot into the non-hypervisor boot configuration.)
In a file called Restart-HyperV-ON.cmd copy and edit this text:

@echo off

bcdedit /default {guid_hvon}

echo.

echo Press any key to restart or CTRL-C to cancel

pause

shutdown /r /t 0 /d p:0:0

Note that you must replace {guid_hvon} with the guid you copied in the earlier step.

Looks like I will be using VMWare workstation over Hyper-V due to these factors:

VM Portability (Hyper-V VMs cannot be shared back and forth with Virtual PC reliably).
VMWare Teams (management of Groups of VMs).
VM Clones.
Ability to do USB pass through to VMs.

And Using VMWare Workstation over ESXi due to:

Storage of VMs on NTFS (I like the freedom to move drives in and out of the server without moving data and reformatting).
It could not use the integrated NIC on the motherboard - chewing up a precious PCI slot on a board that only has two.


Attachments:



HyperVBootControl.zip
[Scripts for remotely toggling hyper-v startup]0.6 Kb
PLEASE DO NOT REPOST CONTENT WITHOUT PERMISSION. Training and Tools to Make Apps Run on Win7 and Virtualization => http://CSI-Windows.com
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐