Microsoft introduces Windows Subsystem for Linux 2 in latest Windows 10 20H1 build
Microsoft plans to integrate the Windows Subsystem for Linux 2 in the first major Windows 10 feature update after Windows 10 1903, the Windows 10 20H1 update.
The company released a new build to the Fast Ring Windows Insider channel that includes the new version of the Windows Subsystem for Linux. With the change come important improvements and changes that users and administrators need to be aware of.
First, the basics: The Windows Subsystem for Linux 2 is included in the Windows 10 Insider Preview Build 18917 released on June 12, 2019. It will also be included in future Insider Builds provided that Microsoft does not find critical bugs that need addressing.
WSL 2 needs to be installed before it becomes available:
- Make sure the Windows 10 build is at least 18917 (use winver to find out about that by launching it from Start).
- Open an administrative PowerShell prompt, e.g. by using the Windows-X menu.
- Run Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform
- A restart is required.
- Open a PowerShell prompt again.
- Run wsl -l to display the available distros.
- To verify the versions of each distro, run wsl --list --verbose or wsl -l -v
- Run the command wsl --set-version <Distro> 2 to set a distro. Replace <Distro> with the name of the distro revealed by the command under 6).
- To make WSL 2 the default architecture, run wsl --set-default-version 2.
The new subsystem provides the same user experience as the current version in release versions of Windows 10.
Microsoft notes that the Windows Subsystem for Linux 2 comes with a "real Linux kernel" and that it changes how Linux binaries "interact with Windows" and the computer hardware.
One of the core difference between version 1 and 2 of the Windows Subsystem for Linux is that users are now encouraged to place files inside the Linux root file system. Doing so improves performance significantly according to Microsoft as they benefit from faster file system access of WSL 2.
Windows Apps may also access the Linux root file system with the release of this version. While WSL 1 still requires that users place files on the c: drive of the Windows installation, WSL 2 does away with that limitation.
WSL 2 runs in a virtual machine and that requires that the virtual machine's IP address is required for certain tasks. To access Windows network applications from Linux, one would need to know the Windows host IP and vice versa.
Other user experience changes between WSL 1 and 2 are listed on Microsoft's Docs website.
Windows Subsystem for Linux 2 comes with a range of new commands such as switching between version 1 and 2 of the subssystem or shutting down all running distributions at once. You find a list of commands on the Microsoft Dev Blog.
Now You: Do you use the Windows Subsystem for Linux?
I do use it quite a bit. I have some Linux tools like scripting YouTube-dl and server maintenance tasks that I just prefer using from the bash shell.
Why settle for margarine when you can enjoy real cream & butter…
Runs in a VM and unlike ms versions, runs flawlessly inside Windows 7, XP, Servers 2003, 2008, and 2008 R2. Use Vbox which is an excellent, free hypervisor. Vbox runs VMs of linux, mac, win 7, win XP, unix, bsd, and if you want to get your privacy violated, you can run a win 10 VM too.
For server/dev boxes, PuTTY controls nix from windows.
Be sure to lock ssh down using strong keys, only allow access to certain ip addys using ufw.
A few years ago when I also ran Windows at home, I did this the other way around — I ran Windows in a VM on a Linux machine. That worked exceptionally well for me.
The article may be a bit esoteric for some since the beauty of WSL 1 and WSL 2 isn’t readily apparent. In other words, why use a separate VM when the whole idea with WSL is to let Windows take care of things.
“Instead of using a VM or container, WSL 1 virtualizes a Linux kernel interface on top of the Windows kernel. This means that running WSL only requires a minimal amount of RAM. And when not in use, the WSL driver isnâ€™t loaded into memory, making it more efficient than a solution based on a VM or container. Users can then load a Linux distribution from the Microsoft Store and use it like an application on their PC. Windows 10 supports installing multiple Linux distributions side-by-side.”
It sounds a lot like the way WUBI works.
A more practical guide can be found on Petri and elsewhere on the Internet:
@VioletMoon: “The article may be a bit esoteric for some since the beauty of WSL 1 and WSL 2 isnâ€™t readily apparent. In other words, why use a separate VM when the whole idea with WSL is to let Windows take care of things.”
There’s something about WSL that I don’t understand at all — perhaps you (or someone else) can explain it to me. I understand what you’re saying in your comment about the difference between running Linux in a VM and using WSL, but I don’t understand what the utility of WSL actually is.
In other words, what benefit does using WSL actually provide? What’s the use case for it?
Steve#99 – Thanks for the info, but these are kinda comparing different things. Instead of the hassle of an isolated Linux virtual machine, the WSL natively runs Linux commands in Windows. Love Linux, but would be nice to harness some of its goodness from within Windows itself when it works better. If anything, this might just introduce more people to Linux and its commands.
“Drops” gave me the wrong impression. As if it was removed.
“Do you use the Windows Subsystem for Linux?”
No, I have no use for it. At my workplace, we do our Linux programming on Linux machines and Windows programming on Windows machines. WSL doesn’t offer anything that helps us out there. At home, I use Linux exclusively.
So what if i have wsl 1 installed, does it upgrade it, do i need remove that before use wsl2?
“first major Windows 10 feature update after Windows 10 1903, the Windows 10 20H1 update.”
Shouldn’t the first major update after 1903 be 1909 ? and where is it ?
General consensus is that 1909 will be a smaller bug fix update and that 20H1 will be the nxt major feature update.
Git for Windows works just fine to run bash. WSL is just overkill and sucks big time.
But WSL isn’t just for Git. I want/need it for Docker and to run Ansible scripts.
I like Windows, I don’t want to use a Linux desktop, but having those features would be good.
Installed the preview build especially for this.
I just got an application running with a prisma backend (postgres database), that runs via docker.
That’s docker on linux … but on Windows.
Things like a git clone or an npm/yarn install are so much faster than they were natively on Windows.
I look forward to not having problems that other devs brush off as “windows specific” and never get fixed.
Since this uses the Virtual Machine Platform, this sounds like another new feature, i.e., like Sandbox, that is incompatible with a non-Microsoft virtual system such as VMware (which I use extensively).
Microsoft Windows is the biggest company in the world. We all use windows on a daily basis and Microsoft keeps updating itself, it launches new versions of windows time to time with great feature,
The window is simply easy to use and cost effective. their support services are also very good they have highly experienced and professional experts who are always ready to resolve your query. To reach our Windows support number dial: 1-888-410-9071
Why would i call Microsoft when i use Linux? ;)
If Microsoft would learn from it’s mistakes:
Remove forced telemetry.
Focus on the core operating system.
Remove back doors.
End partnerships with government spy programs: I.E: PRISM, MUSCULAR.
Stop leaking data to the NSA: Special Source Operations (SSO) division
Updates that function 100% and cause no new problems.
Drop the SJW/P.C. mentality.
People would consider windows a viable operating system in future releases.
Sadly, it seems they will stick to their current Orwellian downward spiral.
Linux developers rejoice, for the giant has hamstrung himself.
I wonder if it is possible to install KDE Plasma desktop environment on Windows 10 via WSL 2 so we can replace the entire crappy user interface of Windows 10 with KDE Plasma. Now that WSL 2 comes with real Linux kernel.
Can you make tutorial if it is possible?
was my comment censored? looks like i’ll never visit ghacks again.
No it was not “censored”.
Thanks for posting my comment, sorry for not giving enough time to get past moderation.
i use WSL 1 extensively (bash/ssh/cat/python) with XMING if needed GUI as I develop on both windows and linux in the same time while administering other linux machines. Just installed WSL 2 yesterday but the idea of using VM instead of direct access seems redundant especially if you still can’t access the GPU/USB from Linux kernel which makes it worse than a virtual box machine with ubuntu installed and all features available except GPU access with even more control on the networking part which I am struggling with at the moment to be able to access internet from WSL 2 bash. It looks to be a bit of setback in this direction.
Hey, you have a small typo that cost me some time figuring out why I couldn’t get my hand on the correct version yet. The reason is that it does not yet exists :)
Windows 10 Insider Preview Build 18971
should be 18917