WSL icon indicating copy to clipboard operation
WSL copied to clipboard

Will this be Open Source?

Open sirinath opened this issue 10 years ago • 105 comments

Hopefully Bash On Windows will be opensource

sirinath avatar Apr 06 '16 17:04 sirinath

We have no firm plans as yet, but we're not averse to open-sourcing some of this tech.

bitcrazed avatar Apr 06 '16 21:04 bitcrazed

Hopefully you will be slanted towards open sourcing it with well documented internals to get other subsystems like Darwin, BSD, SmartOS or other systems running on Windows.

sirinath avatar Apr 07 '16 02:04 sirinath

There's lots of issues with terminal emulation in the first beta. This is particularly an area where open source availability would quicken the pace of bug fixing and compatibility.

BSalita avatar Apr 07 '16 22:04 BSalita

Can I vote for having lxcore.sys open? Just think of the possibilities in having a starting point for the community to implement other subsystems.

(Am I wrong in assuming that implementing a subsystem requires tight coupling with kernel internals that you don't want to have to keep that way for backwards compatibility in the future?)

poizan42 avatar Apr 08 '16 13:04 poizan42

Great conversation around open sourcing and we hear the requests. Might I suggest voting on this on our uservoice page?

russalex avatar Apr 11 '16 20:04 russalex

There is actually a very similar open-source project called flinux. Whic is based on the same idea of translating Linux Syscalls to Windows Syscalls. Mabye Windows team can get some inspiration from them :smile:

RaeesBhatti avatar Apr 11 '16 22:04 RaeesBhatti

I've just created a UserVoice feedback for this idea. Anyone interested can vote for this there.

RaeesBhatti avatar Apr 11 '16 23:04 RaeesBhatti

@raeesbhatti : it convert Linux calls directly to ɴᴛ calls. This is different since the windows subsystem _(win32k.sys)_is completely bypassed in favor oflxcore.sys (yes, windows is subsystem itself).

ytrezq avatar Sep 25 '16 19:09 ytrezq

@ytrezq: Yeah. A lot of people don't know that Windows NT was designed to be modular that way. It was originally designed to have three subsystems: Win32, POSIX, and OS/2.

Heck, drive letters are an artifact of the Win32 subsystem and NTFS can operate in a POSIX mode where the only characters disallowed in file names are NUL and /.

If it weren't for the whole "can't patch it or make derivative works and you have to pay license fees" part, we'd probably all be running some hybrid of Windows NT (for its modular kernel design and excellent UNC support) and Linux or BSD (for the elegant "hardlinks and open file handles are treated as equals in the reference counting" approach to allowing renaming and deleting of in-use files).

ssokolow avatar Sep 25 '16 19:09 ssokolow

@ssokolow : as I’m currently looking for a way to compile a native ᴅʟʟ for the ᴘᴘᴄ architecture without original hardware, I perfectly know that :-)

ytrezq avatar Sep 25 '16 19:09 ytrezq

I suspected as much. I probably should have been a bit more clear that my comment was for other people's benefit.

ssokolow avatar Sep 25 '16 20:09 ssokolow

@bitcrazed What about disclosing source code of /init binary? It has to use some of Ubuntu/Linux sources because it depends on libc.so.6. And it is non-Ubuntu binary for sure because it contains lxssmanager string inside.

slavanap avatar Nov 22 '16 21:11 slavanap

@slavanap All dynamically-linked Linux binaries depend on some version of libc.so and glibc's license specifically contains an exception to allow that for closed-source applications.

ssokolow avatar Nov 22 '16 21:11 ssokolow

Long story short, we are still working on /init. What is out there was required to get WSL out the door, but there are some pretty low level changes we need to make for future features. We're just not in a position to discuss open sourcing it yet.

We have had the larger open source conversation a number of times in house but the same story goes there. We have some new features that still need to be made before we can truly discuss feasibility and what parts of the project we can / make sense to open source. None of us are opposed to doing it, we just need to do it when it makes sense and do it right.

russalex avatar Nov 23 '16 01:11 russalex

