What is different about the way Windows runs an executable and Linux runs an executable? Why did they have to be different? Besides, why don't Linux executables have a file extension?

I'm not asking about how to make a EXE file work on Linux.

I'm asking why it does not work.


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).

  • 11
    "Vocabulary" is an excellent analogy. – Dennis Williamson Nov 11 '10 at 18:32
  • I think you meant completely different. – Mircea Chirea Nov 11 '10 at 21:28
  • Android also supports Linux bnaries(not packages) if they are compiled for ARM because it is based on Linux – Suici Doga Feb 20 '16 at 8:11
  • @SuiciDoga Sort of, but it's more complicated than that. The Android kernel can run Linux binaries (if they're compiled for the right kernel ABI, e.g. wrt the use of NEON registers), but if you want to run dynamically-linked programs, you have to install all the libraries as well. (And if you do that you could install a package manager too, so “binaries but not package” isn't really true.) – Gilles 'SO- stop being evil' Feb 20 '16 at 14:01
  • Yes ,I know about that you have to change library path etc – Suici Doga Feb 20 '16 at 15:32

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.


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.

  • 2
    Somehow I'd like to believe that Bill Gates answered my question ;-) – Nav Jul 31 '16 at 17:24
  • Re "When Windows hands that unreleased memory space out to another application, it crashes and burns.": That doesn't sound plausible, even in 2010. – Peter Mortensen Dec 18 '20 at 16:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.