How-to
Running TwinCAT 3 in a Hyper-V VM on Windows 11
Short answer
Yes, TwinCAT 3 runs in a Hyper-V VM on a Windows 11 host. Give the guest at least two virtual CPUs and isolate one core for the TwinCAT runtime, which Build 4026 requires, or install the TwinCAT 3 Usermode Runtime where real time is not needed. Keep the guest on a static IP address so the host ADS route survives restarts, and pass USB devices in through enhanced RDP redirection or a USB-over-IP service.
On this page
Yes, TwinCAT 3 runs in a Hyper-V VM on a Windows 11 host, and it is the cleaner path now that Windows 11 has made VMware Workstation awkward. Three decisions carry the whole setup: give the guest at least two virtual CPUs and isolate one of them for the TwinCAT runtime, which Build 4026 requires; or install the TwinCAT 3 Usermode Runtime when you do not need real time. Pin the guest to a static IP address so the host ADS route survives restarts. Pass USB devices in through an enhanced RDP session or a USB-over-IP service. The sections below give the configuration order, the sizing arithmetic and the checks that prove each piece.
What the runtime supports in a VM #
Beckhoff documents this precisely enough to plan around. The TwinCAT 3 system requirements state that the real-time runtime tries to detect Hyper-V environments and react to them, and that hypervisor configurations that avoid detection leave the runtime unable to respond. Detection is a mechanism the runtime uses, not a promise that any VM silently counts as supported. On the other side sits TC1700, the TwinCAT 3 Usermode Runtime, which Beckhoff describes as a way to run TwinCAT applications without real-time properties in the operating system's user mode — a documented, VM-friendly home for engineering work.
That leaves two configurations for the VM, and the TwinCAT build decides which messages you see. On Build 4026, activating the runtime without an isolated core reports Hyper-V as unsupported; that behavior is reported for that build. Build 4024's behavior is unconfirmed either way, so read the activation message on the build you actually install rather than assuming older means quieter.
Configure the VM, step by step #
- Enable Hyper-V on the Windows 11 host and leave the host's virtualization-based security switched on. Nothing on the host has to be weakened — that is the point of choosing Hyper-V.
- Create a Generation 2 VM and install Windows 11 Pro. A guest of exactly this kind running Visual Studio 2022 is reported to work well, and Generation 2 machines are the type reported to run smoother under this workload.
- Install the TwinCAT 3 engineering environment (XAE) and the runtime that matches your decision above: the core-isolated real-time runtime, or the Usermode Runtime package offered for your build.
- Assign virtual processors in the VM's processor settings: at least two, four when the host can spare them.
- In the TwinCAT target's real-time settings, set one CPU core as the isolated core for the runtime. The runtime must recognize the isolated core — assigning extra vCPUs in Hyper-V alone does nothing.
- Set a static IPv4 address on the guest's virtual network adapter.
- On the host, create an ADS route to that address.
- Bring the target to run mode and read every message. A Hyper-V support warning at this point on Build 4026 means the isolated core is missing or not recognized.
- Connect USB devices through RDP device redirection or a USB-over-IP service, then test the specific device rather than assuming redirection is automatic.
Sizing the VM: four vCPUs, one isolated core #
The inputs, each from reported Hyper-V deployments of TwinCAT 3:
- Minimum: two virtual CPUs, with one isolated for the TwinCAT runtime.
- Reported working configuration: a four-core VM with one core isolated, leaving three for the guest.
- The constraint behind both: Build 4026 flags Hyper-V as unsupported for the runtime without core isolation.
The rule in words: the cores left for guest Windows equal the vCPUs assigned minus the cores isolated for TwinCAT.
Arithmetic with the reported configuration:
4 vCPUs − 1 isolated core = 3 cores for Windows, Visual Studio 2022 and everything else in the guest.
At the reported minimum:
2 vCPUs − 1 isolated core = 1 core for the whole guest operating system and IDE.
Decision: two vCPUs is the floor — never configure the real-time runtime in a VM below it. Four vCPUs is the working size, because a single leftover core has to carry background Windows work and Visual Studio builds, and that contention is what makes a minimum-size VM feel broken. When the host cannot spare four, two still meets the reported minimum; schedule heavy builds outside your test sessions.
Keep the host ADS route alive #
The one operational failure reported with this setup: after a restart, the guest comes back on a different IP address and the host's ADS route to it dies. TwinCAT keeps running inside the VM the whole time, which makes the fault look like a TwinCAT problem when it is purely an addressing problem.
Fix it once, structurally: keep the static address from step 6 on the guest adapter and keep the host route pointed at it. Then verify after a restart cycle:
- Confirm the guest's current address still equals the route target on the host.
- Send an ADS request from the host — browse the target or read one symbol — and confirm the response.
If ADS fails after a restart, compare those two addresses before touching any runtime setting.
USB devices: the one extra step #
USB is the only area where Hyper-V asks for more than VMware did. Two paths, both reported in use:
- An enhanced RDP session with PnP device redirection: enable device support in the remote desktop connection, and the device appears in the guest for that session.
- A USB-over-IP service such as VirtualHere, which carries the device over the network and keeps it available when no interactive session is open.
Pick the second when the device — a programming cable, an adapter — must be present in the guest without someone connected. The detail that trips people up on cables specifically is covered in using a USB programming cable inside a Hyper-V VM. And if outside vendors will reach this engineering VM by RDP, front it properly: multi-domain vendor RDP authentication via DMZ jump hosts is the pattern to copy.
Windows 11 security and nested hypervisors #
The reason to move at all: on Windows 11, VMware Workstation setups end up shedding guest security features — Device Guard, core isolation, even TPM — to get virtualization working, which is a poor trade for a machine on a plant network. Hyper-V needs none of that. If you are staying on VMware and fighting host performance, slow automation VMs on a Windows 11 host have their own fix path worth trying first.
One rule keeps TwinCAT healthy in the guest: nothing may load a hypervisor inside the guest. Windows 11's virtualization-based security does exactly that, and it is reported to break TwinCAT's real-time execution when it sits directly under the runtime — so switch core isolation off inside the guest, while the host keeps its own security untouched.
Prove the setup before you trust it #
A VM can host a running TwinCAT runtime while still being wrong for the job. Check four things before calling the machine ready:
- The target reaches run mode with no Hyper-V support warning for the installed build.
- The host ADS route still resolves after a full host-and-VM restart cycle.
- The USB device enumerates in the guest and completes one real transaction with its application.
- Timing holds under representative guest load, builds and updates running, because Hyper-V still schedules the virtual processors.
That last line is also the safety boundary: an isolated core buys freedom from guest Windows work, not deterministic control. Use the VM for engineering, visualization and offline logic, and keep the machine's control on hardware qualified for it.
Questions asked
Is Build 4024 different from Build 4026 under Hyper-V?
The warning that Hyper-V is unsupported without an isolated core is reported on Build 4026; Build 4024's behavior is unconfirmed in either direction. Treat the activation message on the build you actually install as the authority, and do not assume an older build is quieter or more permissive. The core-isolation requirement, not the message, is what you are configuring.
When should I choose the TwinCAT 3 Usermode Runtime instead?
Choose the Usermode Runtime when the VM exists for writing, compiling and offline logic testing and you accept that it provides no real-time properties, which is how Beckhoff defines the package. Choose the core-isolated real-time runtime when timing behavior matters, and even then measure it under representative guest load before you trust a result.
Why does the host ADS route die after every restart?
The host ADS router stores the guest's IP address, and the virtual switch can hand the guest a different address after a restart, leaving the route aimed at an address nobody holds. TwinCAT keeps running inside the guest the whole time, which is why the failure looks like a TwinCAT fault. A static address on the guest adapter removes this failure class permanently.
Do I have to weaken Windows 11 security for this to work?
No. The host keeps virtualization-based security enabled, because Hyper-V is the native hypervisor layer there. Inside the guest you switch core isolation off so a second hypervisor does not load beneath the TwinCAT runtime. That single guest setting is the whole difference from the VMware path, where people report stripping Device Guard, TPM and more out of the guest to get virtualization running.
Can this VM replace the industrial PC on the machine?
No. Hyper-V still schedules the virtual processors, so the isolated core removes competition from guest Windows, not the underlying scheduling. Use the VM for engineering, visualization work and offline tests, and keep machine control on an industrial PC qualified for it. Confirm any timing-sensitive result from the VM under representative load first.