In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to install WSL 2 on Windows 10, which has a certain reference value, and interested friends can refer to it. I hope you can learn a lot after reading this article.
WSL 2 is a major upgrade to the original version of WSL launched by Microsoft in 2017. WSL2 is more than just a version upgrade. Faster, more functional, and uses a real Linux kernel. Future Linux kernel updates will even be released in the form of Windows 10 software updates. Come to think of it, it's a little crazy!
Microsoft's goal in creating WSL 2 is to improve performance. What is the best way to do this? Add full system call compatibility, that is, with the real Linux kernel at the core.
"this new architecture provides a better platform for the WSL team, and the features provided by these platforms make WSL an excellent way to run a Linux environment in Windows," Microsoft said of the technology.
Install WSL 2 on Windows 10
Request
To install WSL 2 on Windows 10, you need to do the following:
Windows 10 May 2020 (2004), Windows 10 May 2019 (1903) or Windows 10 November 2019 (1909) or later
Computers with Hyper-V virtualization support
Although the May 2020 update for Windows 10 has been released early, not all current devices can be upgraded to this device. To see if the Windows 10 May 2020 update is on your computer, go to Settings > updates and Security > Windows updates.
If you can't upgrade, don't worry. Because in August 2020, Microsoft reverse migrated WSL 2 to an earlier version of Windows 10. Anyone using version 1903 or 1909 can also install WSL 2mer-but Windows Update KB4566116 must be installed first.
Perfection-seeking Windows users can also force the installation of the Windows 10 May 2020 update, keep in mind that if you follow this approach, you may encounter missing drivers, GUI failures, or other hardware failures.
Technically, you can install WSL 2 on "internal" versions of Windows 10 build 18917 or later. I'm not familiar with how the "internal" build system works, so note that the rest of this article is based on using this feature on a stable version of Windows.
Your computer also needs to support Hyper-V virtualization to run WSL2. You can check your Hyper-V support.
If you cannot meet both requirements, you cannot install or enable WSL 2, but you can use WSL 1.
The procedure for installing WSL 2 on Windows 10 is as follows:
Hongmeng official Strategic Cooperation to build HarmonyOS Technology Community
Enable WSL 2
Enable Virtual Machine platform
Set WSL 2 as the default
Install the Linux distribution
I will step through each step in turn using the PowerShell application, which you need to run as an administrator. You can find PowerShell in the Windows start menu.
Note: you can also install WSL 1 using GUI, but using the command line is much faster, and since WSL is a CLI tool, it makes sense!
Step 1: enable WSL
No matter which version of WSL you want to use, you need to enable it first. To do this, open the PowerShell tool, administrator and run the command. Be careful not to type errors or omit any characters in the command:
Dism.exe / online / enable-feature / featurename:Microsoft-Windows-Subsystem-Linux / all / norestart
Just want to use WSL 1? Then skip to step four.
Step 2: enable "Virtual Machine platform"
WSL 2 needs to enable the Virtual Machine platform feature of Windows 10. The computer requires a virtualization feature to use this feature. This is separate from Hyper-V and provides some new, more interesting platform integrations available in the Windows subsystem for Linux.
To enable the virtual machine platform on Windows 10 (2004), open PowerShell as an administrator and run:
Dism.exe / online / enable-feature / featurename:VirtualMachinePlatform / all / norestart
To enable the virtual machine platform on Windows 10 (1903 and 1909), open PowerShell as an administrator and run:
Enable-WindowsOptionalFeature-Online-FeatureName VirtualMachinePlatform-NoRestart
To ensure that all relevant parts are in place, you should restart the system at this time, otherwise you may find that things are not working as expected.
Step 3: set WSL 2 as the default
Open PowerShell as an administrator and run the following command to set WSL 2 as the default version of WSL:
Wsl-- set-default-version 2
If desired, you can configure the distribution to run in WSL 1 mode at any time.
Step 4: install the distribution
With WSL and the necessary virtualization technologies, all you have to do is select and install the Linux distribution from Microsoft Store.
Several different distributions are available, including OpenSUSE,Pengwin,Fedora Remix and Alpine Linux. But my personal advice is Ubuntu 20.04 LTS (although 18.04 LTS and 16.04 LTS are also available).
To install Ubuntu on Windows 10, open the Microsoft Store app, search for "Ubuntu 20.04", and then click the get button:
Ubuntu 20.04 LTS on Microsoft Store
When you are in Microsoft Store, I strongly recommend that you also install the open source Windows Terminal application (link: https://www.linuxmi.com/windows-terminal-preview-1-7.html). This tool is designed to provide you with the best WSL experience:
Open source Windows Terminal application
Step 5: use WSL 2
When you install Ubuntu (or another Linux distribution), shortcuts are added to the start menu. Use it to "open" Ubuntu (or any distribution of your choice). The first time you run the release, you will feel a little slow. This is a release that must unzip all its contents and do not interrupt the process.
You will also be prompted to set the user name and password for the distribution. Try to pick something you won't forget.
You will also be prompted to set the user name and password for the distribution.
Convert Ubuntu on WSL 1 to WSL 2
If you use WSL 1, you can upgrade your existing WSL 1 installation to WSL 2. To convert an existing version of WSL 1 to WSL 2, run the following command in PowerShell, for example:
Wsl.exe-- set-version Ubuntu 2
Regardless of the name of the Ubuntu distribution on which you are running the WSL 1 installation, such as Ubuntu 18.04 or 20.04, it should be replaced with "Ubuntu".
Thank you for reading this article carefully. I hope the article "how to install WSL 2 on Windows 10" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.