1、查看默认位置
搜索栏或者文件管理器地址栏输入:
%localappdata%\Packages
找到类似CanonicalGroupLimited.Ubuntu16.04onWindows的目录,就是Linux安装目录
Linux系统根目录在:LocalState\rootfs\
2、 下载 LxRunOffline
https://github.com/DDoSolitary/LxRunOffline/releases
本例使用 LxRunOffline-v3.3.3
3、 查看子系统并迁移
PS C:\Data\LxRunOffline-v3.3.3> .\LxRunOffline.exe list
Ubuntu-16.04
PS C:\Data\LxRunOffline-v3.3.3> .\LxRunOffline.exe move -n Ubuntu-16.04 -d C:\Ubuntu-16.04
4、迁移完成查看
PS C:\Data\LxRunOffline-v3.3.3> .\LxRunOffline.exe get-dir -n Ubuntu-16.04
C:\Ubuntu-16.04
5、更多用法自行发掘
PS C:\Data\LxRunOffline-v3.3.3> .\LxRunOffline.exe help
[ERROR] The action "help" is not recognized.
Supported actions are:
l, list List all installed distributions.
gd, get-default Get the default distribution, which is used by bash.exe.
sd, set-default Set the default distribution, which is used by bash.exe.
i, install Install a new distribution.
ui, uninstall Uninstall a distribution.
rg, register Register an existing installation directory.
ur, unregister Unregister a distribution but not delete the installation directory.
m, move Move a distribution to a new directory.
d, duplicate Duplicate an existing distribution in a new directory.
e, export Export a distribution's filesystem to a .tar.gz file, which can be imported by the "install" command.
r, run Run a command in a distribution.
di, get-dir Get the installation directory of a distribution.
gv, get-version Get the filesystem version of a distribution.
ge, get-env Get the default environment variables of a distribution.
se, set-env Set the default environment variables of a distribution.
ae, add-env Add to the default environment variables of a distribution.
re, remove-env Remove from the default environment variables of a distribution.
gu, get-uid Get the UID of the default user of a distribution.
su, set-uid Set the UID of the default user of a distribution.
gk, get-kernelcmd Get the default kernel command line of a distribution.
sk, set-kernelcmd Set the default kernel command line of a distribution.
gf, get-flags Get some flags of a distribution. See https://docs.microsoft.com/en-us/previous-versions/windows/desktop/api/wslapi/ne-wslapi-wsl_distribution_flags for details.
sf, set-flags Set some flags of a distribution. See https://docs.microsoft.com/en-us/previous-versions/windows/desktop/api/wslapi/ne-wslapi-wsl_distribution_flags for details.
s, shortcut Create a shortcut to launch a distribution.
ec, export-config Export configuration of a distribution to an XML file.
ic, import-config Import configuration of a distribution from an XML file.
version Get version information about this LxRunOffline.exe.
来源:oschina
链接:https://my.oschina.net/u/4055187/blog/3034298