Windows Subsystem for Linux with new features for Windows 11 and Windows 10
Microsoft previously shipped Windows Subsystem for Linux (WSL) with Windows 10, but with Windows 11 it is also available as a preview via the Store. This version is now officially available, also for Windows 10. WSL offers new interesting features such as the integrated support for graphical desktop apps or the Init-system – systemd.
WSL can be installed from the store, the Cumulative Update November 2022 must be installed in Windows 10 from 21H1, and in Windows 11 KB5020030 or KB5019157 and in Windows Server 2022 KB5020030. WSL from the Store is also available for Windows Server 2022, although the Store app isn’t available here.
The latest WSL release can be downloaded from GitHub.
C:> wsl.exe --install --web-download
Confirm the Windows Account Control with Yes, now WSL is installed from the store. The prompt to create a Linux user appears. This user can be arbitrary and does not have to match the Windows logon.
After rebooting, the installation continues. The installation ends with information about the version and link notes for documentation and support.
WSL can also be obtained from the store.
According to Microsoft, the store version will become the standard in the future. This is also reflected in the fact that only this version gets new features, which is also revealed by the fact that the update option is only available here.
C:\> wsl.exe --update
The recently released WSL 1.0 integrates support for WSLg, for graphical desktop applications under Linux into Windows, so that a separate installation of the MSI packages for WSL is no longer necessary, and it is no longer limited to Windows 11, but also available for Windows 10. In addition, there is the possibility to activate systemd.
The installed WSL version with the different WSL components shows the following command.
C:\> wsl --version wsl --version WSL-Version: 184.108.40.206 Kernelversion: 220.127.116.11 WSLg-Version: 1.0.47 MSRDC-Version: 1.2.3575 Direct3D-Version: 1.606.4 DXCore-Version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Windows Version: 10.0.22621.819
Now you can install a Linux distribution, the much used Ubuntu can also be obtained from the store.
Alternatively, WSL can be installed completely along with Ubuntu, from a command prompt with Administrator privilege.
C:\> wsl --install -d Ubuntu
After rebooting, the installation continues. You will be asked to enter a username and password to log in Linux. This user can be arbitrary and does not have to match the Windows logon.
To upgrade an existing WSL installation without WSLg to the latest version of WSL that includes WSLg, run the
wsl --update command from an elevated command prompt.
Note that WSLg is only compatible with WSL 2 and does not work for the WSL distribution configured for WSL in mode 1. Make sure the Linux distribution is configured to run in WSL 2 mode, if not, switch to WSL 2.
Windows Subsystem for Linux GUI Apps
WSLg is the abbreviation for Windows Subsystem for Linux GUI. The purpose of the project is to enable support for running Linux GUI applications (X11 and Wayland) on Windows in a fully integrated desktop experience.
WSLg allows Linux GUI applications to fit natively and naturally on Windows. From integration into the Start menu to display in the taskbar, with Alt-Tab functionality, to applying copy and paste in Windows and Linux applications, WSLg enables seamless desktop integration with cross-workflow using Windows and Linux applications.
WSLg requires WSL in version 2 mode, which is what this tutorial does. The currently installed distribution and the configured WSL version can be listed with the following command, in an elevated command prompt.
C:\> wsl --list -v NAME STATE VERSION * Ubuntu Running 2 kali-linux Stopped 2
If you are running version 1 mode, switch to version 2 as follows, which may take a while.
C:\> wsl --set-version ubuntu 2
After that, the computer must be restarted.
Now you only need some GUI apps, via the start menu you will find the Ubuntu icon, or you open the Windows Terminal (wt.exe) in which you will also find the entry Ubuntu in the menu. Desired GUI apps can now be obtained from the Linux terminal.
$ sudo apt update $ sudo apt install nautilus -y $ sudo apt install gedit -y $ sudo apt install x11-apps -y $ sudo apt install vlc -y $ sudo apt install nemo -y $ sudo apt install mc -y $ sudo apt install geary -y
If the browser is selected on Google Chrome, it can be installed with the following lines.
cd /tmp sudo wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb sudo dpkg -i google-chrome-stable_current_amd64.deb sudo apt install --fix-broken -y sudo dpkg -i google-chrome-stable_current_amd64.deb
Once these applications are installed, you can find the apps in the Start menu under All apps with the name of the distribution.
The GUI apps can also be launched using the commands in the terminal window.
Sources Link: github.com/microsoft/wslg