Run Windows x86 as VM on Toradex

Hi
I have an x86 Executable App, and I want to run it on my Toradex Module. Could I Run Windows x86 on a Virtual machine on toradex SOM?
Now I have Imx6, but I could change it for better performance if it works.
Let me have your Recommendations
Tnx

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Running a Windows x86 virtual machine on a Toradex System on Module (SoM) like the i.MX6 is not straightforward due to the architectural differences and performance constraints. The i.MX6 is based on the ARM architecture, which is fundamentally different from the x86 architecture. Emulating x86 on ARM can be very resource-intensive and may not provide satisfactory performance for most applications.

Here are a few recommendations:

  1. Cross-Compilation or Porting: If possible, consider cross-compiling or porting your x86 application to run natively on ARM. This would involve recompiling the application for the ARM architecture. Depending on the complexity of your application, this might be a feasible solution.

  2. QEMU Emulation: You could use QEMU, an open-source emulator, to emulate an x86 environment on your ARM-based SoM. However, this approach is likely to be slow and may not be suitable for performance-intensive applications.

  3. Upgrade to a More Powerful SoM: If you decide to go the emulation route, you might want to consider upgrading to a more powerful SoM like the i.MX8 series, which offers better performance. However, even with a more powerful SoM, emulation will still have significant overhead.

  4. Alternative Solutions: If your application can be run on Linux, you might consider running a Linux version of your application on the Toradex SoM. This would avoid the need for emulation and provide better performance.

  5. Windows on ARM: If your application can be recompiled for Windows on ARM, you might consider running it on a Windows IoT Core environment on an ARM-based SoM. However, this would also require significant changes to your application.

In summary, running a Windows x86 virtual machine on an ARM-based Toradex SoM like the i.MX6 is not recommended due to performance and compatibility issues. Porting your application to run natively on ARM or exploring other alternatives would be more effective solutions.

Please, also check if these links can help you solve your problem:

Add my custom image to TEZI feeds list.

My recommendation would be to retarget the application to Linux on ARM (ie, recompile); you’d need of course to also make sure you compile the build-time and runtime dependencies for your particular application.

To execute a VM with an SoM you’d need QEMU which can be obtained from the meta Yocto layer /meta/recipes-devtools/qemu/ or from the regular Debian repositories if you’re running Torizon (it’s actually plenty possible to run QEMU from a container and may be even easier). But I wouldn’t recommend this as it may take more time and effort than just porting and you may end up with a subpar result in terms of performance or functionality - we cannot guarantee everything will work.

Another option, but this would be much, much more intricate to setup, debug and generally make it work would be userspace emulation with projects like FEX and Box86 (with Wine if your application uses some of the Windows userspace APIs). Again, I would not recommend this option if you’re not very comfortable with possibly debugging opcodes and compiling/testing very complicated software by yourself.

1 Like

Hi
My application uses some x86 .Net DLL or C++ Lib that I don’t have access to the source of.
So, Is it possible to run my application with QEMU?

Do you recommend a Guide or document about this ?

So, Is it possible to run my application with QEMU?

There’s isn’t a clear-cut answer to this, as you’d need to integrate QEMU itself either into your build (from the link I previously shared) or use it from Torizon OS within a container and then test if the result is suitable for your needs.

Do you recommend a Guide or document about this ?

We don’t have that documentation at the moment. But the general gist is that you’d need to install QEMU, choose an apropriate virtual machine and run your application. Or as I mentioned before, try to integrate with Wine + FEX or Box86. We don’t have guides for that either, as it’s not a supported use-case. I recommend following each project’s documentation.

Hi
May I know your experience with using QEMU with Wine? Is this integration reliable and recommended for use?
I checked, and it shows that it works. Do you have any idea compare to Box86 or FEX

May I know your experience with using QEMU with Wine? Is this integration reliable and recommended for use?

So, these are separate things: QEMU is a hypervisor/emulator that runs virtual machines. Wine is a userspace compatibility layer that allows you to run unmodified binaries built for Windows on Linux.

With QEMU you’d need a whole disk image that has a full operating system, in this case Windows.

With Wine you just need to run your application, but support may be extremely limited depending on what you’re trying to achieve. In your case, it’s a non-native (x86) binary for Windows, so you wouldn’t even be able to run with just Wine, as it doesn’t take care of the target instruction set architectural diferences, just the runtime itself. Hence, that’s where projects like FEX or Box86 come in; these provide the target ISA differences by emulating the opcodes into another architecture and may work in conjunction to Wine.

I can’t tell if this is reliable in a production setting as I never deployed something like this specifically for embedded, and as I’ve mention before would advise against it.