WSL安装ubuntu与简单使用
安装WSL
WSL安装
全程在网络畅通的情况下执行命令。
设置版本
| 1 | wsl --set-default-version <Version#>,将 <Version#> 替换为 1 或 2。 | 
WSL
| 原因 | 解决方案 | 参考 | ||
|---|---|---|---|---|
| PS C:\Windows\system32> wsl –update 正在安装: 适用于 Linux 的 Windows 子系统 灾难性故障 | https://github.com/microsoft/WSL/releases | |||
| PS C:\Windows\system32> wsl –install -d Ubuntu-24.04 安装过程中出现错误。分发名称: ‘Ubuntu 24.04 LTS’ 错误代码: 0x8000ffff | ||||
| PS C:\Windows\system32> wsl –install -d Ubuntu-24.04 灾难性故障 Error code: Wsl/InstallDistro/E_UNEXPECTED | 开启clash wsl –shutdown wsl –update wsl –install Ubuntu –web-download | https://learn.microsoft.com/en-us/answers/questions/1312694/error-code-wsl-installdistro-e-unexpected-catastro https://github.com/microsoft/WSL/issues/9545 | ||
| PS C:\Users\16353> wsl –update 已禁止(403)。 | 卸载KB5034204 | https://answers.microsoft.com/zh-hans/windows/forum/all/%E5%AE%89%E8%A3%85kb5034204%E5%90%8Ewsl/1934ff06-c11e-4424-809d-189b3d5ab0cb | ||
| 1 | Windows PowerShell | 
使用exit退出虚拟机,之后可以看到vmmem占用大量内存,可以使用 wsl --shutdown 退出WSL。
卸载
| 1 | wsl --list | 
重置密码
| 1 | PS> wsl.exe --user root | 
文件传输
cd /mnt转到 /mnt 目录下,你可以看到Windows盘信息,直接mv即可。
环境配置
| 1 | sudo apt update | 
https://blog.csdn.net/jiexijihe945/article/details/131894202