Home  >  Article  >  System Tutorial  >  How to turn on the Linux subsystem on Windows 10

How to turn on the Linux subsystem on Windows 10

王林
王林Original
2024-07-17 04:07:27898browse

WSL allows you to access the Linux Bash shell on Windows. In the previous article, we discussed the target users of Windows Subsystem for Linux (WSL). In this article, we will use it on Windows 10 devices. Start your WSL journey.

Preparing for WSL

You must be using the latest version of Windows 10 Fall Creator Update. After that, check the version of Windows 10 by searching for “About” in the Start menu bar. In order to use WSL, your version should be 1709 or latest.

Here is a screenshot of my operating system.

如何在 Windows 10 上开启 Linux子系统

If you have a previous version installed, you need to download and install the Windows 10 Fall Creator Update (FCU) here. Once installed, install available updates (search for "updates" in the Start menu's search box).

Go to “Turn Windows features on or off”, then scroll to the bottom, as shown in the screenshot, check “Windows Subsystem for Linux” and click OK. It will download the required packages for installation.

如何在 Windows 10 上开启 Linux子系统

After the installation is completed, the system will ask whether to restart. Yes, restart your device. WSL will not start until the system reboots, as shown below:

如何在 Windows 10 上开启 Linux子系统

Once your system has rebooted, return to the “Turn Windows features on or off” page and confirm that “Windows Subsystem for Linux” is checked.

Install Linux in Windows

There are many ways to install Linux in Windows, here we choose the simplest way. Open the Microsoft Store and search for Linux. You will see the following options:
如何在 Windows 10 上开启 Linux子系统

Click "Get" and then the Windows Store will provide three options: Ubuntu, openSUSE Leap 42 and SUSE Linux Enterprise Server. You can install the above three distributions together and they will run simultaneously. In order to use SLE, you need a subscription.

Here I will install openSUSE Leap 42 and Ubuntu. Select the distribution you want, click the "Get" button and install it. Once installed, you can launch openSUSE in Windows. It can be pinned to the Start menu for easy access.

如何在 Windows 10 上开启 Linux子系统

Using Linux in Windwods

When you launch this distribution, it will open a Bash shell and install the distribution. Once installed, you're ready to start using it. You need to note that there are no (regular) users in openSUSE, it runs directly under the root user, but Ubuntu will ask you whether to create a user. In Ubuntu, you can perform administrative tasks as the sudo user.

On openSUSE, you can easily create a user:

# useradd [username]
# passwd [username]

Create a new password for this user. For example:

# useradd swapnil
# passwd swapnil

You can switch from the root user through the su command.

su swapnil

You need a non-root user to perform many tasks, such as using rsync to move files to the local device.

And the first priority is to update the distribution. For openSUSE you should:

zypper up

And for Ubuntu:

sudo apt-get update
sudo apt-get dist-upgrade

如何在 Windows 10 上开启 Linux子系统

Now you have a native Linux Bash shell on Windows. Want to ssh to your server on Windows 10? No need to install puTTY or Cygwin. Once you have Bash open, you can ssh into your server. So simple.

Want to sync files to your server via rsync? Use rsync directly. It effectively transforms our Windows devices into more practical ones, helping users who need to use native Linux commands and Linux tools to avoid virtual machines and open the door to convenience.

Where is Fedora?

You may be wondering why there is no Fedora. Unfortunately, Fedora is not available in the mall. The Fedora project release lead said on Twitter, "We are resolving some non-technical issues. More may not be available at this time."

We are not sure what these non-technical issues are. When some users ask the WSL team why they don’t release Fedora, after all it is also an open source project. Project lead Rich Turner at Microsoft responded, "We have a policy of not releasing other intellectual property into the App Store. We believe the community would rather see distributions owned by distributions than be owned by Microsoft or other non-authoritative parties. Posted by ”

Therefore, it is not convenient for Microsoft to directly release Debian or Arch systems in the Windows Store. These tasks should fall to their official team, who should bring the distribution to Windows 10 users.

If you want to know about the funeral, I will break it down next time

In the next article, we will talk about using Windows 10 as a Linux device and show you the command line tools you might use on your Linux system.

The above is the detailed content of How to turn on the Linux subsystem on Windows 10. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn