Today we’re very excited to announce the open-source release of the Windows Subsystem for Linux. This is the result of a multiyear effort to prepare for this, and a great closure to the first ever issue raised on the Microsoft/WSL repo: Will this be Open Source? · Issue #1 · microsoft/WSL.
That means that the code that powers WSL is now available on GitHub at Microsoft/WSL and open sourced to the community! You can download WSL and build it from source, add new fixes and features and participate in WSL’s active development.
↫ Pierre Boulay at the Windows Blogs
Windows Subsystem for Linux seems like a relatively popular choice for people who want a modern, Linux-based development environment but are stuck using Windows. I’m happy to see Microsoft releasing it as open source, which is no longer something to be surprised by at this point in time. It leaves one to wonder how long it’s going to be before more parts of Windows will be released as open source, since it could allow Microsoft’s leadership to justify some serious job cuts.
I honestly have no idea how close to the real thing Windows Subsystem for Linux is, and if it can actually fully replace a proper Linux installation, with all the functionality and performance that entails. I’m no developer, have no interest in Windows, so I’ve never actually tried it. I’d love to hear some experiences from all of you.
Aside from releasing WSL as open source, Microsoft also released a new command-line text editor – simply called Edit. It’s also open source, in its early stages, and is basically the equivalent of Nano. It turns out 32bit versions of Windows up until Windows 10 still shipped with the MS-DOS Editor, but obviously that one needed a replacement. It already has support for multiple documents, mouse support, and a few more basic features.
WSL1 is like FreeBSD’s support for Linux binaries… but they discovered that long-tail compatibility is a pain so WSL2 is similar to how Docker works on macOS… it’s the actual Linux kernel running in a lightweight VM with various integration shims like WSLg (a rootless Wayland implementation which is based on Weston IIRC).
I haven’t used any Windows newer than 7 but, if I remember what was described correctly, the filename compatibility requirements for Explorer/Win32 vs. POSIX mean that NTFS gets configured to behave sort of like two ZFS datasets in the same pool with a Cygwin-esque/FUSE-esque/VirtualBox Guest Extensions-esque mechanism for letting the Linux stuff access the part of your drive where NTFS is operating in Win32-personality mode instead of POSIX-personality mode… and the main negative comment I’ve heard is that disk I/O on at least the shared stuff is worse.
…though that might just be “NTFS really isn’t that bad” – Robert Collins (LCA 2020) problems. (TL;DR: Your standard Windows loadout hooks a lot of gunk like on-demand virus scanning into the disk I/O stack.)
Basically yeah.
WSL1 stored it’s files on NTFS somewhere in %APPDATA% with extra metadata for POSIX-related stuff, but that had two major issues. For one, it caused issues if you happened to add or remove those files from Win32 apps. Second, NTFS has lousy performance when creating/destroying many small files (Such as unpacking or deleting a source tree, which is a very common task). Like, it might take an hour to unpack the Linux kernel tree from within WSL1
WSL2 uses a VHD disk image for its root FS, so working within that happens at near native speed. However, accessing Windows drives is slower in many ways than the root-on-NTFS of WSL1, so disk IO on Windows filesystems is even worse.
WSL2/WSLg also has an incredibly cursed network stack, because it’s running as a NAT’d Hyper-V VM, and doesn’t play well with native Windows VPN clients, which cripples it on most company issue remote work machines. IPv6 doesn’t work reliably in any mode. Running a second VPN/overlay client directly inside WSL is probably the easiest way to get it working.
runciblebatleth,
That’s an interesting observation. I never use linux networking capabilities under WSL However I have used virtualbox on windows to create a virtual linux router.. This worked because virtualbox allows remapping physical and virtual network devices into the VM. This was really helpful in solving some issues I had with windows VPNs forcefully taking control of the IP stack on the host. By routing things into linux I could use the linux networking facilities without interference from the VPN software.
Edit is definitely meant to be Nano-like, which is great because Nano rocks.
With WSL you can just run `wsl nano` straight from any Windows terminal.
there are also windows-nativeish versions of nano (or emacs if that’s your thing)
From a user perspective, WSL operates a bit like Distrobox in that it let’s you run multiple different userlands (distros) on a shared kernel. In the case of Windows, a Linux kernel is run in a virtual machine to support this.
The “kernel” used in WSL 2 is an actual Linux kernel, from Microsoft, that is also available as Open Source from Microsoft. You can build the WSL Linux kernel on a real Linux distro if you like.
What windows really need is a ncurses (ur similar) implementation of regedit that can run under powershell.
Is it weird that I find the release of Edit the most interesting part of this post? Looks fabulous!
What I like about WSL is that the integration between the two operating system “just works”. You can start a server in Linux on localhost and access it in Windows (and the other way around). You can also access all Windows drives under `/mnt/`. You can call Linux commands from Windows and Windows commands from Linux.
It absolutely is.
For us has been a game changer to have access to all the windows-native apps/desktop, while having access to a full linux development environment we can seamlessly deploy into our compute back end. On a single windows box. Usually a laptop, that can be easier to justify and integrate within the usual org authentication infrastructure and corporate ware.
Microsoft really became a much more different/pragmatic org under Nadella
I agree with your thoughts on Nadella.
The major reason though is that Windows no longer needs to be protected and walled off in the same way. Azure and AI are the two jewels in the crown now. For both of those, Linux is at the forefront and it is still “developers, developers, developers” as Balmer famously chanted. So Microsoft needs a way to bring Linux developers to Windows.
I am sure some Windows Product Manager is trying to figure out how to embrace and extend Linux but it just makes so much more strategic sense to be compatible with it.
At this point, the only role Windows really has at Microsoft is as the desktop platform for Office (or Microsoft 365 now I guess)). But Microsoft’s “agentic web” vision pushes even Office aside eventually. Client computers are meant to be little more than order taking windows to drive the semi-autonomous robots in the cloud that we are meant to rent.
FWIW Windows is still a pretty important business unit for Microsoft.
Microsoft is truly gigantic now. So much so that windows is among many of their cash cows.
Fascinating how things turned out with them becoming one of the largest contributors to the Linux kernel. Bet a lot of people wouldn’t have seen that coming a couple of decades ago.
If I had the time, a project I would like to work on would be to bring Flatpak to Windows. There is no reason that it could not integrate with WSL running the freedesktop platform on top of the WSL Linux kernel and offering the same level of GUI and network integration. The big difference between that and WSL now is that you would have no concept of a distribution at the user level. You would not go into WSL to run Linux apps, you would just install apps from Flathub and they would run on Windows. Non-technical users would not even have to know what Linux was. Flathub would just be an “app store”. This would make Flatpak a universal application distribution platform for both Linux and Windows. Something similar could be done for macOS but it would be more work.
So, if you were an application publisher, you could create a single application binary (the Linux Flatpak version) and distribute it to all users. Instead of making a Windows version of GIMP, you could simply direct users to Flathub. If Windows users accepted it, it could allow smaller dev shops to create the Flatpak version instead of a Windows-only version and to support both Windows and Linux users with it. If you added a way to charge for software, commercial providers could use it as a distribution strategy. Done right, it could result in far more software being available in Flathub.
I hardly use Windows anymore myself but this would be a cool project.