← Back to Articles

Why can’t you run Windows or Mac programs on Linux?

Featured Image

Have you ever wondered why you can’t run programs that are designed for one operating system on another? And yet you can run a whole operating system inside another operating system? How does that work?

Why you can’t run Windows or Mac programs on Linux directly

You might think that a computer program is nothing more than a set of instructions for the CPU, so you think you’d be able to run any program on any operating system. But you can’t – why? The simple answer is dependencies. You see, while the CPU can indeed understand the binary instructions of a program, the program often relies on services and libraries provided by the operating system to do things like display graphics, handle files, or manage memory. These services are called system calls and libraries.

A Windows program, for example, is written to make system calls to the Windows operating system and use shared / dynamic libraries that are found on a Windows system. Those system calls and libraries simply do not exist in Linux. It’s like taking a car engine out of a car and trying to run it without the rest of the car – it just won’t work because the engine depends on the fuel system, cooling system, and electrical system to function. Similarly, a computer program relies on certain system calls and libraries to work, and if those are missing, the program won’t work.

What about Wine?

Now, you might be wondering how tools like Wine and VirtualBox allow you to run Windows programs on Linux. Excellent question! Think of Wine as those neccessary systems that the car engine needs to run. If we take out the engine out of the car, it won’t work because there is no spark plugs, no fuel, no cooling system, no exhaust etc. Wine provides those missing parts to the engine (program) so it can run on Linux. The engine (program) needs certain system calls and relies on specific libraries to function, and Wine provides those missing pieces to make it work on Linux. It’s like taking the engine out of the original car and building all the necessary parts and systems around it so it can run on its own. We don’t need to build the whole car – just the parts that the engine needs to run.

But you say, “Well, it doesn’t do a very good job, some programs are completely broken when run with Wine.” That’s true, and it’s because Windows is a closed system, and Wine has to reverse-engineer how Windows works to provide those missing parts. Microsoft doesn’t share how Windows works, so Wine is trying to do the best it can to get all the parts right. It’s like trying to build a specific car without the car manual – or without ever having seen the car before.

What about VirtualBox?

“Ok”, you might say, “but why do we even bother with Wine and trying to build the missing parts? We can run the whole operating system in VirtualBox and all the programs of that operating system will work perfectly fine without any issues, how does that work?”. I’m glad you asked. Think of VirtualBox like a truck trailer. Linux is the big truck that can carry another car inside of it. The car inside is the full system, not just the engine. You can turn the car on, you can even drive it inside the truck – everything will work! That is exactly what happens when you run Windows inside VirtualBox. You are running the whole system, not just one program, so everything works because you have all the necessary parts (dependencies) that the program needs to run.

In summary, running a program on an operating system is like trying to run a car engine without the rest of the car. The engine needs the fuel system, cooling system, and electrical system to run, just like a program needs system calls and libraries to function. Wine provides those missing parts to the engine (program) so it can run on Linux, while VirtualBox allows you to run the whole system inside another system, ensuring that all the necessary parts are present for the program to work.

Listen to Deep Dive

Download