This guide explains how to install WSL2 on Windows, install the Ubuntu-24.04 subsystem, and migrate it to another drive. It starts by opening PowerShell, running the required installation commands, and restarting the computer to apply changes. Then it shows how to view available Linux distributions, select Ubuntu-24.04, install it, set up a username and password, and enter the shell successfully. Finally, it describes moving Ubuntu to a new disk by creating a folder such as E:\WSL\Ubuntu-24.04, exporting the existing Ubuntu instance, unregistering the original Ubuntu-24.04, and re-importing it to the new location. A related WSL2 and Ubuntu installation guide is provided as a reference.
安装WSL2
运行安装命令
打开Powershell,运行如下两条命令
重启电脑
应用相关更改
安装想要的子系统
查看所有系统选项
我们这里选择Ubuntu-24.04
安装Ubuntu-24.04
进行用户名以及密码设置
成功进入Shell
迁移Ubuntu至新盘
在E盘创建文件夹
此处以E:\WSL\Ubuntu-24.04为例
运行导出命令
取消注册原有的 Ubuntu-24.04
重新导入Ubuntu-24.04
参考文献