1.以管理员运行powershell命令,打开功能“Windows Subsystem for Linux”:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
2.在windows store里下载安装ubuntu app:
https://www.microsoft.com/zh-cn/p/ubuntu-1804/9n9tngvndl3q?activetab=pivot%3aoverviewtab
3.如果需要ssh登录127.0.0.1:22,需重新安装ssh server,解决key的报错。
sudo apt-get purge openssh-server sudo apt-get install openssh-server
4.如果需要,可编译自己定义的linux子系统
https://docs.microsoft.com/en-us/windows/wsl/build-custom-distro
参考:
https://docs.microsoft.com/en-us/windows/wsl/install-win10#for-anniversary-update-and-creators-update-install-using-lxrun
原文地址:https://www.cnblogs.com/codeRhythm/p/9515278.html
时间: 2024-11-07 14:40:13