Why won't Windows EXE files work on Linux?
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: The Builders
--
Chapters
00:00 Why Won'T Windows Exe Files Work On Linux?
00:27 Answer 1 Score 14
00:45 Accepted Answer Score 54
01:59 Answer 3 Score 0
02:52 Thank you
--
Full question
https://superuser.com/questions/209703/w...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#linux #windows #emulation
#avk47
ACCEPTED ANSWER
Score 54
Linux and Windows executables use different formats. Linux uses the ELF format on most architectures, while Windows uses the PE format. ELF is better suited to the way Linux manages shared libraries, and PE is better suited to the way Windows manages shared libraries, but there's no fundamental reason why Linux couldn't execute PE executables or Windows ELF executables. In fact Linux can execute PE executables, through Wine.
The difficulty is that Windows and Linux have completely different APIs: they have different kernel interfaces and sets of libraries. So to actually run a Windows application, Linux would need to emulate all the API calls that the application makes. That's a lot of work. Wine does it to some extent, but it's very hard, especially since the maker of Windows doesn't cooperate. You can compare it with, say, learning English when your native language is Chinese: the executable format is the alphabet (not that hard to master), the API is the vocabulary (takes years to get to a level where you can start reading literature).
ANSWER 2
Score 14
Windows binaries have a different ABI and use a different API than Linux binaries.
Linux binaries don't need an extension because *nix uses permission bits to identify an executable instead of the extension.
ANSWER 3
Score 0
This is how I heard the Windows side explained in layman's terms from programmers.
In Windows there are hooks in programs and the OS that EXE files make calls to that just won't be there in Linux. Because of the differences in both the environments. Initially Linux looks for permissions, and Windows looks for a linkable format first by examining the extension, looking at properties, and then looking inside the EXE file, etc.
There are applications like Netbackup that started out on Linux and have been modified to run in a Windows environment without using Wine. IMHO, frequently those are some of the most stable best behaving Windows applications.
When Windows applications become unruly usually it is because some of those hooks held by the application weren't completely released and Windows thinks they were (memory leaks). When Windows hands that unreleased memory space out to another application, it crashes and burns.