If Windows 7 doesn't support WSL, then what is "Subsystem for UNIX-based Applications"?

26,814

Solution 1

Everyone says, that Linux subsystem,or WSL, IS only supported in windows 10.

Everyone is absolutely correct. Windows Linux Subsystem does not exist and cannot be enabled/installed on Windows 7.

Subsystem for UNIX-based Applications has nothing to do with the Windows 10 feature. It was also known as Interix before it was discontinued with the release of Windows 10.

Interix was an optional, POSIX-conformant Unix subsystem for Windows NT operating systems. Interix was a component of Windows Services for UNIX, and a superset of the Microsoft POSIX subsystem.

The tools that were supported were recompiled versions. The tools contained within a WSL instance are the same tools that run on Linux.

Unlike in the past the actual Linux distribution, is compiled into a UWP application, which interfaces with the Linux Subsystem allowing virtually any Linux distribution to now be compatible.

We distribute Linux distros for WSL as UWP applications through the Microsoft Store. You can install those applications that will then run on WSL - the subsystem that sits in the Windows kernel. This delivery mechanism has many benefits as discussed in an earlier blog post.

Source: Creating a Custom Linux Distro for WSL

There is an inherited limitation dealing with Linux kernel level drivers (they are not supported) so all devices interface indirectly with the Windows device driver.

Source: Interix

Solution 2

TL;DR

There were many Unix subsystems in Windows in the past, providing POSIX APIs for compiling Unix code without porting to Windows

WSL is a new subsystem in Windows 10 for running Linux ELF files directly without recompilation


In the 1980s the US federal government required that certain types of government purchases be POSIX-compliant, therefore MS had to include a POSIX subsystem in Windows

Microsoft POSIX subsystem is one of four subsystems shipped with the first versions of Windows NT. (The other three being the Win32 subsystem which provided the primary programming API for Windows NT, plus the OS/2 and security subsystems.)

https://en.wikipedia.org/wiki/Microsoft_POSIX_subsystem

That was one of the reasons of POSIX filename support in NTFS, and the existence of the registry key HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\kernel\ObCaseInsensitive for compatibility with case-sensitive file names in POSIX subsystem and on the network

However the POSIX subsystem only implements POSIX.1 which doesn't include command line tools. In Windows XP / Windows Server 2003 it has been replaced with Windows Services for UNIX (SFU) which is what you see. It's much more powerful and was later renamed to Subsystem for UNIX-based Applications in Windows Vista, Windows Server 2008, Windows 7 and Windows Server 2008 R2

Subsystem for UNIX-based Applications (SUA) is a source-compatibility subsystem for compiling and running custom UNIX-based applications on a computer running a Microsoft® Windows® server-class operating system. You can make your UNIX applications fully interoperable with Windows in SUA with little or no change to your original source code.

Subsystem for UNIX-based Applications

SUA was removed in Windows 8 and Windows Server 2012


Unlike WSL in Windows 10, those subsystems are not meant for running Linux ELF executable files directly, therefore you'll have to recompile for that subsystem if you want to run under it

Further reading:

Share:
26,814

Related videos on Youtube

PragmaticEd
Author by

PragmaticEd

Updated on September 18, 2022

Comments

  • PragmaticEd
    PragmaticEd almost 2 years

    Everyone says that the Linux subsystem, or WSL, is only supported in Windows 10.

    Screenshot of WSL option

    So if this is true, can someone explain what does this, very similar looking, option in Windows 7 mean? What exactly does it enable?

    Screenshot of subsystem for Unix-based applications option

  • Darren
    Darren about 5 years
    Good answer, but unless I’m mistaken you haven’t actually said what the SFU is for - that is, mounting NFS shares etc - only what it can’t be used for.
  • Ben Voigt
    Ben Voigt about 5 years
    @Darren: I think you're mistaken, the quote block says "Subsystem for UNIX-based Applications (SUA) is ... for compiling and running custom UNIX-based applications on a computer running a Microsoft® Windows® server-class operating system" The NFS network redirector is a different component, also visible in OP's screenshot.
  • Ben Voigt
    Ben Voigt about 5 years
    No, the Linux distribution isn't compiled as UWP. The ELF executables run directly.
  • Darren
    Darren about 5 years
    @BenVoigt hmm, maybe. It’s been a while since I did anything like that, but was sure I’ve used it to mount NFS shares.
  • Darren
    Darren about 5 years
  • Ben Voigt
    Ben Voigt about 5 years
    @Darren: Not the same component as "Subsystem for UNIX-based Applications".
  • Darren
    Darren about 5 years
    @BenVoigt the answer specifically says Windows Services for Unix (SFU) became SUA in Windows Vista onwards.
  • Ben Voigt
    Ben Voigt about 5 years
    @Darren: Most of it did, but the NFS file share support was split off into a separate component (Services for NFS, subcomponent Client for NFS)... It's visible right there as the very first checkbox in OP's Windows 7 screen image, and it's a few rows off-screen in the Windows 10 screenshot.
  • terdon
    terdon about 5 years
    How could you compile a distribution into a UWP application? What would that even mean? A distribution is a large collection of executables, scripts, configuration files etc. It isn't a single thing. I admit I haven't used Windows since the 90s so I don't know how this works, but are you sure an entire distribution is somehow packaged as a single thing? That really doesn't make much sense to me. AFAIK, the WSL is just a compatibility layer allowing the execution of Linux tools on the Windows machine.
  • Ramhound
    Ramhound about 5 years
    @terdon - I will work on the statement, but WSL is NOT just a compatibility layer, that runs Linux tools. I can remote into my Kali WSL instance. The Kali instance when properly configured has a desktop, while remotely accessing it, it can run applications with a GUI. Blog
  • terdon
    terdon about 5 years
    @Ramhound yes, but all of those are presumably running through the same compatibility layer. And I call it this because that's what it's called on WIkipedia and because it is described as "the space between the user mode Linux binaries and the Windows kernel components where the magic happens." on the official msdn blog, and it's commonly referred to as such.
  • Ramhound
    Ramhound about 5 years
    @terdon - I Provided a source for my statement and I stand by the verbiage I used. While it might be overly simplified, it is indeed accurate, to say the distribution is compiled into a UWP application.. Microsoft themselves say the distribution is compiled into a UWP (launcher) application.
  • terdon
    terdon about 5 years
    Thanks! That helps. I think they may be simply referring to their bundling of various tools (the distro) together which can then run via the WSL but that quote helps, thanks.
  • Ramhound
    Ramhound about 5 years
    @terdon - You can install almost any tool though from the same repository that Ubuntu would use to install the tool. I believe my answer is clear enough at this point
  • Ramhound
    Ramhound about 5 years
    Turns out WSL will start to run the actual Linux kernel in a future version of Windows 10. I will update my answer when that happens.