Build 2018: How Microsoft is embracing cross-platform development


Build 2018: Microsoft now lets you run Linux on Windows

Source:  Microsoft

The Windows Subsystem for Linux (WSL) is a remarkable piece of engineering that enables Linux binary code (native ELF64) to execute on Windows 10.

Linux system calls are translated into Windows API calls. This enables Linux distributions, now including Ubuntu, openSUSE, SUSE Linux Enterprise, Debian and Kali, to be installed from the Windows Store. This feature is not aimed at general users, but rather at developers, who now have access to a Linux toolchain in Windows, as well as use of countless command-line utilities (there is no officially supported Linux GUI, though it can be hacked).

Using WSL rather than a VM running Linux means deep integration, including access to the same file system, and the ability to launch Linux executables from Windows, and Windows executables from WSL.

The reason for WSL is to remove friction for developers targeting Unix-like platforms. You can configure Windows 10 to run code editors on the Windows side (including Microsoft’s open source offering, Visual Studio code), while compiling and running in WSL.

Microsoft has gradually improved WSL and the latest version (in the April 2018 update to Windows 10, build 1803) has new features. These include per-directory case-sensitive file names supported on the Windows side as well as from Linux; Unix Sockets, background tasks, and a utility to convert path names between Windows and WSL.

If you are using Visual Studio code and developing with Node.js, you can target WSL simply by setting the attribute "useWSL": true in the launch configuration file. Historically, developing Node.js applications on Windows has had some problems thanks to the use of deep paths which exceed the Windows MAX_PATH length limit (256 characters). In WSL the limit is 32,768.

View All Photo Stories
Data Center
Data Management