2013-01-22 17:18:01 +0000 2013-01-22 17:18:01 +0000
81
81
Advertisement

在Windows 8中启用/禁用Hyper-V的便捷方法。

Advertisement

我非常喜欢Windows 8中对Hyper-V的支持,然而,在某些情况下,我需要禁用Hyper-V,以便运行一些即使在虚拟化环境的根分区中也不喜欢执行的应用程序。
我目前的做法是在 “添加或删除windows功能 "对话框中完全禁用该功能,然后重新启动,需要时再启用。
我想知道有没有想到更好的方法,甚至可以是一个快捷方式,我可以双击,会真正为我添加或删除该功能,然后重新启动(我想这可能是用PowerShell脚本实现的)。

Advertisement
Advertisement

答案 (8)

89
89
89
2013-09-06 19:57:30 +0000

这是个老答案,但为了完整,也因为我知道有比上面结果更好的方法。

从高位命令提示符。

bcdedit /set hypervisorlaunchtype off

禁用管理程序,还有:

bcdedit /set hypervisorlaunchtype auto

重新启用(默认值)。

当然还是需要重启。

69
69
69
2013-01-22 20:04:10 +0000

免责声明 。我没有为删除一个功能而这样做,并且作为最后的警告,每次你再次启用它时,可能会有大量的Windows Update更新要安装。

说到这里,从高架的命令提示符来看。

dism.exe /Online /Disable-Feature:Microsoft-Hyper-V

dism.exe /Online /Enable-Feature:Microsoft-Hyper-V /All

下面是在我的电脑上运行启用命令的样子,我的电脑已经启用并运行了Hyper-V:

>dism /Online /enable-feature:Microsoft-Hyper-V /All

Deployment Image Servicing and Management tool Version: 6. 2.9200.16384

镜像版本:6.2.9200.16384

启用功能 [========================== 100.0%==========================] 操作成功完成。

因为是Hyper-V,所以当启用功能时,它可能会要求你重新启动并再次运行命令。这似乎依稀有些熟悉。换句话说,你可能会被要求重启两次。但也许它不会对你这样做,因为那台机器之前已经启用了Hyper-V。

13
Advertisement
13
13
2015-09-17 16:36:38 +0000
Advertisement

你可以创建两个启动项,这样你就可以选择决定用或不用Hyper-V来启动OS系统。

1.在命令提示符中键入以下内容:

bcdedit /copy {default} /d "No Hypervisor"

1:

"The entry was successfully copied to {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}."

1.它说:

bcdedit /set {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} hypervisorlaunchtype off

1.然后输入以下命令。

0x1&

8
8
8
2013-09-11 04:52:09 +0000
  • 点击Windows键并键入 “windows功能 ” -点击Windows键+W组合,弹出 “开始 "屏幕的Windows设置面板。
  • 单击 "打开或关闭Windows功能 ”
  • 当 “打开或关闭Windows功能 "对话框出现时,查找Hyper-V并取消选择它
  • 单击 "确定 ”
  • 提示时重新启动计算机
  • 安装VMware工作站
  • 通过 “打开或关闭Windows功能 "对话框再次启用Hyper-V
  • 重新启动计算机

对于Windows 10。

  • 按Windows键
  • 输入 "打开或关闭Windows功能”
  • 取消选择Hyper-V旁边的复选框
  • 选择 “确定”
  • 选择 “立即重启"。
4
Advertisement
4
4
2014-09-08 16:41:07 +0000
Advertisement

Powershell也是可以的,用DISM包装成PS cmdlets,可以先读取设置再做更改。

//Test
PS> Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-All

//Turn off
PS> Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-All

//Turn on
PS> Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V –All

Refs

1.Powershell在这个2014-03的帖子中看到了,它总结了所有的选项, http://www.eightforums.com/tutorials/42041-hyper-v-enable-disable-windows-8-a.html ;MS Doc讲述了Get-WindowsOptionalFeature选项, http://technet.microsoft.com/en-us/library/hh852173.aspx 2. Boot Entry配置数据编辑(BECD)也可以读取(/导出)设置,根据 http://technet.microsoft.com/en-us/library/cc709667%28v=ws.10%29.aspx 和其他Doc http://msdn.microsoft.com/en-us/library/windows/hardware/ff542202%28v=vs.85%29.aspx

