hyper-v和virtualbox共存

用WSL2时,又想安装vbox。

找到 VirtualBox 的安装目录,在那里用 powershell 执行以下命令:

#对所有虚拟系统启用Hyper-V支持
./VBoxManage.exe setextradata global "VBoxInternal/NEM/UseRing0Runloop" 0
#只对某特定系统启用Hyper-V支持
./VBoxManage.exe setextradata "<虚拟机名字>" "VBoxInternal/NEM/UseRing0Runloop" 0

WSL启用,在 powerShell 中以管理员身份运行以下命令:

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
wsl --set-default-version 2

就行。

点赞

发表评论

电子邮件地址不会被公开。必填项已用 * 标注