win11使用wsl2安装ubuntu24.04

  1. 使用管理员打开powershell
  2. 启用WSL2和虚拟化
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
bcdedit /set hypervisorlaunchtype auto
wsl --update
  1. 安装Ubuntu24.04
wsl --install -d Ubuntu-24.04
  1. 迁移Ubuntu到D盘
wsl --shutdown
wsl --export Ubuntu-24.04 D:\WSL\Ubuntu24.04.tar
wsl --unregister Ubuntu-24.04
wsl --import Ubuntu-24.04 D:\WSL\Ubuntu24.04 D:\WSL\Ubuntu24.04.tar --version 2
posted @ 2025-12-17 09:11  小小爬虫  阅读(18)  评论(0)    收藏  举报