Home / Linux / Windows Subsystem for Linux 2 (WSL 2) Released to Insiders

Windows Subsystem for Linux 2 (WSL 2) Released to Insiders

WSL2

With the release of the Windows 10 Insider Build 18917, Microsoft has made the Windows Subsystem for Linux version 2 (WSL 2) available for testing. Now insiders can convert their existing WSL 1 distributions to the new version in order to gain access to the increased performance and compatibility.

WSL 2 is Microsoft’s next version of the Windows Subsystem for Linux and includes a genuine open-source Linux kernel based on version 4.19 from Kernel.org. As it uses a real Linux kernel, Linux apps will now have full access to their normal system calls.

This improves compatibility for Linux apps and better file system performance.

As this is the first public release of WSL 2, getting it up and running is a little rough around the edges, which we will explain below.

Setting up WSL 2 in a Windows 10 Insider build

In order to get WSL 2 up and running, you first need to make sure you are running Windows 10 Insider build 18917 or later.

As WSL 2 runs in a virtual machine, you first need to install the “VirtualMachinePlatform” optional feature. You also need to use a dedicated computer for your Windows Insider build, unless you are running it as a HyperV virtual machine.

To install the VirtualMachinePlatform feature, open a PowerShell Administrator prompt and enter the following command:

Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform

Windows 10 will install the feature and then prompt you to reboot as shown below, which you should allow.

Install VirtualMachinePlatform
Install VirtualMachinePlatform

Once Windows 10 restarts, open an elevated command prompt and get a list of WSL distribution names that are installed using the command:

wsl -l
List WSL Distributions
List WSL Distributions

Pick the WSL distribution you wish to convert to WSL 2 and issue the following command:

wsl --set-version [Distro] 2

For example, as I have the Ubuntu Linux distribution installed and I want to convert it to WSL 2, I would enter:

wsl --set-version Ubuntu 2
Converting to WSL 2
Converting to WSL 2

Note, that in some cases you may have to run the conversion twice for it to succeed as shown above.

After converting a distribution to WSL 2, you can list all installed distributions and their WSL version to confirm the conversion worked by entering this command:

wsl --list --verbose
Confirm Conversion
Confirm Conversion

If you have any problems with these steps, you can find more detailed instructions here.

Using WSL 2 Distributions

Once a distribution is converted to WSL 2, you can fire it up as normal and begin using it. With WSL 2, though, you now have a much wider range of applications you can run.

Ubuntu using WSL 2
Ubuntu using WSL 2

If you wish to connect to any network servers running on your WSL 2 Linux distribution, you need to connect to its assigned IP address from the Windows host. To determine the assigned IP address, you can use the ip addr | grep eth0 command.

Microsoft has also stated that in order to take advantage of the increased file system performance, you will need to place your Linux files in your Linux root file system.

Make sure to put the files that you will be accessing frequently with Linux applications inside of your Linux root file system to enjoy the file performance benefits. These files have to be inside of the Linux root file system to have faster file system access. We have also made it possible for Windows apps to access the Linux root file system (like File Explorer! Try running: explorer.exe /in your bash shell and see what happens) which will make this transition significantly easier.

For a full list of changes between WSL 1 and WSL 2, you can read this support article.

Loading...

>> Source Link

Check Also

Linux 5.2 + Mesa 19.2 Performance With Polaris/Vega/Vega20 vs. NVIDIA On Ubuntu 19.04

With last week having delivered fresh benchmarks of the mid-range NVIDIA/AMD graphics cards using the …

%d bloggers like this: