Menu
On Windows 10, the Windows Subsystem for Linux (WSL) is a feature that creates a lightweight environment that allows you to install and run supported versions of Linux (such as Ubuntu, OpenSuse, Debian, etc.) without the complexity of setting up a virtual machine or different computer.
- Install Macos On Windows Subsystem For Linux Windows 7
- Enable Windows Subsystem For Linux
- Install Macos On Windows Subsystem For Linux Windows 7
- Download Windows Subsystem For Linux
- Install Macos On Windows Subsystem For Linux Has No Installed Distributions
- Install Macos On Windows Subsystem For Linux Download
Solution 1: Installing Distributions Manually. Press the “ Windows ” + “ R ” buttons simultaneously to open the Run prompt. Type in “ cmd ” and press “ Shift ” + “ Ctrl ” + “ Enter ” to grant the administrative privileges. Typing cmd in the Run Prompt. Type in the following command and press. Step 1: Enable Windows Subsystem for Linux (WSL) feature on Windows. Before you can install any Linux distribution for WSL, you must ensure that the “Windows Subsystem for Linux” feature is enabled: Open PowerShell as Administrator and run the following command to enable Windows Subsystem for Linux (WSL) feature on Windows. Apr 11, 2019 Once Windows 10 is compatible, it’s time to follow our guide to installing the Windows Subsystem for Linux. With that set up, it’s time to add a desktop. Install a Linux Desktop in Windows. If you have set up the Windows Subsystem for Linux already, click Start and enter bash. Click the first option (the bash run command) to start using Linux. @d2s tested older versions of these install instructions with: Debian 10; Ubuntu on WSL (Windows Subsystem for Linux) Ubuntu 18.04 LTS; Ubuntu 17.04; Ubuntu 16.04 LTS; Ubuntu 14.04.3 LTS; macOS 10.14.6 (Mojave) macOS 10.13.6 (High Sierra) macOS 10.12.6 (Sierra) OS X 10.11.6 (El Capitan) Contributions. Install Node.js with nvm. List installed Node.js versions with: nvm ls; Install latest LTS Version of Node.js (for production quality applications) nvm install v12.18.0; Install latest Node.js Current release (for testing new feature improvements) nvm install v14.4.0; Install previous LTS release of Node.js LTS release (if you need to run older.
Although you won't get a graphical interface, this approach enables developers and network administrators to use a long list of command tools and services (such as vim, tmux, andemacs, sshd, Apache, and MySQL), and run Bash shell scripts written in Python, Ruby, C#, F#, and many others using a command console.
In this Windows 10 guide, we'll walk you through the steps to install the Windows Subsystem for Linux using the Settings app as well as PowerShell. Also, we'll show you the instructions to download and install Linux distros, and the steps to properly remove all the components when you no longer need the open-source environment.
How to install Windows Subsystem for Linux using Settings
If you want to run distros of Linux on Windows 10, you must first enable the Windows Subsystem for Linux feature before you can download and install the flavor of Linux that you want to use.
Enabling Windows Subsystem for Linux using Settings
To install WSL using Setting on Windows 10, use these steps:
- Open Settings.
- Click on Apps.
- Under the 'Related settings' section, click the Programs and Features option.Source: Windows Central
- Click the Turn Windows features on or off option from the left pane.Source: Windows Central
- Check the Windows Subsystem for Linux option.Source: Windows Central
- Click the OK button.
- Click the Restart now button.
Once you complete the steps, the environment will be configured to download and run the distros of Linux on Windows 10.
Installing Linux distros using Microsoft Store
To install a distribution of Linux on Windows 10, use these steps:
- Open Microsoft Store.
- Search for the Linux distribution that you want to install.Some of the distros available include:
- Ubuntu.
- OpenSuse Leap 15.
- Kali Linux.
- Debian.
- Alpine WSL.
- Suse Linux Enterprise 12.
- Select the distro of Linux to install on your device.Source: Windows Central
- Click the Get (or Install) button.Source: Windows Central
- Click the Launch button.
- Create a username for the Linux distro and press Enter.
- Specify a password for the distro and press Enter.Source: Windows Central
- Repeat the password and press Enter to confirm.
After you complete the steps, you can start using the distro as any other flavor of Linux (without the graphical user interface, of course).
Uninstalling Linux distros using Settings
If you no longer need to run Linux on your device, it's recommended to remove the distros, and then disable WSL.
To uninstall a Linux distribution, use these steps:
- Open Settings.
- Click on Apps.
- Click on Apps & features.
- Under the 'Apps & features' section, select the distribution — for example, Ubuntu.
- Click the Uninstall button.Source: Windows Central
- Click the Uninstall button again to confirm.
Once you complete the steps, the installation of Linux will be removed, and you can proceed with the steps to disable WSL.
Disabling Windows Subsystem for Linux using Settings
To disable the WSL on Windows 10, use these steps:
- Open Settings.
- Click on Apps.
- Under the 'Related settings' section, click the Programs and Features option.Source: Windows Central
- Click the Turn Windows features on or off option from the left pane.Source: Windows Central
- Clear the Windows Subsystem for Linux option.Source: Windows Central
- Click the OK button.
- Click the Restart now button.
After you complete the steps, the Windows Subsystem for Linux will be removed from your device.
How to install Windows Subsystem for Linux using PowerShell
Alternatively, if you don't have access to the Windows graphical interface, or you're comfortable using command lines, you can also use PowerShell to enable the Windows Subsystem for Linux, download and install distros of Linux, and revert all the changes.
Enabling Windows Subsystem for Linux using PowerShell
To install the Windows Subsystem for Linux using PowerShell, use these steps:
- Open Start.
- Search for PowerShell, right-click the top result, and select the Run as administrator option.
- Type the following command to enable the Linux subsystem and press Enter:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
Source: Windows Central - Type Y and press Enter to confirm and restart your computer.
Once you complete the steps, you can proceed with the instructions to download and install any compatible distribution of Linux available through the Microsoft Store.
Installing Linux distros using PowerShell
To download and install a distro of Linux (such as Ubuntu) with PowerShell, use these steps:
- Open Start.
- Search for PowerShell, right-click the top result, and select the Run as administrator option.
- Type the following command to select the download folder and press Enter:
cd c:PATHTODESTINATION-FOLDER
This example navigates to the data folder in the root of the main drive:cd c:data
- Type the following command to download Ubuntu and press Enter:
Invoke-WebRequest -Uri https://wsldownload.azureedge.net/Ubuntu_1604.2019.523.0_x64.appx -OutFile Ubuntu.appx -UseBasicParsing
Source: Windows CentralThe above command downloads the Ubuntu version 16.04, but you may need to update the command with name and version of the distro that you're trying to download.Quick note: Although the link in this step and the one in the screenshot look different, they are actually the same. The one in the screenshot is just the short version. - Type the following command to view the actual name of the installer and press Enter:
dir
- Type the following command to install Ubuntu version 16.04 and press Enter:
Add-AppxPackage .APP-NAME.appx
This example installs the Ubuntu distro on Windows 10:Add-AppxPackage .Ubuntu.appx
Source: Windows Central - Open Start.
- Search for the recently distribution Linux distribution (for example, Ubuntu), click the top result to launch the experience.
- Create a username for the Linux distro and press Enter.
- Specify a password for the distro and press Enter.Source: Windows Central
- Repeat the password and press Enter to confirm.
After you complete the steps, you can start using Ubuntu or any other distro as you would on a full installation of Linux without a graphical interface.
Uninstalling Linux distro using PowerShell
If you want to revert the changes, you first want to remove any distros of Linux before disabling WSl.
- Open Start.
- Search for PowerShell, right-click the top result, and select the Run as administrator option.
- Type the following command to find out the distro name and press Enter:
Get-AppxPackage *PARTIAL-DISTRO-NAME*
This example search for the app package that includes 'ubuntu' in the name:Get-AppxPackage *ubuntu*
Source: Windows CentralIn the command, make sure to change 'ubuntu' for the name of the distro you're trying to find. - Type the following command to uninstall the version of Linux installed on your computer and press Enter:
Get-AppxPackag FULL-DISTRO-NAME | Remove-AppxPackage
This example removes the Ubuntu package from Windows 10:Get-AppxPackage CanonicalGroupLimited.Ubuntu16.04onWindows | Remove-AppxPackage
Source: Windows CentralIn the command, make sure to change 'CanonicalGroupLimited.Ubuntu16.04onWindows' for the name of the distro you're trying to remove.
Once you complete the steps, you can proceed to disable the Windows Subsystem for Linux feature on your computer.
Disabling Windows Subsystem for Linux using PowerShell
To disable WSL using PowerShell, use these steps:
- Open Start.
- Search for PowerShell, right-click the top result, and select the Run as administrator option.
- Type the following command to enable the Linux subsystem and press Enter:
Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
Source: Windows Central - Type Y and press Enter to confirm and restart your computer.
After you complete the steps, the Linux environment will be disabled from your computer.
More Windows 10 resources
For more helpful articles, coverage, and answers to common questions about Windows 10, visit the following resources:
We may earn a commission for purchases using our links. Learn more.
Android on DuoHands-on with Surface Duo's OS gestures, spanning, app groups, and more
Microsoft's Surface Duo is coming soon, and the company has been working hard on finalizing the version of Android that will be shipping on Surface Duo later this year. Microsoft has released several emulator builds over the last few months, with each one progressing with new changes, bug fixes, and overall polish. Let's go hands-on with the latest build!
This tutorial walks you through enabling Windows Subsystem for Linux (WSL) and running Visual Studio Code in WSL using the Remote - WSL extension.
Prerequisites
Install Macos On Windows Subsystem For Linux Windows 7
You need Visual Studio Code installed.
Install the extension
The Remote - WSL extension enables you to run Visual Studio Code within the Windows Subsystem for Linux (WSL).
Prerequisite check
With the Remote - WSL extension installed, you will see a new Status bar item at the far left.
The Remote Status bar item can quickly show you in which context VS Code is running (local or remote) and clicking on the item will bring up the Remote - WSL commands.
Enable WSL
Windows Subsystem for Linux (WSL) is an optional feature on Windows 10. You can enable it through the Windows Features dialog or PowerShell.
Windows Features dialog
In the Windows search bar, type 'features' to bring up the Turn Windows Features on and off dialog. Scroll down and check Windows Subsystem for Linux.
Select OK and you will be prompted to restart Windows.
PowerShell
If you prefer, you can open PowerShell as an Administrator and type:
After the command runs, you will be prompted to restart Windows.
Check WSL
After restarting Windows, you can check that you have WSL enabled by opening a Command Prompt and typing 'wsl'.
WSL is enabled, but you haven't installed a Linux distribution yet.
Install a Linux distro
You install Linux distributions for WSL from the Microsoft Store. You can use the store app, or search for a Linux distro in the Windows search bar. Choose the Linux distribution you want to install (for example Ubuntu) and follow the prompts.
Select Install.
And when done, select Launch to get started. This will open a Linux terminal and complete the installation. You'll need to create a user ID and password since you are setting up a full Linux instance. You are now running Linux on Windows.
Python development
If you don't have Python already installed, run the following commands to install Python3 and pip, the package manager for Python, into your Linux installation.
And to verify, run:
Start with the canonical 'Hello World' app. Create a new folder called 'helloWorld' and then add a Python file that will print a message when run:
In a remote Linux environment (this WSL distro is technically another machine without UI, that just happens to be running locally on your computer), your development tools and experiences are pretty limited. You can run Vim in the terminal to edit your file, or you can edit the sources on the Windows side through the
wsl$
mount:The problem with this model is that the Python runtime, pip, or any conda packages for that matter, are not installed on Windows.
Remember, Python is installed in the Linux distro, which means if you're editing Python files on the Windows side, you can't run or debug them unless you install the same Python development stack on Windows. And that defeats the purpose of having an isolated Linux instance set up with all your Python tools and runtimes!
Run in WSL
In the WSL terminal, make sure you are in the helloWorld folder, and type in
'code .'
to launch Visual Studio Code. The '.'
argument tells VS Code to open the current folder.Note: If this command does not work, you may need to restart your terminal, or you may not have added VS Code to your path when it was installed.
The first thing you'll see is a message about 'Installing VS Code Server' (the c7d83e57… number is the version of the VS Code Server that matches the client-side tools you just installed). VS Code is installing a small server on the Linux side that the desktop VS Code will then talk to. That server will then install and host extensions in WSL, so that they run in the context of the tools and frameworks installed in WSL. In other words, your language extensions will run against the tools and frameworks installed in WSL, not against what is installed on the Windows side, as it should for the proper development experience.
Enable Windows Subsystem For Linux
The next thing that happens is VS Code will start and open the
helloWorld
folder. You may see a quick notification telling you that VS Code is connecting to WSL, and you may be prompted to allow access to the Node.js-based server.Now, when you hover over
hello.py
, you get the proper Linux path.Integrated Terminal
Run Terminal > New Terminal (⌃` (Windows, Linux Ctrl+`)) to open a new terminal instance.
You'll start a new instance of the bash shell in WSL, again from VS Code running on Windows.
Tip: In the lower left corner of the Status Bar, you can see that you're connected to your WSL: Ubuntu instance.
Edit and debug
Installing the Python extension (and additional tools)
Install Macos On Windows Subsystem For Linux Windows 7
Click on
hello.py
to open it for editing. You will be prompted with an extension recommendation, in this case to install the Microsoft Python extension, which will give you rich editing and debugging experiences. Go ahead and select Install and reload if prompted.To prove that the extension is installed in WSL, open the Extensions view again (⇧⌘X (Windows, Linux Ctrl+Shift+X)). You will see a section titled WSL – Installed, and you can see any extensions that are installed on the WSL side.
Upon reload, you'll also get prompted telling you that the pylint linter is not installed. Linters are used to show errors and warnings in source code. Go ahead and select Install.
Now, when you edit your code, you get rich colorization and completions.
And when you save your file (⌘S (Windows, Linux Ctrl+S)), you'll get linting errors and warnings on the file.
Debugging
With your tools set up, let's take this one step further. Set a breakpoint on line 1 of hello.py by clicking in the gutter to the left of the line number or by putting the cursor on the line and pressing F9.
Download Windows Subsystem For Linux
Now, press F5 to run your application. You will be asked how to run the application, and since this is a simple file, just choose Python File.
The app will start, and you'll hit the breakpoint. You can inspect variables, create watches, and navigate the call stack.
Press F10 to step and you'll see the output of the print statement in the debug console.
You get the full development experience of Visual Studio Code, using the Linux instance installed in WSL.
If you want to open another folder in WSL, open the File menu and choose Open Folder. You'll get a minimal file and folder navigator for the Linux file system, not the Windows file system.
If you want to switch back to the Windows, select the Show Local option and you'll get the standard Windows File Open dialog.
Install Macos On Windows Subsystem For Linux Has No Installed Distributions
Ending your WSL connection
You can end your session in WSL and go back to running VS Code locally with File > Close Remote Connection.
Congratulations!
Congratulations, you've successfully completed this tutorial!
Next, check out the other Remote Development extensions.
Install Macos On Windows Subsystem For Linux Download
Or get them all by installing the Remote Development Extension Pack.