Visual Studio will natively support WSL2

Recently, Microsoft officially announced that its integrated development environment, Visual Studio, will natively support WSL2, which means that Visual Studio users can seamlessly build and debug on WSL2 without adding SSH connections to improve operating efficiency.

It is reported that Microsoft natively supported WSL1 in Visual Studio in 2019, that is, all commands are executed locally through wsl.exe, and WSL will access data from the Windows disk under the /mnt folder. However, because Visual Studio does not natively support WSL2 at present, the execution efficiency of these commands in WSL2 is slow. Therefore, Microsoft officially recommends that Visual Studio users use WSL only when WSL2 can provide better performance and 100% compatible system calls.

At this stage, WSL-based Visual Studio has two situations that will cause WSL1 to be better than WSL2. The first is that when data must be stored in the Windows file system, WSL1 can process data in Windows faster and communicate with Linux. The second case is when you need to use different tools for Windows and Linux systems to cross-compile the same file, the cross-system access efficiency of WSL1 is also faster than WSL2

Therefore, users of WSL2 usually need to install and execute SSH locally and create a new SSH connection in Visual Studio to improve the cross-system transmission efficiency of WSL2. Therefore, Microsoft decided to provide WSL2 native support for Visual Studio, so that developers do not need to add SSH connections, thereby improving the efficiency of Visual Studio on WSL 2.