windows 安装完docker, hype-v开启之后,vmware无法使用
故障:
安装完 docker for desktop 之后,原来的VMware,VM VirtualBox都无法启动。使用Docker是需要开启Hyper-V的,但是开启Hyper-V之后,是会与VMware发生冲突的(需要禁用Hyper-V),所以两个只能二选一。
VMware错误信息:
VMware Workstation 与 Device/Credential Guard 不兼容。在禁用 Device/Credential Guard 后,可以运行 VMware Workstation。
VirtualBox错误信息:
VirtualBox VT-x is not available
•解决方案一
当需要使用 vmware 时,我们按开启的方式,再次关闭 Hyper-V 。但这样操作,每开启或关闭一次,系统都必需要重启一次,这导致每次系统都进行了一次程序的安装和卸载,费时不高效。
步骤1:使用管理员身份打开cmd;
步骤2:输入命令,查看hyper-v启动状态:Auto:
bcdedit |findstr hyperv
hypervisorlaunchtype Auto
步骤3:禁用Hyper-V:
bcdedit /set hypervisorlaunchtype off
步骤4:重启电脑,查看hyper-v配置;
bcdedit |findstr hyper
hypervisorlaunchtype Off
再次尝试打开VMware,Oracle VM VirtualBox,成功;
•解决方案二(绕了一圈发现和方案一无本质区别)
微软官方的解决方法链接https://docs.microsoft.com/en-us/windows/security/identity-protection/credential-guard/credential-guard-manage
dgreadiness_v3.6.zip地址https://www.microsoft.com/en-us/download/details.aspx?id=53337
下载dgreadiness_v3.6.zip,根据官方文档,非英文系统要把脚本的
$OSArch = $(gwmi win32_operatingsystem).OSArchitecture
改为
$OSAch = $((gwmi win32_operatingsystem).OSArchitecture).tolower()

解压之后,使用管理员打开powershell(按win键打开开始菜单直接输入powershell,以管理员身份运行,非命令提示符!!!):
先在powershell中输入
.\DG_Readiness_Tool_v3.6.ps1 -Disable -AutoReboot

查阅是powershell运行的脚本的权限问题
Get-ExecutionPolicy

可以看到处于受限状态,不能运行脚本。然后更改权限为RemoteSigned
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
或:set-executionpoliy-executionpolicy unrestricted #修改权限为unrestricted



如果需要重新enable的话可以根据上面的微软官方文档中的信息重新启用组策略
https://docs.microsoft.com/en-us/windows/security/identity-protection/credential-guard/credential-guard-manage
关于这个Decive guard的介绍
https://docs.microsoft.com/zh-cn/previous-versions//dn986865(v=vs.85)
重启后发现虚拟机可以正常打开,但是,服务里没有Hyper-V了???那我docker怎么办?
docker报错:Required Windows feature(s) not enabled : Hyper-V. Docker Desktop will exit.
绕了一圈发现还是:
1,如果用docker,
以管理员身份运行cmd:
bcdedit /set hypervisorlaunchtype auto
重启
2,开启虚拟机linux,解决VMware与 Device/Credential Guard 不兼容
以管理员身份运行cmd:
bcdedit /set hypervisorlaunchtype off
重启
•解决方案三(可能可行,时间有限未尝试)
建立两个启动项,一个开启了 Hyper-V,而另一个则关闭,这样,我们可以在需要该功能时,在系统启动界面自由的选择相应的启动项,而不用频繁的安装和卸载 Hyper-V。启动项是啥意思?其实就是在我们开机的时候的一些默认设置,相当于我们在开机的时候选择系统一样,可以想象一下,我们在电脑中装有多个操作系统的时候,我们在开机需要选择我们想要进入的操作系统,而启动项也是一个意思,有多个启动项的时候,开机的时候会让我选择自己想要的操作系统进入。
参考:VMware Workstation 与 Device/Credential Guard 不兼容
另外看到轻松实现Docker for Win 与VMware 共存
可以试一下
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· DeepSeek “源神”启动!「GitHub 热点速览」
· 我与微信审核的“相爱相杀”看个人小程序副业
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· C# 集成 DeepSeek 模型实现 AI 私有化(本地部署与 API 调用教程)
· spring官宣接入deepseek,真的太香了~