下载好之后解压,然后用Windows PowerShell(管理员) cd到解压目录,然后输入以下命令显示子系统
.\LxRunOffline.exe list
如遇到以下错误,没有则直接开始迁移
[ERROR] Couldn't get the value "DistributionName" of the registry key "Software\Microsoft\Windows\CurrentVersion\Lxss\TryStoreWSL".
Reason: 系统找不到指定的文件。
使用win+r
,输入regedit
进入注册表,然后进到计算机\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss
这个目录,删除下面的TryStoreWSL
或AppxInstallerCache
,不同版本可能不一样,然后再试一次.\LxRunOffline.exe list
,看看有没报错,没有就开始迁移。
开始迁移子系统:
.\LxRunOffline.exe move -n Ubuntu-20.04 -d D:\SubSystem\Ubuntu
解释:-n后面是系统的名称,-d后面是系统要迁移的位置
检查系统的版本安装位置
.\LxRunOffline.exe get-dir -n Ubuntu-20.04