Linux子系统迁移教程,附文件
首先微软商店下载Ubuntu22.04上面
- 启动Ubuntu创建账户和密码
wsl --shutdown
关闭linux子系统- 下载工具包,
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
- 解压,用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: 系统找不到指定的文件。
- win + r 输入regedit进入注册表这个目录
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss\
删除下面的TryStoreWSL
文件夹或者是AppxInstallerCache
不同版本可能不一样。 .\LxRunOffline.exe move -n Ubuntu-22.04 -d D:\sublinux\Ubuntu
输入上面的命令进行系统迁移,-n
后面就是系统的名称,-d
后面就是系统的地址。.\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 |
+-----------------------------------------------------------------------------+
- 下篇就是安装cuda和cudnn,为了方便windows调试深度学习代码
Linux (Ubuntu22.04)子系统安装cuda,cudnn