控制面板–程序–程序和功能–启用或关闭windows功能,勾选适用于Linux的windows子系统。
进入win10应用商店,安装并启动。
修改成阿里云的软件源
sudo mv /etc/apt/sources.list /etc/apt/sourses.list.backup
sudo vi /etc/apt/sources.list
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
迁移到非系统盘,操作都在win10上进行
1、查看系统用户名
打开系统cmd,输入以下命令
whoami
2、在迁移目标磁盘创建一个文件夹 ,并设置权限。
例如创建F:\Ubuntu.windows文件夹后,在Windows中执行如下命令(替换成自己的用户名):
icacls F:\Ubuntu.windows /grant "sph:(OI)(CI)(F)"
3、下载 LxRunOffline
下载 LxRunOffline 找到最新发布版本,下载并解压
4、查看已安装的Linux发行版本,好像在cmd中打不开,需要打开powershell
.\LxRunOffline.exe list
5、迁移Linux文件,需要先把Ubuntu关闭,否则会出现错误。
[ERROR] The distro "Ubuntu-18.04" has running processes and can't be operated. "wsl -t <name>" or "wsl --shutdown" might help.
运行这个指令,这个过程要持续几分钟,期间出现下图中的WARNING不用担心,耐心等待程序执行完毕即可
./LxRunOffline.exe move -n Ubuntu-18.04 -d F:/Ubuntu.windows
6、确认迁移完成
.\LxRunOffline.exe get-dir -n Ubuntu-18.04
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)