17 ms·
Shipping a Linux Kernel with Windows
- loudmax 8y agoNext, please provide a Windows kernel for Linux or other open source operating systems. There are many of us whose biggest frustration running an open source OS is working around Windows executables, Windows only drivers, and Microsoft proprietary file formats.
- 781 8y agoHow does this true Linux Kernel talk with the rest of Windows? How does it access the Windows file system?
- yodon 8y agoThe same way the current implementation does. The news here is not that Windows can run Linux natively, that's been true since 2016.
- 781 8y agoThe current implementation is a shim over the NT kernel. This new one is a true Linux kernel.
- alkonaut 8y agoPerhaps more interesting then is how the true Linux Kernel works with NTFS without paying the tax that usually comes with the fancy NTFS features
- resoluteteeth 8y agoIt's obviously not mounting the NTFS filesystem directly, since it's already in use by Windows, so this is irrelevant to how NTFS is normally mounted in linux.
- 0x54D5 8y agoThe Windows disks are mounted at /mnt/c /mnt/d etc The real issue is being able to read the WSL disk from Windows which you have to access as a network share from localhost
- the8472 8y agonfs, cifs, virtio-9p? or virtio-fs, whenever that lands.
- amatwl 8y agoIf it's anything like the Linux files inside File Explorer supported they added previously (https://devblogs.microsoft.com/commandline/whats-new-for-wsl-in-windows-10-version-1903/ https://devblogs.microsoft.com/commandline/whats-new-for-wsl...), it'll be using some derivative of Plan 9.
- sbisson 8y agoWindows uses 9P, it uses CIFS.
- october_sky 8y agoI can't help but think that this is 10 years too late. I gave up on Windows a long time ago, as did many people I know. I know there are folks who find this valuable, but I think Microsoft is chasing a pool of power users that has been consistently shrinking year-over-year. With that said, perhaps the pool will get bigger as it exposes users to the power of command line :-)
- atonse 8y agoI feel it's actually a bid to lure back developers that code on linux-based open source tools (pretty much everything) but use MacOS because desktop linux never was a thing. So this starts to potentially make windows an alternative to macOS for developers. I moved to macOS because it was like having a linux/unix distribution that wasn't ugly, and just worked really well. But I'm more than happy at the _idea_ that there's a viable alternative that allows me to still have high res displays and decent graphics and support, while allowing me to develop on a system that's a first-class citizen for most open source tools (which is Linux).
- thedaemon 8y agoUnfortunately you will be disappointed by Windows 10's user interface. They have made it ugly and harder to use; mostly partially implemented changes. So Windows 10 UI is still in Alpha it seems. I suggest that you keep your macOS for now. Hopefully they will get the GUI in order soon.
- beart 8y agoI can't help but think that this is better late than never. Every few years over the last 15, I attempt a move to *nix and every time I am disappointed for various reasons (drivers, package versioning, documentation and support, users experience when not using a command line, etc). However, I am always jealous of the tools available and if MS can bring those to the Windows world, I honestly don't know that I will ever bother looking elsewhere again.
- munchbunny 8y agoWith that said, perhaps the pool will get bigger as it exposes users to the power of command line :-) Not sure what you mean. Windows has been using PowerShell for almost a decade now as the Bash equivalent "everything at your fingertips" command line tool. Personal opinion, in many ways PowerShell is more powerful than Bash. It's more verbose, but it's also easier to script.
- DesiLurker 8y agoEmbrace, extend, and extinguish
- petters 8y agoIs this legal? It obviously is, but how? I thought the GPL would require Microsoft to ship the Windows source code? I suppose it counts as a separate component.
- wongmjane 8y ago> The kernel provided for WSL2 will be fully open source! When WSL2 is released in Windows Insider builds, instructions for creating your own WSL kernel will be made available on Github. The kernel part will be fully open source, which should be sufficient enough to comply with GPL (IANAL)
- jcelerier 8y ago> which should be sufficient enough to comply with GPL this is an age-old debate. Some people say that it is e.g. legal to make (redistribute to precise) a GPL device driver for windows, and some argue that it is not, because the whole kernel should then be GPL. > https://linux.slashdot.org/story/02/11/05/0051225/gpl-issues-surrounding-commercial-device-drivers https://linux.slashdot.org/story/02/11/05/0051225/gpl-issues...
- 781 8y agoBut in Windows drivers are binary files which talk to the kernel through an API. Not much different than a binary user mode application. If binary user mode applications written in GPL are ok, then so should this.
- jcelerier 8y ago> Not much different than a binary user mode application. well, user-mode applications do syscalls to the kernel, not direct function calls.
- 781 8y agoBut the actual syscall is made by a Windows user mode library - kernel32.dll/... So your GPL user mode app calls directly into proprietary Windows library.
- lmz 8y agoDoes anyone have a link to an explanation of why they moved to this approach in WSL 2? Edit: more info here: https://devblogs.microsoft.com/commandline/announcing-wsl-2/ https://devblogs.microsoft.com/commandline/announcing-wsl-2/
- MikusR 8y agoProbably for the same reason they adopted Chromium as base for their browser.
- tyingq 8y agoAhh, from your link: "dramatic file system performance increases, and full system call compatibility, meaning you can run more Linux apps in WSL 2 such as Docker." That will be welcome. I use WSL, but it's currently very slow for anything that touches lots of files, like a git clone, rsync, etc.
- gfiorav 8y agoI use WSL at work and use windows docker as a server... I use docker client form wsl ubuntu and make it connect to the Docker server running on windows. I do the same thing with databases. I’ve grown fond of this approach, as it integrates well with the Services app in windows. https://nickjanetakis.com/blog/setting-up-docker-for-windows-and-wsl-to-work-flawlessly https://nickjanetakis.com/blog/setting-up-docker-for-windows...
- DuskStar 8y agoThat is not the most secure way to run Docker in WSL - IIRC exposing the Docker socket on localhost lets websites start Docker containers. If you use something like npiperelay [0], you can access Docker from WSL without exposing the Docker socket to everything. 0: https://github.com/jstarks/npiperelay https://github.com/jstarks/npiperelay
- zeusk 8y agoCan't docker restrict incoming connections from a whitelist? Or you could use the system firewall to ensure that it does.
- ericfrederich 8y agoWSL used to have very good blog posts and videos explaining the workings of WSL. There haven't been any updates in a while, this is disappointing.
- xxpor 8y agoBased on the fact that this seems like a complete change in implementation, I would have to assume that there just wasn't much to write about because people would be focused on 2.
- Sangeppato 8y agoThey basically completely abandoned the previous approach and started from scratch with a new one, so I'd say it's normal
- lenkite 8y agoI hope it will be possible to run docker seamlessly without a virtual machine and lots of extra setup once this ships. That will be a big advantage over MacOS where you need to run a fat VM that gobbles your memory and takes time to start-up.
- thesandlord 8y agoIt seems that WSL2 is VM based instead of the WSL1 architecture: https://devblogs.microsoft.com/commandline/announcing-wsl-2/ https://devblogs.microsoft.com/commandline/announcing-wsl-2/ > WSL 2 uses the latest and greatest in virtualization technology to run its Linux kernel inside of a lightweight utility virtual machine (VM). However, WSL 2 will NOT be a traditional VM experience.
- gfiorav 8y agoUse the Windows docker as a server and have your WSL/Linux client connect to it through local https://nickjanetakis.com/blog/setting-up-docker-for-windows-and-wsl-to-work-flawlessly https://nickjanetakis.com/blog/setting-up-docker-for-windows...
- lenkite 8y agoAlready know about this: this still means a big VM eating up memory
- adontz 8y agoActually, this looks like bad news to me. If WSL v2 is running VM under the hood, no wonder it will be Hyper-V. We already have such lightweight VM for "Credential Guard/Device Guard" and it already conflicts will any other hypervisor: VMWare workstation [1], VirtualBox. Resolution is to disable Hyper-V, for instance, with command line bcdedit /set hypervisorlaunchtype off So most probably WSL v2 will do the same, which means one cannot run WSL v2 and non Hyper-V VMs at the same time, because two different hypervisors can't coexist. [1] https://kb.vmware.com/s/article/2146361 https://kb.vmware.com/s/article/2146361
- tjoff 8y agoOuch... I guess there is no hope that one will be able to continue to use WSL v1?
- eightysixfour 8y agoThe article states they’ll live side by side.
- dragonwriter 8y ago> I guess there is no hope that one will be able to continue to use WSL v1? Looks like that guess is wrong: “WSL 2 is a new version of the architecture that powers the Windows Subsystem for Linux to run ELF64 Linux binaries on Windows. This new architecture changes how these Linux binaries interact with Windows and your computer’s hardware, but still provides the same user experience as in WSL 1 (the current widely available version). Individual Linux distros can be run either as a WSL 1 distro, or as a WSL 2 distro, can be upgraded or downgraded at any time, and you can run WSL 1 and WSL 2 distros side by side. WSL 2 uses an entirely new architecture that uses a real Linux kernel.” https://devblogs.microsoft.com/commandline/announcing-wsl-2/ https://devblogs.microsoft.com/commandline/announcing-wsl-2/
- n3mes1s 8y agoJust adding that virtualbox 6 works(ish) [1] with hyper-v thanks to the use of the virtualization API [2] to setup the VM. [1] https://forums.virtualbox.org/viewtopic.php?f=6&t=90853 https://forums.virtualbox.org/viewtopic.php?f=6&t=90853 [2] https://docs.microsoft.com/en-us/virtualization/api/ https://docs.microsoft.com/en-us/virtualization/api/
- sneakernets 8y agoWe've gone from "Linux is a cancer" to "This is an exciting day for all of us on the Linux team at Microsoft" in just one generation. Good. I hope this trend continues.
- jgoerzen 8y agoTranslation: "Linux is eating our lunch. If you can't beat 'em, join 'em." Linux has already thoroughly trounced Windows in mobile (Android). It's done so in the web space. MS still has a strong foothold in enterprise, but it doesn't take a genius to see Linux continuing to expand on at least the backend in enterprise as well. With more apps being delivered over the web, and web browsers being cross-platform, the desktop choice becomes less OS-centric for rote workers. I can see this as Microsoft looking into a future where they lose relevance because of ChromeOS eating up the low end and MacOS eating up the high end, and they're left with institutional traction. Which they can coast on for many years, but not forever.
- James_Owens_69 8y agoSo...why should I use Windows in the first place when I have Linux for free?
- koala_man 8y agoI can't believe http://www.mslinux.org/ http://www.mslinux.org/ is actually happening
- pjmlp 8y agoIt already did, check Azure Sphere.
- deleted 8y ago[deleted]
- KeenFox 8y agoWindows Subsystem for Linux 2: ELFectric Boogaloo
- just_myles 8y agoBeen using WSL since I switched to a Windows shop and it's a good lightweight alternative. I don't run a lot of the big tasks that I used to but, it's nice to have. Installing certain apps do tend to be on the slow side so if WSLv2 can resolve this, that would be great news. As for the implementation is concerned, I have no idea what they are talking about.
- mrbonner 8y agoI’m debating the possibility of moving out of MacOS and just get a Windows 10 Surface device. I don’t mind the Windows UI but feel like WSL may not be adequate for me. With this rate of change inside MS OS team, I won’t be surprised when one day, Windows would embrace the Linux kernel and just build the UI on top of it. Look at what the IE team does with Chromium. Somehow, I think MS needs to cannibalize its own business (OS or browser) to set itself for a comeback in the near future.
- microwavecamera 8y agoThis. I was thinking the same thing. I would not be shocked if MS switched Windows to a Linux kernel. It would save them billions in R&D and support.
- qqn 8y agoEmbrace, extend... exist?
- thunderbong 8y agoYou're kidding, right? Do you have any idea of the Windows userbase?
- MagicPropmaker 8y agoExactly. Windows 10 is a much better operating system than Linux for a broad range of applications, and the desktop. I develop on Windows 10, and am quite happy using a VM (not WSL) for my Centos development.
- microwavecamera 8y agoAre you talking about desktop applications? Windows 10 like every version of Windows going back to NT is built around a Hardware Abstraction Layer and separates userland from the kernel while providing a platform agnostic API. There isn't anything the Windows kernel can do that the Linux or a BSD kernel can't which is my point. Why spend billions on R&D for something you can get for free? Case in point, MacOS/OSX. Apple figured that out a long time ago and it obviously worked for them.
- dimtion 8y ago> One of the great things about Linux is its stable and backwards compatible system call interface. This will enable us to ship the latest stable branch of the Linux kernel to all versions of WSL2. This is a very interesting phrase. Linus often appeared to be yelling at developers not respecting the rule #1 of the kernel. However the kernel being strictly backward compatible is a boon for Linux users, most of the industry should be inspired by this strict policy. Interestingly, Microsoft (compared to Google, Apple...) is the company providing the best long term support for its products.
- temac 8y agoAlso interestingly, the NT kernel is not backward compatible at syscall level. MS even had to invent quite convoluted stuff to run kind of other versions of Windows (but not really...) in their containers, and part of the tech (picoprocesses) was also recycled for WSL1, if I understand correctly. So I'm really fond of that they wrote: "One of the great things about Linux is its stable and backwards compatible system call interface." I immediately added a big fat: "in contrast with the NT kernel" in my head :D
- cpuguy83 8y agoNeither Darwin or the BSD's (though I'm no BSD expert, I could be mistaken) have a stable system call ABI either. Linux seems to be pretty unique in this regard.
- deleted 8y ago[deleted]
- rbanffy 8y agoThat's not uncommon in Enterprisey OSs. I believe Solaris, AIX and HP/UX are also pathologically backwards compatible. Oh... And zOS/zVM. "Mature" no longer describe those two. "Timeless"/"Ageless"/"Eternal" would probably be better words.
- joveian 8y agoI don't know about the others but NetBSD has had an even stronger focus on compatability, with some people still running an old binary from NetBSD 0.9 (released in 1993). The one major exception was that the first threading implementation was based on scheduler activations and was completely removed. Any system that supports static binaries needs a stable system call interface if it wants binary compatibility. IIUC, Windows never supported static binaries.
- X6S1x6Okd1st 8y ago2019 is the year of desktop linux on windows?
- microwavecamera 8y agoYo dawg we heard you liked desktops so we put a desktop on your desktop.
- the8472 8y agonot yet, we have to wait until microsoft announces wayland support
- tareqak 8y agoSo 2019 is going to be the year if the Linux desktop, and it's going to be brought to the world by Microsoft? Just when I thought this timeline couldn't get any weirder. I personally think that this is a good thing in the short-term for both Linux users and Windows users in that it gives both platforms a sort of kick in the pants each to deal with one platform's deficiency by incorporating the other's strength. I could speculate about where this all could go wrong long-term, but that is basically a future resurgence of embrace-extend-extinguish, which anyone here can look up. What is important now is that people voted with their time, their wallets, and their voices to give Microsoft a strong enough signal to invest their future product development around. These people include Linux users, Linux developers (kernel and userspace), Windows users, and Microsoft itself and all of them deserve some amount of gratitude for getting us here today so thank you. To be completely honest, the only way this news could be any better in my eyes was that if Microsoft also committed to being 100% privacy-focused and removed any and all telemetry from Windows, but I guess the four groups of people I laid out previously did not want that level of privacy just as badly.
- zeusk 8y ago> To be completely honest, the only way this news could be any better in my eyes was that if Microsoft also committed to being 100% privacy-focused and removed any and all telemetry from Windows. As much as I'm also privacy minded, I do support telemetry in software (not the kind that touches my data) but if the developers can get traces of how people actually interact with their product and what happened when their product did crash - it helps a LOT, not only technically but also to shift management's focus onto an issue. What do you have against telemetry in software? (again, not the kind that saps your data for gains).
- childintime 8y agoEver since 2004 Microsoft holds the "Lindows" trademark [1]. Who'd thought then that Microsoft would actually make the product a reality? [1] https://en.wikipedia.org/wiki/Linspire https://en.wikipedia.org/wiki/Linspire
- deleted 8y ago[deleted]
- cogman10 8y agoI wonder how they are handling resource allocation (memory, cpu cores, etc?) One thing that is nice about WSL is that you don't worry about any of that. Am I going to see a 1gb block of memory reserved every time I start up an linux terminal?
- zamadatix 8y agoHyper-V supports dynamic memory allocation. As far as the rest it can all be shared i.e. your VM having 4 cores assigned does not mean those 4 cores are inaccessible to everything else.
- cryptonector 8y agoThe Linux ABI won. Emulating the Linux ABI is difficult (because it's full of crap). At some point you get tired of emulating the garbage -- it's a large, underdocumented, and fairly fast moving target. Next step: reverse this and make Windows run on Linux.
- alexeldeib 8y agoI mean, isn't the "next step" already done? This implementation is via Hyper-V, Linux already has KVM Windows VMs.
- Someone1234 8y agoAlternatively just have Windows and Linux run side by side on a generic hypervisor. Then allow them to each render other virtual machines as an "application." You can already do 90% of this. Only thing missing is allowing virtual machines to call up to the hypervisor to get a hook/render into sister machines.
- the8472 8y agoabout rendering into other machines: https://github.com/gnif/LookingGlass https://github.com/gnif/LookingGlass
- Someone1234 8y agoThat's fantastic thank you.
- zeusk 8y agoNot exactly consumer stuff, but Microsoft has had similar capability to support hot-pluggable GPUs and USB display adapters - Indirect Displays. https://github.com/kfroe/IndirectDisplay https://github.com/kfroe/IndirectDisplay It basically allows you to create a D3D device that delegates it's rendering to another D3D device in the system, and then the output surface can be either dealt with in software (CPU acts as protocol encoder), in hardware (ie. videnc/dec block + PHY hooked over USB/PCIe) or just memory mapped to host OS.
- viraptor 8y agoSo this sound like the CPU usage will be quite a bit higher than with wsl1, since it's actually running a VM. Kind of like Docker on Mac. It's not a huge issue, but it still takes some battery life away.
- cpuguy83 8y agoVM does not mean extra CPU usage. Since there is no emulation involved (assuming VT-x is supported) you should be getting native or mostly native performance.... not to say that WSL2 will be better on CPU usage, however I don't think one should assume that it will be worse. This is opposed to WSL1 which is emulation and has extra layers to go through.
- viraptor 8y agoUnless they completely stripped all background tasks, there's still a few wakeup calls from the VM. I didn't mean the execution overhead from emulation. For example hyperkit.docker not running any container does ~90 wakeups/s on my machine. This comes mainly from just keeping the VM alive. This also prevents deeper sleep for CPUs.
- crispinb 8y agoThe new wsl, along with VS Code's new remote development extension, could make Windows an interesting beast with two identities: a primary host for regular business and consumer software, and a linux client for development. I did use Windows & wsl for development for much of 2018, and (coming from a mac) found it surprisingly usable. The separate filesystem hierarchies was a bit of a pest, and I reverted to Linux for the first time in some years. But that has plenty of its own annoyances, and I'll be interested to check out wsl 2.
- newen 8y agoYep, I had been using WSL for most of my programming last year too, and I found it to be pretty decent. I switched to my dual boot Linux recently because I couldn't use the GPU via WSL. But if this lets me use the GPU, then I won't need to have a separate Linux install anymore, which would be pretty convenient.
- deleted 8y ago[deleted]
- tybit 8y agoLast time I used WSL it wasn’t recommended to work with your local window files and my WSL work was an island from the rest of my machine. I wonder if they will be able to bridge that gap? I think I could be a happy windows user if I never had to touch PowerShell again.
- detaro 8y agoYou weren't (and maybe still are? haven't kept up) supposed to touch files belonging to the Linux from Windows (which afaik live somewhere in the Windows folder), but you can access Windows files through /mnt/<driveletter> just fine.
- majkinetor 8y agoYou don't have to use WSL TBH, there are alternatives with native binaries. Unless you are porting from linux, its way better IMO.
- WorldMaker 8y agoIt was always fine to work with your Windows files via /mnt/$driveletter/… Recent releases of WSL now let you access Linux files that are inside the distro from Windows using a special filesystem driver and magic path (\\wsl$\…)
- Osiris 8y agoDoes this mean that we'll be able to mount EXT4 devices and use storage as block devices? I'd love to be able to use `ddrescue` without having to boot into Linux.
- wtdata 8y agoSo, will it be possible to get GPU access (CUDA) directly from whiting WSL now?
- zeusk 8y agoIf you're running a Quadro, maybe. Otherwise Nvidia is quite strict against running their drivers for GTX/RTX inside any kind of virtual environment.
- tobias3 8y agoSo they painstakingly built a Linux syscall ABI into the Windows NT kernel (including tricky stuff like fork()). Then they just abandon that approach and run the Linux kernel in a VM/or something like user mode Linux/coLinux ( http://www.colinux.org/ http://www.colinux.org/ ). I feel sorry for all the wasted work in WSL1.
- naikrovek 8y agoSame. I hope for their sake that they don't change direction again. Although, technically, wasn't that ABI translation layer a form of virtual machine? I wonder how much of the change to a VM is just nomenclature.
- hpcjoe 8y agoIllumos did something akin to this, though it was more of a syscall translation layer. It was/is quite nice. The problem with this is that you are always chasing down the corner cases.
- gsam 7y agoNo, a lot of cross-platform applications are going to be using this infrastructure IIRC still. In this case, they only need a subset of the Linux APIs and they can optimize it to produce the right translations.
- sys_64738 8y agoIf it's a VM running the kernel then why not simply run Virtual Box or Hyper-V and be done with it?
- robertAngst 8y agoThis removes the need for me to use Ubuntu Desktop or Linux Mint Desktop. I hated dealing with the install, which often didnt work. And getting anything to work perfect was too much work. But I love Ubuntu Server, and the idea of being able to use linux without a separate install changes the potential of my Laptop.
- pooya13 8y agoWill this make it possible to add OpenCL & CUDA GPU support?
- Ericson2314 8y agoHopefully they are hoping for something like user-mode linux (UML) / libos / unikernel Linux (UKL) to save them so there work on wsl1 wasn't for nothing and they can stay off the syscall treadmill.