Linux子系统迁移教程(C盘到其他盘)

Linux子系统迁移教程,附文件

首先微软商店下载Ubuntu22.04上面

  1. 启动Ubuntu创建账户和密码
  2. wsl --shutdown关闭linux子系统
  3. 下载工具包,LxRunOffline-v3.5.0-11-gfdab71a-msvc.zip必须下载这个版本
  • 下载上面的安装包就不会出现这个问题
Couldn't set the case sensitive attribute of the directory "\\?\C:\Users\xxx\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\".
Reason: Indicates that the directory trying to be deleted is not empty.
  • 原来的地址失效了,这里我提供一个百度网盘的地址。

提供下载地址:
链接:https://pan.baidu.com/s/10Muke9epRsAtLfCdOp_cPg
提取码:hqmt

  1. 解压,用powershell在解压目录打开,输入 .\LxRunOffline.exe list,显示linux子系统版本。

如果遇到错误,进入第五步,否则跳过。进入第六步。

(base) PS D:\sublinux> .\LxRunOffline.exe list
[ERROR] Couldn't get the value "DistributionName" of the registry key "Software\Microsoft\Windows\CurrentVersion\Lxss\TryStoreWSL".
Reason: 系统找不到指定的文件。
  1. win + r 输入regedit进入注册表这个目录HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss\删除下面的TryStoreWSL文件夹或者是AppxInstallerCache不同版本可能不一样。
  2. .\LxRunOffline.exe move -n Ubuntu-22.04 -d D:\sublinux\Ubuntu输入上面的命令进行系统迁移,-n后面就是系统的名称,-d后面就是系统的地址。
  3. .\LxRunOffline.exe get-dir -n Ubuntu-22.04检查系统的版本安装位置。

到此为止,安装结束,默认的linux子系统自带windows显卡,可以输入Nvidia查看信息

Thu Jan 19 15:57:49 2023
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 515.67       Driver Version: 517.00       CUDA Version: 11.7     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  ERR!                On   | 00000000:01:00.0 Off |                  N/A |
| N/A    0C    P0    N/A /  N/A |      0MiB /  6144MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

猜你喜欢

转载自blog.csdn.net/Fly_the_start/article/details/128735889