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
- Open powershell as an administrator and enter the following command ( reference )
$ dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
- Control Panel -> Programs and Features -> Turn Windows features on or off -> Tick Windows Subsystem for Linux
Reference
- Restart the computer (after checking, it seems that the computer needs to be restarted to take effect)
- 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-dir
by specifying /mnt/d/目录
Disk up.
installation steps:
(1) Download
Open the app store, search for ubuntu, and install ubuntu 18.04
(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.zip
andLxRunOffline-v3.5.0-msvc.zip
choose one to download. - decompress
- To test, use
LxRunOffline version
the command
$ C:\Users\15758> D:\MyTool\LxRunOffline\LxRunOffline.exe version
LxRunOffline v3.5.0
2. Download wsl offline file
- Download address , there are multiple wsl versions in it, - I chose Ubuntu 18.04
3. Unzip the wsl offline file
- Change
Ubuntu_1804.2019.522.0_x64.appx
toUbuntu_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.gz
to 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.exe
to 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