简体   繁体   English

Tizen 模拟器与 WLS2 不兼容

[英]Tizen emulator incompatible with WLS2

I found out that the settings required to run tizen emulator on win10 are incompatible with WSL2.我发现在 win10 上运行 tizen 模拟器所需的设置与 WSL2 不兼容。 Specifically the hypervisorlaunchtype must be set to off for it to work, which prevents WSL2 from launching.具体来说, hypervisorlaunchtype必须设置为 off 才能工作,这会阻止 WSL2 启动。 I created two scripts to turn it on and off if needed, they are in the answer, but the only thing they do is elevate themselves and run bcdedit /set hypervisorlaunchtype (auto/off) .我创建了两个脚本来根据需要打开和关闭它,它们在答案中,但它们唯一做的就是提升自己并运行bcdedit /set hypervisorlaunchtype (auto/off) If anyone managed to get the two to play nice together please do show us how.如果有人设法让两者一起玩得很好,请告诉我们如何做。 Hope this will help someone in the future.希望这会在将来帮助某人。

Script to turn hypervisor off (tizen emulator works):关闭管理程序的脚本(tizen 模拟器工作):

If (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator))
{
  # Relaunch as an elevated process:
  Start-Process powershell.exe "-File",('"{0}"' -f $MyInvocation.MyCommand.Path) -Verb RunAs
  exit
}
# Now running elevated so launch the script:
& bcdedit /set hypervisorlaunchtype off

Script to turn hypervisor on (WSL2 works):打开管理程序的脚本(WSL2 工作):

If (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator))
{
  # Relaunch as an elevated process:
  Start-Process powershell.exe "-File",('"{0}"' -f $MyInvocation.MyCommand.Path) -Verb RunAs
  exit
}
# Now running elevated so launch the script:
& bcdedit /set hypervisorlaunchtype auto

Thank you for this post.感谢您对这篇文章。 I discovered this as well and posted a bug on MS WSL我也发现了这一点并在 MS WSL 上发布了一个错误

I was hoping they would have a more elegant solution than manually changing the hypervisor setting, but the response was: "Conflicting hypervisors can't be running at the same time":(我希望他们有比手动更改管理程序设置更优雅的解决方案,但响应是:“冲突的管理程序不能同时运行”:(

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM