What is the difference between Windows Subsystem for Linux (WSL), Cooperative Linux (coLinux), and Cygwin?

26

9

Did anybody still remember coLinux? I remember it is used for SpeedLinux and Portable Ubuntu some years ago.

It's pretty clear what is coLinux doing, running Linux on top of Windows somehow, but can use real linux partition. Meanwhile cygwin is recompiling linux apps to use on Windows.

But WSL? is WSL closer to coLinux or Cygwin?

Rinaldo Jonathan

Posted 2018-09-23T23:33:06.153

Reputation: 375

Answers

27

WSL would be closer to coLinux than Cygwin.


Keep in mind that Unix, POSIX and Linux are different things.

Cygwin is a POSIX compatibility layer that runs on top of the Win32 subsystem. It has approximately nothing to do with Linux; it can broadly be treated as "just another Unix-like" where porting programs requires recompilation and possibly source modification, and anything that requires non-POSIX Linux-specific features probably won't work.

WSL 1 is designed to be ABI-compatible with Linux proper. It does not use the real Linux kernel, but is compatible such that programs compiled for Linux can run on it without recompilation or translation. WSL is part of the NT kernel, so exists independently of the Win32 subsystem. This is similar to the older SUA, though that was a POSIX (not Linux!) subsystem on top of the NT kernel.

WSL 2, not yet available, will run a real Linux kernel on a lightweight VM. It promises similar Windows integration as WSL 1 but with a real Linux kernel (so kernel modules, filesystems, etc., should work).

coLinux runs a real (though modified) Linux kernel. On the Windows side, it exists as a driver that provides memory management and I/O access. Conceptually, it is closest to a virtual machine, though with closer integration between host and "guest".


From a program's perspective, both WSL and coLinux look approximately the same as a real Linux kernel running on raw hardware. WSL (currently) has more limitations and quirks, but also has first-party (Microsoft) support and wotks on x86_64. coLinux and WSL 2 are real Linux kernels, so will behave just like Linux, whereas WSL 1 is a clean-room implementation of the ABI.

Cygwin does not look any closer to Linux than, say, FreeBSD does.

Bob

Posted 2018-09-23T23:33:06.153

Reputation: 51 526

1I do agree that colinux is for now, much better. Its sad that nobody ported it to x86-64. – Rinaldo Jonathan – 2018-09-24T01:55:31.937

3@RinaldoJonathan Personally, I prefer the WSL approach. IMO the coLinux approach is relatively fragile (poorly defined interfaces between the two kernels). In fact, I'd take a full VM over coLinux. But it does depend on what you need. – Bob – 2018-09-24T02:01:05.543

7At the command-line prompt, Cygwin looks closer to Linux than FreeBSD does to Linux, because it provides the GNU user-space commands that are typically available on Linux systems, rather than the FreeBSD commands. – Diomidis Spinellis – 2019-04-09T13:51:45.390