The Linux Subsystem for Windows continues to advance in capability and also in ease of use. Earlier this year, Microsoft promised an update to make it and GNU/Linux distributions easier to install, and has just implemented it in the latest Windows 10 Insider Preview Build 20246.
Four years ago Microsoft announced a bombshell at its BUILD developer conference. A Windows Linux Subsystem (WSL) that would allow Bash (the command interpreter that is installed by default on most GNU/Linux distributions) to be used on Windows 10.
The intention was (and is) that developers needing such tools would not need to leave Windows 10 using specific Linux machines. WSL allowed running Linux binaries on Windows 10 from the command line, Bash scripts, commands like sed, awk, grep and tools like Ruby, Git or Python, directly on Windows. Microsoft has been improving the capability of WSL since its first release. It reached an agreement with Canonical to deliver Ubuntu from the Microsoft Store and then did the same with other distributions such as Fedora and SuSE.
The second version of this tool (WSL 2) improved performance, added a full Linux kernel, as well as other new features such as support for DirectX 12 and graphics applications. Other interesting new features are coming soon, such as the ability to use custom kernels, connect Linux applications from Windows using localhost and not only through remote IP addresses as was previously the case, kernel update from Windows Update and also the ability to run full Linux applications (in graphical mode).
Linux subsystem for Windows (Insiders)
The latest test version of Windows 10 supports a new command that will facilitate the task of installing the tool and GNU/Linux distributions.
The installation will be as simple as running the command “wsl -install”. The command can be launched from three places: the command prompt, the advanced PowerShell console or the Windows Terminal that includes the above. With this command, a user will install all the necessary components and the default distribution which is none other than Ubuntu.
It will be just as easy to install a particular version of Ubuntu or other alternative distributions. By simply adding the name of the supported distribution “wsl -install -d “, currently with the following possibilities:
Ubuntu
Debian
Kali-Linux
openSUSE-42
SLES-12
Ubuntu-16.04
Ubuntu-18.04
Ubuntu-20.04
The new command is available in the latest test version of Windows 10 and we assume it will arrive for all users in the next stable version Windows 10 21H1.
Linux subsystem for Windows (Stable versions)
For current stable versions, since Windows 10 2004, it is somewhat more cumbersome, but the tool (WSL 2) and a distribution such as Ubuntu can be installed as follows:
Access the advanced Powershell console in administrator mode to install the feature by executing the command.
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
- Cuando te lo pida reinicia el equipo.
- Instala una de las distribuciones Linux disponibles en la Microsoft Store (Ubuntu, Suse Linux Enterprise Server 12, Debian, Kali Linux…). Una vez descargada, instálala desde el menú de inicio.
- Abre PowerShell como administrador y activa la plataforma de máquina virtual con el comando
Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform
- Vuelve a reiniciar el equipo.
- El último paso es configurar la distro instalada, Ubuntu para el ejemplo.
- Abre otra vez PowerShell en modo administrador y ejecuta wsl -l -v para listar las mismas.
- Para seleccionarla wsl –set-version Ubuntu 2
- Para dejarla por defecto wsl –set-default-version 2
Windows y Linux cada vez más cerca… Y para el futuro algunos gurús avanzan bombazos como que Windows terminará siendo una capa de emulación en Linux… Windows estaría construido bajo un kernel de Linux manteniendo su interfaz de usuario, herramientas internas y aplicaciones de sistema. Los proveedores de software de terceros dejan de enviar binarios de Windows en favor de binarios ELF con una API de Linux pura. Y Linux ganará la guerra de los escritorios, no al desplazar a Windows, sino por apropiación.
Espero que les sirva de ayuda.