参考:
- 1.若要查看可通过在线商店下载的可用 Linux 发行版列表,请输入:
- wsl --list --online
- 或
- wsl -l -o
-
- > wsl -l -o
- 以下是可安装的有效分发的列表。
- 使用 'wsl.exe --install
' 安装。 -
- NAME FRIENDLY NAME
- Ubuntu Ubuntu
- Debian Debian GNU/Linux
- kali-linux Kali Linux Rolling
- Ubuntu-18.04 Ubuntu 18.04 LTS
- Ubuntu-20.04 Ubuntu 20.04 LTS
- Ubuntu-22.04 Ubuntu 22.04 LTS
- OracleLinux_7_9 Oracle Linux 7.9
- OracleLinux_8_7 Oracle Linux 8.7
- OracleLinux_9_1 Oracle Linux 9.1
- openSUSE-Leap-15.5 openSUSE Leap 15.5
- SUSE-Linux-Enterprise-Server-15-SP4 SUSE Linux Enterprise Server 15 SP4
- SUSE-Linux-Enterprise-15-SP5 SUSE Linux Enterprise 15 SP5
- openSUSE-Tumbleweed openSUSE Tumbleweed
- 2. 安装镜像
- > wsl --install -d Ubuntu-20.04
安装时遇到的问题
- > wsl --install -d Ubuntu-20.04
- Ubuntu 20.04 LTS 已安装。
- 正在启动 Ubuntu 20.04 LTS...
- Installing, this may take a few minutes...
- WslRegisterDistribution failed with error: 0x80370102
- Please enable the Virtual Machine Platform Windows feature and ensure virtualization is enabled in the BIOS.
- For information please visit https://aka.ms/enablevirtualization
- Press any key to continue...
参考:WSL2 请启用虚拟机平台 Windows 功能并确保在 BIOS 中启用虚拟化_当前计算机配置不支持 wsl2。 请启用“虚拟机平台”可选组件,并确保在 bios 中启-CSDN博客
PC没有找到Hyper-V选项时,参考:
PC找不到编辑组策略时,参考:
Win10家庭版找不到组策略gpedit.msc的解决方法 - 知乎 (zhihu.com)
问题:
- > wsl
- 适用于 Linux 的 Windows 子系统没有已安装的分发。
-
- 使用 'wsl.exe --list --online' 列出可用的分发
- 并使用 'wsl.exe --install
' 进行安装。 -
- 也可以通过访问 Microsoft Store 安装分发:
- https://aka.ms/wslstore
- Error code: Wsl/Service/CreateInstance/GetDefaultDistro/WSL_E_DEFAULT_DISTRO_NOT_FOUND
管理员powershell中输入:
- PS C:\Windows\system32> Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
-
- Path :
- Online : True
- RestartNeeded : False
-
-
-
- PS C:\Windows\system32>
!!!把PC BIOS中的虚拟技术 使能 。