Windows Subsystem for Linux – Virtual Desktops

This content has been archived. But, the content is true and relevant to the underlying technology products or infrastructure services.

Windows Subsystem for Linux allows you to install Linux distros on the underlying Windows operating system. WSL can be easily installed on the local machines as there are no resource constraints. WSL also consumes much fewer resources that the Windows operating system. Effectively, you could install WSL on any desktop computer with 2 GB RAM (recommended at least 4 GB RAM) and virtualization support. WSL is compatible with ARM64 and x64 systems. If you intend to install WSL on a desktop, please make sure that the architecture is compatible with ARM64 or x64 standards.

Also, WSL2 needs nested virtualization for it to be successfully implemented.

The challenge lies in installing Windows Subsystem for Linux on remote systems or virtual desktops. Quite a few people have tried installing WSL on virtual private servers (VPS) or virtual machines. On such machines, we are looking at achieving nested virtualization. It is not as straightforward as it sounds. And, you will need ample resources to make it workable.

Can I install WSL on Microsoft 365 virtual desktops?

Microsoft 365 virtual desktops are a very cost-effective way to manage desktops in the cloud. These virtual desktops take the pain of managing the desktops off your shoulders. The Microsoft 365 virtual desktops are based on the underlying Azure cloud platform.

Unfortunately, Microsoft 365 virtual desktops and Windows Subsystem for Linux are incompatible. If you try to enable WSL or WSL version 2 on a Microsoft 365 virtual desktop, you will run into errors. WSL or WSL2 cannot be installed on the Microsoft 365 virtual desktops. You may receive an error that states something like:

Error: 0x80370102 The virtual machine could not be started because a required feature is not installed

Can I install WSL2 on Azure Virtual Desktops?

Yes, you can install WSL version 1 or WSL2 on Azure Virtual Desktops. But, there are specific resource requirements for the WSL2 to work seamlessly on an Azure virtual desktop.

We are looking at a system configuration that has minimum resources including the following:

  • 2 CPUs
  • 8 GB RAM

Unless we can allocate the processor and 8 GB RAM on the Azure platform, the virtual desktop will not support WSL2 or the Windows Subsystem for Linux. You need to provide higher resources because the Windows Subsystem for Linux will need to sit on top of the Hyper V virtualization layer. The Hyper Virtualization layer requires systemic resources. Running nested virtualization and WSL2 on 2 vCPUs will lead to slower performance for workloads. You will, therefore, need to provision computer and other resources with Hyper-threaded architecture and capable of running nested virtualization.

You can read on the Microsoft Azure blog that nested virtualization is supported on Azure virtual machines that use at least the Dv3 and Ev3 VM sizes. You will also need to provision an Azure virtual machine that can run Windows Server 2016 or Windows Server 2019. We suggest using Windows Server 2019 as a bare minimum.

Can I install WSL or WSL2 on Windows Virtual Private Server?

Yes, you can install WSL2 on Windows virtual private servers. You will need to enable nested virtualization on the virtual server. There are specific requirements for this arrangement to be successful:

  • WSL2 can be installed on Windows Server 2019 version 1709 or higher. So, you will need to ensure that you are taking a Windows Server 2019 build number Windows build 16215 or later.
  • You will need to provision for resources that can allow WSL2 installation. As a bare minimum, Microsoft states 2 GB RAM allocation for the WSL2 installation process. In practical scenarios, it is advised to go slightly higher and provision at least 4 GB RAM and 4 CPUs. Understandably, you will need to pay 4 times the license costs on account of using 4 CPUs. However, accessing and maintaining a remote Windows Server 2019 installation does consume resources. Windows VPS RAM and processor requirements are slightly lower than Azure Virtual Desktops and Azure Virtual Machines. The difference lies in the underlying cloud system that supports the Azure based virtual machines.

Can WSL2 be installed on Windows Server 2016?

No, WSL2 cannot be installed on Windows Server 2016. Windows Server 2019 version 1709 and later versions support WSL2 implementation. The restrictions are on account of Hyper-V virtualization. Hyper-V virtualization is needed for nested virtualization. And, nested virtualization is required for the WSL2 or Windows Subsystem for Linux to be successfully installed on servers.

You could choose to upgrade your Windows Server 2016 to Windows Server 2019. This should allow you to install WSL2 on Windows Server 2019. While doing an in-place upgrade from Windows Server 2016 to Windows Server 2019, you will still need to get the Windows Server 2019 licenses and account for the device CALs or the client access licenses.

Summary

  • WSL2 needs nested virtualization.
  • Microsoft 365 is not compatible with WSL2.
  • Azure virtual desktops on Dv3 or Ev3 and higher instances can work with WSL2.
  • You can install WSL2 on Windows Server 2019 version 1709 or build number 16125 and later versions.
  • You can also install WSL2 on Windows virtual private servers as long as the resource constraints are adhered to.

You may like to read more about content related to Windows Server updates:

How useful was this post?

Click on a star to rate it!

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

Rajesh Dhawan

Rajesh Dhawan is a technology professional who loves to blog about smart wearables, Cloud computing and Microsoft technologies. He loves to break complex problems into manageable chunks of meaningful information.