- Windows Server Installation Guide
- Enable the Windows Subsystem for Linux
- Download a Linux distribution
- Extract and install a Linux distribution
- Руководство по установке Windows Server Windows Server Installation Guide
- Включение подсистемы Windows для Linux Enable the Windows Subsystem for Linux
- Скачивание дистрибутива Linux Download a Linux distribution
- Извлечение и установка дистрибутива Linux Extract and install a Linux distribution
- Ubuntu Wiki
- What is WSL?
- What is WSL 1?
- What is WSL 2?
- Enabling WSL in Windows 10
- Using the GUI for enabling Windows features
- Ubuntu on WSL
- Deploying WSL at your company?
- Access the Linux terminal on Windows
- Develop cross-platform
- Manage IT infrastructure
- What you never thought was possible on Windows
- Editors
- Servers
- Development
- Shells
- Containers
- Scripting
- Network hardening
- Kubernetes
- Why WSL
- Easy to Use
- Security
- Enterprise support
- Install Ubuntu on Windows Subsystem for Linux (WSL)
- Enable WSL on Windows 10
- Install Ubuntu
- How to run Ubuntu service on Windows (at startup)?
- 6 Answers 6
Windows Server Installation Guide
The Windows Subsystem for Linux is available for installation on Windows Server 2019 (version 1709) and later. This guide will walk through the steps of enabling WSL on your machine.
Enable the Windows Subsystem for Linux
Before you can run Linux distros on Windows, you must enable the «Windows Subsystem for Linux» optional feature and reboot.
Open PowerShell as Administrator and run:
Download a Linux distribution
Follow these instructions to download your favorite Linux distribution.
Extract and install a Linux distribution
Now that you’ve downloaded a Linux distribution, in order to extract its contents and manually install, follow these steps:
Extract the .appx package’s contents, using PowerShell:
Run the distribution launcher application in the target folder. The launcher is typically named .exe (for example, ubuntu.exe ).
Installation failed with error 0x8007007e: If you receive this error, then your system doesn’t support WSL. Ensure that you’re running Windows build 16215 or later. Check your build. Also check to confirm that WSL is enabled and your computer was restarted after the feature was enabled.
3.Add your distro path to the Windows environment PATH ( C:\Users\Administrator\Ubuntu in this example), using PowerShell:
You can now launch your distribution from any path by typing .exe . For example: ubuntu.exe .
Now that it is installed, you must initialize your new distribution instance before using it.
Руководство по установке Windows Server Windows Server Installation Guide
Подсистема Windows для Linux доступна для установки на Windows Server 2019 (версия 1709) и более поздних версий. The Windows Subsystem for Linux is available for installation on Windows Server 2019 (version 1709) and later. В этом руководстве рассматриваются действия по включению WSL на компьютере. This guide will walk through the steps of enabling WSL on your machine.
Включение подсистемы Windows для Linux Enable the Windows Subsystem for Linux
Перед запуском дистрибутивов Linux в Windows необходимо включить дополнительный компонент «Подсистема Windows для Linux» и перезагрузить компьютер. Before you can run Linux distros on Windows, you must enable the «Windows Subsystem for Linux» optional feature and reboot.
Запустите PowerShell с правами администратора и выполните следующую команду. Open PowerShell as Administrator and run:
Скачивание дистрибутива Linux Download a Linux distribution
Выполните эти инструкции, чтобы скачать избранный дистрибутив Linux. Follow these instructions to download your favorite Linux distribution.
Извлечение и установка дистрибутива Linux Extract and install a Linux distribution
После загрузки дистрибутива Linux для извлечения его содержимого и установки вручную выполните следующие действия. Now that you’ve downloaded a Linux distribution, in order to extract its contents and manually install, follow these steps:
Извлеките содержимое пакета .appx , с помощью PowerShell: Extract the .appx package’s contents, using PowerShell:
Запустите средство запуска приложения дистрибутива в целевой папке. Run the distribution launcher application in the target folder. Средство запуска обычно называется .exe (например, ubuntu.exe ). The launcher is typically named .exe (for example, ubuntu.exe ).
Сбой установки с ошибкой 0x8007007e. При возникновении этой ошибки система не поддерживает WSL. Installation failed with error 0x8007007e: If you receive this error, then your system doesn’t support WSL. Убедитесь, что вы используете сборку Windows 16215 или более позднюю версию. Ensure that you’re running Windows build 16215 or later. Проверьте используемую сборку. Check your build. Также убедитесь, что WSL включен и ваш компьютер перезагружен после включения этой функции. Also check to confirm that WSL is enabled and your computer was restarted after the feature was enabled.
3. Добавьте путь дистрибутива в путь среды Windows (в этом примере: C:\Users\Administrator\Ubuntu ), с помощью PowerShell: 3.Add your distro path to the Windows environment PATH ( C:\Users\Administrator\Ubuntu in this example), using PowerShell:
Теперь вы можете запустить дистрибутив из любого пути, введя .exe . You can now launch your distribution from any path by typing .exe . Например: ubuntu.exe . For example: ubuntu.exe .
После установки необходимо инициализировать новый экземпляр дистрибутива, прежде чем его можно будет использовать. Now that it is installed, you must initialize your new distribution instance before using it.
Ubuntu Wiki
What is WSL?
Windows Subsystem for Linux (WSL) allows users to run a Linux terminal environment, install packages from the Ubuntu archive, and run Linux applications and workflows on Windows 10.
What is WSL 1?
The original WSL is now known as WSL1. WSL1 is a compatibility layer for running Linux binary executables (ELF) natively on Windows 10. No re-compilation or ‘porting’ of applications is required. WSL1 provides a Linux-compatible kernel interface developed by Microsoft that allows a user to choose a Linux distribution to install from the Microsoft Store. WSL1 executes unmodified Linux ELF64 binaries by operating a Linux kernel interface on top of the Windows kernel in Windows 10. The WSL1 interface translates Linux system calls from the binaries into Windows system calls and then executes them at native speed. Linux applications run within the Linux distribution which provides the application’s dependencies and package management in a container-like environment. WSL provides an interface to mount drives within WSL.
What is WSL 2?
WSL2 was announced at Microsoft Build 2019. WSL2 features a Linux kernel running inside Windows 10 and is built on the core technology of Hyper-V to provide better Linux application support and improved file performance. Transitioning to WSL2 is seamless. To update to WSL 2 you need Windows 10 version 1903 or higher, with Build 18362 or higher.
Announcing WSL2 — Microsoft blog announcing WSL2
WSL2-Linux-Kernel — The source for the Linux kernel used in Windows Subsystem for Linux 2.
Enabling WSL in Windows 10
Before you can install Ubuntu on WSL, WSL has to be enabled in one of the following ways:
Using the GUI for enabling Windows features
Open the Start Menu and search Turn Windows features on or off
Select Windows Subsystem for Linux
Click OK
Ubuntu on WSL
Install a complete Ubuntu terminal environment in minutes on Windows 10 with Windows Subsystem for Linux (WSL).
Access the Linux terminal on Windows, develop cross-platform applications, and manage IT infrastructure without leaving Windows.
Deploying WSL at your company?
We help companies achieve a seamless integration with their WSL deployments. Contact us to learn more about how we support enterprises on the Windows Subsystem for Linux.
Access the Linux terminal on Windows
In seconds, be able to access the Linux terminal and run Linux applications and workflows on your Windows machine.
Develop cross-platform
Build and debug Linux applications with Windows tools like Visual Studio Code, Visual Studio, and JetBrains IDEs before deploying to the cloud.
Manage IT infrastructure
From the same workstation, manage mixed Linux and Windows infrastructure both on-prem and across public clouds.
What you never thought was possible on Windows
Editors
Run your choice of Linux text editors, including vim, emacs, and nano
Servers
Spin up Node.js, install your dependencies with npm, and start testing your web app
Development
Install compilers and libraries from the Ubuntu repository, maintained by Canonical
Shells
Use your choice of Linux shells, such as bash, zsh and fish
Containers
Work with LXD and Docker containers on Windows
Scripting
Automate Linux and Windows tasks with advanced bash scripting
Network hardening
Leverage Linux security tools to test and harden your network
Crunch big numbers with tools for R and Python
Kubernetes
Build, test, and deploy Kubernetes clusters on Windows
Why WSL
Easy to Use
Ubuntu is intuitive, user-friendly, and offers the flexibility for customizations when operating within WSL.
Security
Achieve the same first-class, out-of-the-box, compliant security that is synonymous with Ubuntu. With long-term support releases, you’ll have five years of security patches and updates.
Enterprise support
Ubuntu is certified on WSL through close collaboration with Microsoft. Enterprise support is provided for Ubuntu from Azure to Windows workstations creating a seamless operating environment.
Install Ubuntu on Windows Subsystem for Linux (WSL)
Enable WSL on Windows 10
Open PowerShell as Administrator:
Type the following command to enable WSL 1:
Type the following command to enable WSL 2:
Restart your computer.
After restarting, download and install the WSL 2 Linux kernel from Microsoft for your device architecture:
- x86_64 for Intel and AMD devices
- arm64 for Snapdragon and other ARM devices
Finally, it is recommended to set WSL 2 as the default WSL environment.
Open PowerShell as Administrator as above and type the following command:
Install Ubuntu
Download Ubuntu for WSL from the Microsoft Store.
How to run Ubuntu service on Windows (at startup)?
I want to launch an SSH server on Linux subsystem (Bash on Ubuntu on Windows) at windows startup. The problem is that all Linux processes are terminated when Bash window is closed.
Is there a way to make Linux process run permanently in background without bash window?
6 Answers 6
Found a tutorial for that by aseering:
This was originally discussed and sorted out by github users imjakey, fpqc, qris, therealkenc, Manouchehri, and aseering (myself) here:
Note that running sshd has security implications. Until WSL’s security model has had longer to bake, you should assume that anyone who can ssh into your Windows box has permission to perform any command as the Windows user running sshd, regardless of Linux-level permissions. (Permissions are probably more restrictive than that in practice, but WSL’s initial security model is not intended to be very sophisticated.)
Attempting to aggregate the instructions from github:
- Generate SSH host keys by running sudo dpkg-reconfigure openssh-server in a bash shell
- Run sudo nano /etc/ssh/sshd_config ; edit the UsePrivilegeSeparation yes line to read UsePrivilegeSeparation no . (This is necessary because UsePrivilegeSeparation uses the chroot() syscall, which WSL doesn’t currently support.)
- While still editing /etc/ssh/sshd_config , you may choose to change PasswordAuthentication no to PasswordAuthentication yes . Otherwise you will have to set up SSH keys.
- Save /etc/ssh/sshd_config and exit.
Run sudo visudo to edit the sudoers file. Add the line
replacing «$USER» with your Linux username. Save and exit. If visudo complains that your changes are invalid, fix them until it reports that they are valid; otherwise you can break sudo on your system!
Create a text file autostartssh.vbs in Windows containing the following:
- Double-click on the script. It should start sshd; you should be able to ssh into your Windows machine.
- Open Windows’s Task Scheduler. Add a task that runs autostartssh.vbs on system boot. Use wscript.exe as the command to run and the VBS script location as the parameter.
And that’s it — your Windows computer should be running a Linux openssh server!