wsl related summary

  • Enable WSL
    VirtualMachinePlatform is WSL2 dependent functions supported by the system (build 18917+), hardware support for VM functionality and open, to restart the computer after the installation is complete.
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform
  • WSL upgrade to WSL2
wsl --set-version ubuntu 2 #设置为1则降级
  • Configuration file read and write permissions
sudo vim /etc/wsl.conf

Add the following

[automount]
enabled=true
root="/mnt/"
options="metadata,uid=1000,gid=1000,umask=22,fmask=111"
mountFsTab=true
[network]
generateHosts=true
generateResolvConf=true
  • Modify the source Ali cloud images
sudo vim /etc/apt/sources.list
#替换成阿里云镜像
:%s/security.ubuntu/mirrors.aliyun/g
:%s/archive.ubuntu/mirrors.aliyun/g

sudo apt update && sudo apt upgrade -y
  • After closing the git file mode, while operating on wsl solve the windows, on the other side git suggestive of file modification.
git config core.filemode false
git config core.autocrlf true #如果windows上也配置了这个选项,则不建议关闭。

Guess you like

Origin www.cnblogs.com/flying_bat/p/11089167.html
Recommended