IMD SolutionComputing LibraryShop main store

Troubleshooting

Why TwinCAT 3 XAR cannot start with Hyper-V enabled

Operating systems on the plant floor Published 7 min read

Short answer

A TwinCAT 3 XAR runtime cannot start on a Windows host while any component there uses Hyper-V; the XAE engineering side can. Keep XAE and the Hyper-V workload on the host and run the runtime in a TwinCAT/BSD virtual machine under VMware Player or Workstation, with EFI firmware set in the vmx file. If the runtime must stay local, move the Hyper-V workload elsewhere and disable virtualization.

On this page
  1. What the vendor documents about XAE, XAR and Hyper-V
  2. Why no setting reconciles the two
  3. First checks before you move anything
  4. Two placements that work
  5. Allocating cores in a 2 vCPU TwinCAT/BSD guest
  6. Bringing up the runtime in the TwinCAT/BSD guest
  7. When the runtime must stay local
  8. Verifying the split before you trust it
  9. Questions asked

A TwinCAT 3 XAR runtime will not start on a Windows host once any component on that host uses Hyper-V, and Azure IoT Edge is the workload that usually puts Hyper-V there. The engineering environment, XAE, keeps working on the same box. The fix is placement, not a setting: keep XAE and the Hyper-V workload on the Windows host, and run the runtime in a TwinCAT/BSD virtual machine under VMware Player or Workstation. If the runtime must stay local instead, the Hyper-V workload moves to its own machine and virtualization is switched off on the runtime host. This article gives the documented restriction, the reason no core mask reconciles the two, the core arithmetic for the guest, and the bring-up and verification steps.

What the vendor documents about XAE, XAR and Hyper-V #

Beckhoff's system documentation draws the line by component, not by machine: on a Hyper-V-enabled computer, TwinCAT 3 XAE can be used, while the TwinCAT 3 XAR runtime cannot be started. The restriction follows any component using Hyper-V, not only the case where XAR itself would sit inside a guest.

XAE tolerates the enabled hypervisor because it is engineering software: XAE is an extension for Visual Studio, so its requirements are essentially Visual Studio's. The same documentation notes that XAE installations on Windows do not meet the Hyper-V requirements, which it attributes to IT security requirements, so read the XAE statement as an allowance for the engineering tool rather than a vendor-validated recipe for running XAE and Hyper-V side by side on one box.

Component Where it runs Result Basis
TwinCAT 3 XAE Hyper-V-enabled Windows host Usable Vendor documentation
TwinCAT 3 XAR Hyper-V-enabled Windows host Runtime cannot start Vendor documentation
TwinCAT 3 XAR TwinCAT/BSD guest on VMware Player or Workstation Working split Practitioner-reported; verify on the target host

If part of the plan is a TwinCAT environment inside a Hyper-V guest itself, running TwinCAT 3 in a Hyper-V VM on Windows 11 covers that setup separately.

Why no setting reconciles the two #

The Windows runtime takes Ethernet controllers away from Windows for cyclic traffic, and it leans on the processor's IOMMU, Intel VT-d, to keep that direct memory access isolated while it does so. A hypervisor needs that same hardware facility for itself and does not hand it to other host software.

Core masks divide processor time; they do not divide VT-d. That is why the obvious ideas fail: isolating cores for the runtime, disabling only the Hyper-V role while other features keep the hypervisor active, or hiding virtualization from TwinCAT all leave the same hardware claimed twice. A disguised environment is not a documented one either, because behavior there is unspecified, and a runtime that appears to run in one is unsupported. The decision is binary: the hypervisor goes, or the runtime leaves the host.

First checks before you move anything #

  1. Rule out a version mismatch first. An XAE and XAR pair that does not line up fails at connection and start in ways that look like this block, and the page on TwinCAT 3 XAE and XAR version compatibility shows how the mismatches present.
  2. Inventory everything on the host that starts the Windows hypervisor: the Hyper-V role and platform entries, Azure IoT Edge's Linux-on-Windows deployment, WSL2, Windows containers, Windows Sandbox. The restriction follows any of them, not only the Hyper-V role.
  3. Check the failure shape. XAE opens normally while the local runtime fails to start or never reaches its run state, and that matches this restriction. A machine that will not boot at all is a different fault.
  4. Pick a placement: the Hyper-V workload stays and the runtime moves to a guest; the runtime stays local and the Hyper-V workload moves out; or the box only does engineering, and nothing changes.

Two placements that work #

Placement A keeps the Hyper-V workload. Azure IoT Edge keeps Hyper-V enabled on the Windows host, XAE stays next to it, and the TwinCAT project executes in a TwinCAT/BSD virtual machine under VMware Player or VMware Workstation. TwinCAT/BSD is the vendor's FreeBSD-based runtime operating system and carries the XAR runtime. This split is practitioner-reported rather than a vendor-published design, so prove it on the intended host before a production line depends on it.

Placement B keeps the runtime local. Move the Hyper-V workload to its own machine, remove Hyper-V from the Windows features, and disable virtualization technology in the BIOS or UEFI setup. The reported sequence did not stop at the Windows features: it turned virtualization off in the BIOS as well before the local runtime ran.

If the runtime instead moves to different physical hardware, the hardware-side checks in running TwinCAT XAR on a third-party industrial PC apply to the new host.

Allocating cores in a 2 vCPU TwinCAT/BSD guest #

Inputs: the guest gets two virtual CPUs and 2 GB of main memory, which is the size of Beckhoff's own documented example guest, a UEFI-based virtual machine with that configuration. Treat it as an example size, not a minimum. The reserve rule comes from the vendor's virtualization guidance: isolated cores for TwinCAT in a VM are chosen at least one less than the total processors the VM has.

