如何使用启用了 Hyper-V 的本地 TwinCat 3 运行时?
我正在尝试在需要打开 hyper-V 的 PC 中运行 TwinCat 3 XAR 才能运行 Azure IoT Edge(使用 hyper-V)。有没有办法在打开 hyper-V 的情况下运行 XAR?有没有办法将核心与 hyper-v 或其他东西隔离?
I'm trying to run TwinCat 3 XAR in a PC where I need to have hyper-V ON to run Azure IoT Edge (which uses hyper-V). Is there a way to run XAR with hyper-V turned on? Is there any way to isolate the cores from hyper-v or something else?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
编辑于 2022 年 4 月 22 日
有关此内容的完整教程,请参阅 我的博客发布。
有一种方法可以实现这一点。您可以通过在虚拟机中的运行时上运行代码来实现此目的,而不是使用本地运行时。我从这篇 Reddit 帖子中得到了这个想法。
为了使其正常工作,我执行了以下操作:
下载并安装VMware Player。非商业用途免费。您还可以使用付费专业版(工作站)。我不确定这是否也适用于 Virtual Box。
按照 Jakob 这段出色的 YouTube 视频中的说明,在虚拟机上安装 TwinCAT BSD< /a>
如果您使用 VMware Player 并且需要启用 UEFI,则需要按照 YouTube 用户 Eivind Hilde 的说明执行以下操作:
<块引用>
在虚拟机上运行您的 TwinCAT 项目,无需禁用 Hyper-V
Edit 22 April 2022
For a complete tutorial on this see my blog post.
There is a way to accomplish this. You can do this by instead of having a local runtime, you can run the code on a runtime in a virtual machine. I got the idea from this reddit post.
To make it work I did the following:
Download and install VMware Player. Its free for non-commercial use. You can also use the paid Pro (Workstation) version. I'm not sure if this also works with Virtual Box.
Install TwinCAT BSD on the virtual machine as described in this excellent YouTube video by Jakob
If you're using VMware Player and need to enable UEFI you need to do the following as noted by YouTube user Eivind Hilde:
Run your TwinCAT project on the virtual machine, without the need to disable Hyper-V. ????
Previous answer
I don't think so. InfoSys mentions:
But they also mention that:
So maybe there is some way you can prevent TwinCAT from detecting a Hyper-V environment. However, that is something I can't answer.
您应考虑在主机上运行 TwinCAT,并在虚拟机上运行 UI 和其他与机器相关的工具。为此,Beckhoff 使用了 TCBSD,它基本上是 FreeBSD,并安装了经过调整的调度程序和 TwinCAT 3 XAR。
请注意,TwinCAT 3 依赖于 Intel vt-d,虚拟机正在使用该资源,并且不使用 Vt-d 模拟处理器,因此主机操作系统上甚至客户操作系统上都不能存在第二个应用程序来使用硬件辅助虚拟化。
you shall consider running the TwinCAT on the host and UI with other machine related tools on Virtual Machine. for this Beckhoff has TCBSD which basically FreeBSD with tweaked scheduler and TwinCAT 3 XAR installed.
Note that TwinCAT 3 relies on Intel vt-d, and virtual machines are using that resource, and do not emulate processor with Vt-d thus no 2nd application can exist on the host OS or even more on guest OS to use hardware assisted virtualization.