Win10 uses WSL (Windows Subsystem for Linux) to install Ubuntu

Copyright Notice

  • The content of this blog is based on my personal study notes from the Dark Horse Programmer course. I hereby declare that all copyrights belong to Dark Horse Programmers or related rights holders. The purpose of this blog is only for personal learning and communication, not commercial use.
  • I try my best to ensure accuracy when organizing my study notes, but I cannot guarantee the completeness and timeliness of the content. The content of this blog may become outdated over time or require updating.
  • If you are a Dark Horse programmer or a related rights holder, if there is any copyright infringement, please contact me in time and I will delete it immediately or make necessary modifications.
  • For other readers, please abide by relevant laws, regulations and ethical principles when reading the content of this blog, refer to it with caution, and bear the resulting risks and responsibilities at your own risk.

Introduction to WSL

  • WSL, which stands for Windows Subsystem for Linux, is a compatibility layer for running Linux on Windows 10 and Windows Server 2019.

  • WSL enables developers to run Linux applications and tools on Windows without using a virtual machine or dual-boot.

  • The main purpose of WSL is to help developers run development tools on Linux more easily.
    Insert image description here

  • The WSL function of Windows 10 can directly use the physical hardware of the host without a separate virtual set of hardware devices. Building a Linux operating system will not affect the operation of the Windows system itself.

  • There are two main versions of WSL: WSL 1 and WSL 2.

  • WSL 1

    1. WSL 1 uses a translation layer to convert Linux system calls into Windows system calls.
    2. No virtual machine is required to run.
    3. File system performance is not as good as WSL 2.
  • WSL 2

    1. WSL 2 uses the real Linux kernel and is implemented through lightweight virtual machine technology.
    2. Provides faster file system performance and full system call compatibility than WSL 1.
    3. Support Docker containers.
    4. Virtualization technology needs to be enabled.
  • scenes to be used

    1. Develop and test cross-platform applications.
    2. Run Linux-specific or preferred development tools and services.
    3. Container development and testing.
  • Precautions

    • WSL is not a complete Linux system. It does not have its own kernel (WSL 1), while WSL 2 uses Microsoft's customized Linux kernel. Although it can run many Linux applications and tools, it may not be suitable for all purposes, especially where deep system customization and kernel-level development are required.

Advantages of WSL

  • WSL (Windows Subsystem for Linux) offers many advantages. The following are the main advantages of WSL:
  1. Integration: WSL enables users to use both Windows and Linux tools in a single environment on the same computer, rather than switching back and forth between two different operating systems or through virtual machines.
  2. Resource efficiency: Compared with traditional virtual machines, WSL has less overhead on system resources. Especially in WSL 2, it uses lightweight virtualization technology instead of completely simulating a complete physical computer.
  3. File system integration: WSL provides seamless access between Windows and Linux file systems. For example, you can use Linux tools to manipulate Windows files in WSL, and vice versa.
  4. Development friendly: For developers, WSL provides a near-native Linux development environment, which is especially useful for cross-platform development or using specific Linux tools and libraries.
  5. Cross-platform testing: Application behavior under Windows and Linux can be tested on the same system without the need to configure additional test environments.
  6. Containerization support: WSL 2 supports Docker containers, which allows developers to build and test Linux containers on local Windows machines.
  7. Regular Updates: WSL receives ongoing support and updates from Microsoft to ensure it remains current with the latest Linux distributions and features.
  8. Wide selection of Linux distributions: Through the Microsoft Store, users can choose and install a variety of popular Linux distributions, such as Ubuntu, Debian, Fedora, etc.
  9. Security: WSL provides the same level of security protection as native Windows, including access control, virus and malware protection, etc.
  10. Learning and experimentation: WSL provides a low-risk experimental environment for users who want to learn Linux but don't want to give up or restart Windows.

WSL deployment

  • WSL is a built-in function of Windows 10. It needs to be turned on and does not need to be downloaded.
    Insert image description here
  • After clicking OK, the deployment will be carried out and finally restarted.
    Insert image description here
  • Open Windows Store
    Insert image description here
  • Search Ubuntu
    Insert image description here
  • Click to get and install
    Insert image description here
  • Click to start
    Insert image description here
  • Enter a username to create a user:
    Insert image description here
  • Enter the password twice to confirm (note that there is no feedback when entering the password, ignore it, just enter it normally)
    Insert image description here
  • At this point, the available Ubuntu operating system environment is obtained
    Insert image description here

Windows Terminal deployment

  • The terminal window software that comes with Ubuntu is not easy to use. Use the Windows Terminal software launched by Microsoft.
  1. Search the terminal keyword in the app store, find the Windows Terminal software, download and install it
    Insert image description here
    Insert image description here
    Insert image description here
  • Open the Windows Terminal software again, and the Ubuntu system will be used by default (WSL)
    Insert image description here

Guess you like

Origin blog.csdn.net/yang2330648064/article/details/133249004