4
4
4
2016-04-25 18:17:08 +0000

你可以使用 Hyper-V Switch ,它基本上采用了这里已经介绍过的 bcdedit 方法,但在上面放了一个简单的一键 GUI。它可以显示当前的配置状态,让你启用或禁用Hyper-V,也可以重启电脑。我已经做了这个小工具,它在我的Windows 10电脑上工作。

1
Advertisement
1
1
2016-01-07 15:29:09 +0000
Advertisement

我做了一个PowerShell脚本来帮助启用/禁用Hyper-V。这将检查状态,所以如果你已经处于所需的状态,你就不会重新启动。

param([string]$state='Off')
'Set Hyper-V ' + $state
$lines = bcdedit
ForEach($line in $lines) {
    $pos = $line.IndexOf(' ')
    If($pos -gt 0) {
        $prompt = $line.Substring(0, $pos)
        $curstate = $line.Substring($pos).Trim()
        If($prompt -eq 'hypervisorlaunchtype') {
            '[' + $prompt + '] = [' + $curstate + ']'
            If($curstate -ne $state) {
                'Setting hypervisorlauchtype to ' + $state
                $result = bcdedit /set hypervisorlaunchtype $state
                'Result = [' + $result + ']'
                If($result -eq 'The operation completed successfully.') {
                    'Restarting in two seconds'
                    Start-Sleep -s 2
                    Restart-Computer
                } Else {
                    'Error setting state'
                    Start-Sleep -s 5
                }
            } Else {
                'Hypervisor launch type is already ' + $state
                Start-Sleep -s 5
            }
        }
    } 
}

然后在桌面上创建两个快捷方式 “Hyper -V Off” Target:

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe C:\Scripts\SetHyper-V.ps1 -state Off

和 “Hyper -V On” Target:

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe C:\Scripts\SetHyper-V.ps1 -state Auto`
``` 。
0
0
0
2019-10-15 14:44:49 +0000
  1. 从具有管理权限的windows控制台(cmd)。

清理和管理Windows组件商店(WinSxS)

Dism /Online /Cleanup-Image /RestoreHealth
Dism.exe /online /Cleanup-Image /StartComponentCleanup

分析系统文件并在必要时恢复

sfc /scannow

(根据 https://ugetfix.com/ask/how-to-disable-hyper-v-in-windows-10/ )

1.在启动配置时关闭hypervisor自动启动

bcdedit /set {current} hypervisorlaunchtype off

(来源:

1: Windows PowerShell (具有管理权限):

Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-All

(来源: https://blogs.technet.microsoft.com/gmarchetti/2008/12/07/turning-hyper-v-on-and-off/ )

1: https://ugetfix.com/ask/how-to-disable-hyper-v-in-windows-10/ https://support.microsoft.com/en-us/help/3204980/virtualization-applications-do-not-work-together-with-hyper-v-device-g )

1.打开或关闭 Windows 功能 -/> Hyper-V 全部取消勾选

https://support.microsoft.com/en-us/help/3204980/virtualization-applications-do-not-work-together-with-hyper-v-device-g )

1.这台电脑,属性,设备管理器,系统设备,并在那里删除 Hyper-V。

为了完整,某些虚拟化问题与设备卫士和凭证卫士安全功能有关。

1.mmc.exe,在计算机配置/管理模板/系统/设备卫士/开启基于虚拟化的安全功能下添加快进本地计算机策略

  1. 在设置/更新与安全/Windows安全/设备安全/核心隔离

(参考: https://support.microsoft.com/en-us/help/3204980/virtualization-applications-do-not-work-together-with-hyper-v-device-g https://www.tenforums.com/tutorials/68913-enable-disable-device-guard-windows-10-a.html ; https://blogs.technet.microsoft.com/ash/2016/03/02/windows-10-device-guard-and-credential-guard-demystified/ https://weblogs.asp.net/dixin/run-hyper-v-and-vmware-virtual-machines-on-windows-10 [ https://www.dell.com/support/article/lu/fr/lubsd1/sln304974/windows-10-enterprise-security-credential-guard-and-device-guard?lang=en ]0x3& …)

Advertisement

相关问题

8
13
6
6
5
Advertisement