@russalex @sunilmut A suggestion here: The ask here is basically what Red Hat has already established with Fedora. Fedora is open-source and anyone can contribute to it but only select portions of Fedora create Red Hat Enterprise Linux (RHEL) . Basically this means everything that's in RHEL is also in Fedora. Fedora just has more to it that's considered less "stable" by Red Hat. Microsoft can do the same with WSL and vet certain parts just like is done now with the WSL team. The only difference is someone outside Microsoft makes some improvement or feature available for WSL, the WSL team vets it to ensure the code is good and then go through the normal screening process. If something can be considered "stable" enough, it could even go into non-Insiders. At this point in the game, getting things such as FUSE, AF_Packet, and OpenCL/OpenGL implemented may be more easily accomplished by allowing developers outside of the WSL team to do the work for you. This will then satisfy the community (when it comes out as a "surprise!") and allow the WSL team to work on fixing bugs to make things more stable vice being forced to choose between whether a certain feature or bug has higher priority to meet Microsoft's vision to give developers a one-stop shop.

WSLUser avatar Jan 17 '18 13:01 WSLUser

You will see if Windows is opensourced by looking up the status code of https://github.com/Microsoft/Windows If it returns 404, no. If it returns 503, it is and GitHub is overcrowded. If it returns 200, it is and GitHub has been able to cope with crowd. If you think opensourcing, GPL2 is preferred. That way, Microsoft, Linux and ReactOS folks can collaborate. As WSL is a Windows component, we expect it to be in Windows repository in case of opensourcing.

erkinalp avatar Jan 17 '18 16:01 erkinalp

@erkinalp There's a difference between open-sourcing WSL and open-sourcing Windows 10. I do not expect them to open-source the OS (though that would be nice too, a fantasy dream though), just the Linux subsystem portion.

WSLUser avatar Jan 17 '18 16:01 WSLUser

There's a difference between open-sourcing WSL and open-sourcing Windows 10

It is impossible to opensource WSL but not Windows 10 kernel under GPL.

erkinalp avatar Jan 17 '18 17:01 erkinalp

@erkinalp There are two easy ways to open-source WSL without open-sourcing Windows 10.

  1. License it under "GPL plus a linking exception".

    Normally, you say "I grant you permission to use this under the terms of the GPL". A linking exception lets you say something like "I grant you permission to use GNU libc under the terms of the GPL, but I also grant you permission to compile proprietary programs against it without forcing the proprietary code to be open source."

    (The GPL forbids adding extra restrictions, but a linking exception is more like "Your choice of GPL2 or Apache2".)

    A linking exception could say "but I also grant you permission to link it against Microsoft's proprietary code without requiring that code to be released under the GPL."

    Then, the generally understood "If you contribute back, you agree to license your contributed code to the project under the same terms as you received" terms of licensing would Just Work™ as "GPL... but it can also be linked into Windows".

  2. Require copyright assignment

    If everything is owned by Microsoft, they can do whatever they want with it. (You're never bound by the license you offer to others beyond clauses in the GPL like "non-revokable". It's the "contributed patches are licensed TO you by others" that locks a license in.)

    If contributors sign over the rights to their code, then it's legally no different than Microsoft writing it all and there's no impediment to Microsoft "GPLing one copy and compiling another into the kernel".

    That's why it's possible for a sole rightsholder, like Sun Microsystems, to release a project like OpenOffice.org under a copyleft license, yet also sell proprietary licenses to IBM.

ssokolow avatar Jan 17 '18 17:01 ssokolow

To back what @ssokolow has said, Microsoft HAS open-sourced other applications such as Powershell and VSCode. Powershell specifically is deeply embedded in later versions of Windows because it's the replacement of CMD and they've only left CMD in place for those who might favor it or have more experience using it. MS made it clear though that you have to know Powershell via certifications. But now you can install on any system with the only limitation being how fast they can make it available to everyone while fixing all the bugs that have resulted from making it open source. WSL will be slightly different in this case because of the underlying infrastructure is supposed to be based on a system that's already publicly known how to work for decades. This is why we have so many distros available and more can continue to be developed. All one needs to do is compare the code used to make something POSIX compliant and make something map to it inside the NT kernel. The WSL team themselves have said they try to use Windows APIs for everything to make things easier and of course provides better interop. Anybody can look at those APIs because without them, there would be no software developed for Windows. We're not asking for a huge jump here, it's simply a natural extension of everything MS has already done. If they want to take it one step further and make the whole OS open-source great! Eventually MS might find itself in that rabbit hole but as long as they're still able to make profit off of Windows, I doubt they'll open-source it.

WSLUser avatar Jan 17 '18 18:01 WSLUser