$ .\LxRunOffline.exe [ERROR] No action is specified.
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. sf, set-flags Set some flags of a distribution. 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. sm, summary Get general information of a distribution. version Get version information about this LxRunOffline.exe.
例如,列出当前已经安装的发行版:
1 2 3 4 5
$ .\LxRunOffline.exe l Ubuntu-18.04 Ubuntu-20.04 Ubuntu-16.04 CentOS7
$ .\LxRunOffline.exe d [ERROR] the option '-N' is required but missing
Options: -n arg Name of the distribution -d arg The directory to copy the distribution to. -N arg Name of the new distribution. -c arg The config file to use. This argument is optional. -v arg (=4294967295) The version of filesystem to use, same as source if not specified.
因此,如果我想要再安装一个Ubuntu 18.04,可执行如下命令:
1 2 3 4 5 6 7 8 9
$ .\LxRunOffline.exe d -n Ubuntu-18.04 -d V:\wsl\Ubuntu-18.04-22\ -N Ubuntu-18.04-1
[WARNING] Ignoring an unsupported file "\\?\V:\wsl\Ubuntu-18.04\rootfs\dev\full" of type 0020000. [WARNING] Ignoring an unsupported file "\\?\V:\wsl\Ubuntu-18.04\rootfs\dev\null" of type 0020000. [WARNING] Ignoring an unsupported file "\\?\V:\wsl\Ubuntu-18.04\rootfs\dev\ptmx" of type 0020000. [WARNING] Ignoring an unsupported file "\\?\V:\wsl\Ubuntu-18.04\rootfs\dev\random" of type 0020000. [WARNING] Ignoring an unsupported file "\\?\V:\wsl\Ubuntu-18.04\rootfs\dev\tty" of type 0020000. [WARNING] Ignoring an unsupported file "\\?\V:\wsl\Ubuntu-18.04\rootfs\dev\urandom" of type 0020000. [WARNING] Ignoring an unsupported file "\\?\V:\wsl\Ubuntu-18.04\rootfs\dev\zero" of type 0020000.
警告信息可忽略。
现在,有一个Ubuntu-18.04就可以使用了。
1 2 3 4 5 6 7
$ wsl -l -v NAME STATE VERSION * Ubuntu-16.04 Stopped 1 Ubuntu-18.04-1 Stopped 1 Ubuntu-18.04 Stopped 1 Ubuntu-20.04 Stopped 2 CentOS7 Stopped 1