takeaway

In Windows system development, due to the inconsistency between the system environment and the online environment may lead to various problems, and part of the extended library only supports the liunx system to run, Linux development environment is particularly important. The Windows Linux environment is usually run by the VM/Vbox under the virtual machine, but you can also mount Windows to Linux from the virtual machine, which is quite troublesome. Plus the virtual machine running high occupancy problem

  • Build a complete Linux development environment with VM VirtualBox

Today, Microsoft’s Linux subsystem is used to build a lightweight and efficient Linux system.

WSL (Linux subsystem under Windows)

Windows Subsystem for Linux (WSL) is a compatibility layer that can run native Linux binary executables (ELF format) on Windows 10. It was developed by Microsoft in partnership with Canonical, with the goal of making a pure Ubuntu 14.04 “Trusty Tahr” image available for download and unzip to a user’s local computer, and making the tools and utilities inside the image run nnative on this subsystem

The Linux subsystem under Windows is hereinafter referred to as WSL

WSL supports full Linux functionality

Enabling the Linux Subsystem

  • Win10 developer mode 【 update and security → developer options → developer mode 】

  • Add Linux Subsystem programs 【 Applications → Applications and Features → Programs and Features → Enabling and disabling Windows Features → Windows Subsystem for Linux 】

  • Install Linux from the App Store (Ubuntu can’t install pagodas properly, debian is recommended)

Download and open to automatically install

An installation failure error may occur

Installing, this may take a few minutes...
Installation Failed!
Error: 0x8007019e
Press any key to continue...
Copy the code

The solution

1. Win + X, select Windows PowerShell (Administrator) 2. Input:

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
Copy the code

3. Press Enter, enter Y, and restart.

4. Restart the installed subsystem, wait a few minutes, and enter the account and password.

Installing the development environment

1. Set the user name and password as prompted after the installation is complete

2. Configure the development environment. The Pagoda integrated environment is used here (other environments can be selected).

www.bt.cn

3. The environment ends

Files under Windows can be used entirely in the Linux subsystem

Windows disks are mounted separately in the directory/MNT

Configure the default user for startup

ubuntu/debian config --default-user root
Copy the code

The password of the current user is specified

Passwd new passwordCopy the code