windows for linues wsl (Demo fo
2022-03-20 本文已影响0人
FlappyBoy
-
wsl安装
https://docs.microsoft.com/zh-cn/windows/wsl/install
升级wsl2 https://docs.microsoft.com/zh-cn/windows/wsl/install-manual -
ssh
- 添加证书
cd /etc/ssh ssh-keygen -A
- 修改 sshd_config
vim /etc/ssh/sshd_config
PasswordAuthentication yes PermitRootLogin yes Port 22
- 启动 ssh
/etc/init.d/ssh start
-
开机自启程序
- 在 /etc/profile.d 中添加自启动的脚本
-
阿里源
https://developer.aliyun.com/mirror/
https://developer.aliyun.com/mirror/ubuntu?spm=a2c6h.13651102.0.0.3e221b11FU4EU1cp /etc/apt/sources.list /etc/apt/sources.list.bck vim /etc/apt/sources.list apt-get -y update
-
docker (必须升级到wsl2)
apt-get update apt-get -y install apt-transport-https ca-certificates curl software-properties-common curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add - add-apt-repository "deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable" apt-get -y update apt-get -y install docker-ce service docker start gpasswd -a $USER docker # 非root 将当前用户添加到docker组 # 重启 docker ps docker run hello-world
-声明:原创内容,转载请注明出处。