WSL installation

Install win10's WSL (linux subsystem)

Dual systems or virtual machines (such as VMware) are inconvenient and not small enough, so I choose to use Ubunut in WSL of win10 (the version installed here is Ubunut 18.04).
ps: WSL now has wsl2, which has more functions and supports graphical interface, but I think wsl1 is enough, so I didn't upgrade wsl2.

1.1 Several installation methods of WSL

1.1.1 Enable wsl support

  1. Open powershell as an administrator and enter the following command ( reference )
$ dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
  1. Control Panel -> Programs and Features -> Turn Windows features on or off -> Tick Windows Subsystem for Linux
    Reference
    insert image description here
  2. Restart the computer (after checking, it seems that the computer needs to be restarted to take effect)
  3. If it still doesn't work, check the developer mode and try ( reference )

1.1.2 (Optional) Use Windows store to install directly

The advantage of this method is that it is very simple, but the disadvantage is that it seems impossible to customize the installation path of WSL (the default is installed on the C drive, the path is C:\Users\用户名\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc\LocalState\rootfs), the full version of the ipp library requires 30G, which is relatively large, so we can only install icc and ippi Two components , two components, in fact, only need a few g to be ok--install-dir . In addition, looking at the help documentation, it seems that the installation directory can be specified by parameters when installing ipp , so it should be possible to install ipp to d --install-dirby specifying /mnt/d/目录Disk up.
installation steps:

(1) Download

Open the app store, search for ubuntu, and install ubuntu 18.04
insert image description here

(2) Installation
  • Once the steps are over, you can find ubuntu 18.04 in the start menu and open it directly
  • Open wsl for the first time, there will be a few minutes of initialization process, and then you will be asked to enter the user name and password, this can be completed according to the prompt

1.1.3 (Optional) Use LxRunOffline to customize the installation of wsl

1. Install LxRun Offline
  • Download LxRunOffline, download URL , the latest version (version 3.5.0), LxRunOffline-v3.5.0-mingw.zipand LxRunOffline-v3.5.0-msvc.zipchoose one to download.
  • decompress
  • To test, use LxRunOffline versionthe command
$ C:\Users\15758> D:\MyTool\LxRunOffline\LxRunOffline.exe version
LxRunOffline v3.5.0
2. Download wsl offline file
3. Unzip the wsl offline file
  • Change Ubuntu_1804.2019.522.0_x64.appxto Ubuntu_1804.2019.522.0_x64.zip, then unzip to the directory you want to install.
4. Install wsl

Use the command lxrunoffline i -n <WSL名称> -d <安装路径> -f <安装包路径>.tar.gzto install, the example is as follows

C:\Users\15758>lxrunoffline i -n ubuntu -d D:\MyApp\Ubuntu18 -f D:\MyApp\Ubuntu18\install.tar.gz
[WARNING] Ignoring an unsupported file "dev/full" of type 0020000.
[WARNING] Ignoring an unsupported file "dev/null" of type 0020000.
[WARNING] Ignoring an unsupported file "dev/ptmx" of type 0020000.
[WARNING] Ignoring an unsupported file "dev/random" of type 0020000.
[WARNING] Ignoring an unsupported file "dev/tty" of type 0020000.
[WARNING] Ignoring an unsupported file "dev/urandom" of type 0020000.
[WARNING] Ignoring an unsupported file "dev/zero" of type 0020000.
[WARNING] Love this tool? Would you like to make a donation: https://github.com/DDoSolitary/LxRunOffline/blob/master/README.md#donation
5. open wsl

Double click ubuntu1804.exeto open wsl

6. wsl initialization

Open wsl for the first time, there will be a few minutes of initialization process, and then you will be asked to enter the user name and password, this can be completed according to the prompt

Guess you like

Origin blog.csdn.net/qq_29809823/article/details/118936427
Recommended