Rule in words: the runtime may isolate at most the guest's total vCPUs minus one, and the guest operating system keeps the rest.

Arithmetic: 2 - 1 = 1 isolated core, with 1 core left for the guest operating system.

Result: a guest sized this way carries a one-core isolated runtime.

Decision: a project that needs more than one isolated core needs a larger vCPU allocation first, reapplying total minus one at the new size. Never hand every vCPU to TwinCAT; a guest with no core of its own cannot be logged into when the runtime misbehaves.

Bringing up the runtime in the TwinCAT/BSD guest #

  1. Install VMware Player or VMware Workstation on the Windows host.
  2. Create the virtual machine and install TwinCAT/BSD into it. Size the processors by the rule above so the guest keeps at least one core.
  3. Set UEFI firmware. If your VMware build offers the firmware choice in the machine's settings, select it there. If it does not, which is the reported case with Player, let one boot attempt fail, then edit the machine's .vmx file: replace any existing firmware line with firmware = "efi", or add that line if none exists.
  4. Give the guest a real place in the plant network. No documented address or adapter mode comes with this design, so use the addressing and adapter mode your subnet already relies on.
  5. Start the guest, add it in XAE as a target, download the project and set it running.
  6. Record the host CPU, the BIOS virtualization settings, the Windows build, the VMware build and the TwinCAT/BSD build with the project, because this design is practitioner-documented and that record is what makes the next fault diagnosable.

When the runtime must stay local #

Move the Hyper-V workload to its own machine first; nothing left on the runtime host may start the Windows hypervisor. Remove the Hyper-V entries from the Windows features, then disable virtualization technology in the BIOS or UEFI setup, and do not stop at the Windows features, because the reported case turned virtualization off in the BIOS as well. Make the BIOS change from the machine's own console in a maintenance window, not over a remote session, since a virtualization setting that other workloads depend on can leave them unable to start. Afterwards the local XAR starts as any runtime does. If it still refuses with no hypervisor consumer present, the cause sits elsewhere in version mismatch, adapter takeover or license class, not in Hyper-V.

Verifying the split before you trust it #

  • The Hyper-V workload still starts with Hyper-V enabled on the Windows host.
  • The guest boots, which confirms the firmware line took effect.
  • The runtime in the guest reaches its run state; a working engineering connection alone is not proof of execution.
  • The deployed project enters and holds its intended run state, not only at first download.
  • Versions are recorded: host CPU, BIOS virtualization settings, Windows build, VMware build, TwinCAT/BSD build.

Three outcomes, committed. One box must run Azure IoT Edge or another Hyper-V consumer plus TwinCAT code: XAE and the Hyper-V workload stay on the Windows host, the runtime runs in the TwinCAT/BSD guest under VMware Player or Workstation, verified on that host. The code must run on the local Windows runtime: the Hyper-V workload moves out, Hyper-V and BIOS virtualization go off, and the local runtime starts. The box only does engineering: nothing changes, because XAE is documented to work on a Hyper-V-enabled host as it is.

Questions asked

Does Hyper-V also stop TwinCAT 3 XAE from working?

No. XAE is an extension for Visual Studio, so its requirements are essentially Visual Studio's, and the vendor documents it as usable on a Hyper-V-enabled computer. Only the runtime is blocked. The block shows up when the local runtime should start, not when you open the engineering environment, which is why host-side engineering plus a guest runtime is a stable split.

Do WSL2 or Windows Sandbox block the local runtime like the Hyper-V role does?

Treat them the same. The restriction follows any component on the computer that uses Hyper-V, and those features start the same Windows hypervisor without the full Hyper-V role being installed. If a local runtime refuses to start, remove or relocate every hypervisor-based feature on that box before you look for another cause.

Does VirtualBox work instead of VMware for the TwinCAT/BSD guest?

The reported setup used VMware Player and VMware Workstation, and VirtualBox was not confirmed in that report. Treat VirtualBox as untested for this design. If you try it anyway, verify that the guest boots, the runtime reaches its run state and XAE can deploy to it before you rely on the machine.

Can Azure IoT Edge stay on the same computer as TwinCAT?

Yes, and that is the point of the virtual machine route. IoT Edge keeps using Hyper-V on the Windows host, XAE stays beside it, and only the runtime gives up the host by moving into the TwinCAT/BSD guest. Under this placement the Hyper-V workload never has to leave the box.

The guest boots but XAE cannot reach it. What comes next?

Check the network shape before the TwinCAT settings. Put the virtual adapter in the mode that places the guest inside your plant subnet, give it an address from that scheme, then add it in XAE as a target by that address. Confirm the host can reach the guest before you download a project to it.

Keep reading

  • How-to

    Running TwinCAT 3 in a Hyper-V VM on Windows 11

    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.

    Operating systems on the plant floor

  • How-to

    Running TwinCAT XAR on a third-party industrial PC

    Do not clone a factory IPC image onto other hardware. Install a licensed Windows 10 IoT Enterprise LTSC edition, install the runtime fresh, and qualify the real-time Ethernet port, CPU priority and jitter on the actual machine. A successful boot proves nothing, and network hardware the runtime vendor did not sell you is a self-supported component.

    Operating systems on the plant floor

  • Troubleshooting

    TwinCAT Visual Studio freezes when connected to an IPC target

    The 5 to 10 second stalls in Visual Studio are ADS timeouts on the link between the engineering PC and the IPC, not real-time or CPU problems: pointing the target at the local system or pulling the cable clears them. Work link negotiation, hostname routes, competing adapters and the ADS TCP session on port 48898, then finish with static addresses and an IP-based route.

    Operating systems on the plant floor