Windows wsl2 installation Ubuntu

wsl (Windows Subsystem for Linux) is the Linux subsystem for Windows. It is a technology that enables running native Linux on Windows 10/11.

wsl2 is an iterative version that can better run the Linux subsystem on Windows.

Here we use Windows 11 to install Ubuntu as an example.

Turn on Windows features

  1. Key pressWin , click 设置.

  2. Search 控制面板.

  3. Click 程序.

  4. Click to turn the feature on or off Windows.

  5. Scroll to the bottom and check 适用于Linux的Windows子系统the and 虚拟机平台.

  6. Click 确定.

Install wsl2

  1. The administrator runs the command window and executes the update command:

    wsl --update
    
  2. Execute the installation command:

    wsl --install
    
  3. Now wsl2 is generally used, so you also need to set:

    wsl --set-version 2
    

app store installation

  1. Open the Microsoft store to install the Linux system you want to install. Select Ubuntu here.

  2. After the installation is complete, click Open .

  3. After opening, it will show that the installation is in progress. After a while, the following prompt for entering your account and password will appear.

    Here you can set your own username and password to log in, or you can close the window directly. When you open it again next time, you will log in as root by default, with higher permissions.

Command installation

  1. View the list of available distributions

    wsl --list online
    
  2. Install the distribution that needs to be installed

    wsl --install -d ubuntu
    

    After the installation is complete, click Run. After a while, you will be prompted to enter your user name.

    Here you can set your own username and password to log in, or you can close the window directly. When you open it again next time, you will log in as root by default, with higher permissions.


  • environment

    Windows 10 Pro 22H2

    Ubuntu 22.04.2

Guess you like

Origin blog.csdn.net/qq_37770674/article/details/132720474