【翻译 《How To Run Arch Linux on Windows WSL》——Kibet John】
序幕
适用于 Linux 的 Windows 子系统允许开发人员直接在 Windows 上运行 GNU/Linux 环境(包括大多数命令行工具、实用程序和应用程序),无需修改,无需虚拟机开销。
WSL 使您能够:
- 选择您最喜欢的 GNU/Linux 发行版(Arch Linux、Ubuntu、OpenSUSE、Kali、Debian、Fedora、Pengwin 等)。
- 运行常见的命令行免费软件,例如 grep、sed、awk 或其他 ELF-64 二进制文件。
- 运行 Bash shell 脚本和 GNU/Linux 命令行应用程序
- 使用自己的 GNU/Linux 分发包管理器安装附加软件。
- 使用类 Unix 命令行 shell 调用 Windows 应用程序。
- 在 Windows 上调用 GNU/Linux 应用程序。
有了这样的能力,我们就可以完成很多工作,而不必担心安装虚拟机管理程序,从而享受 Linux 的好处。安装并准备好 Windows 10 后,请按照以下步骤操作,您将拥有 Arch Linux 风格。
第 1 步:安装适用于 Linux 的 Windows 子系统
这是一项使 Windows 能够自行“托管”Linux 的功能。要启用此功能,您可以运行 PowerShell 命令或按照以下 GUI 步骤操作。
选项 1:运行 Powershell 命令
以管理员身份打开 PowerShell 并运行以下命令
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
可选 2:按照桌面上所示的屏幕截图进行操作
点击您的 Windows 键并输入“控制”以搜索“控制面板”。
出现后,单击它以打开应用程序。
点击“程序”。
进入“程序”后,单击“打开或关闭 Windows 功能”
这将打开一个名为“ Windows 功能” 的小弹出窗口。向下滚动直到看到“ Windows Subsystem for Linux ”。单击复选框以选中该选项,然后单击“确定”。这将提示您重新启动计算机。做个好人,服从命令。重新启动计算机后,继续下一步。
第 2 步:前往 GitHub 下载 ArchWSL
单击此链接从 GitHub 获取 ArchWSL。单击 ZIP 文件进行下载。
第 3 步:解压下载的文件
成功下载文件后,只需将其解压缩即可获得我们感兴趣的应用程序。
第 4 步:单击 Arch.exe 应用程序
现在是时候安装我们的应用程序并在我们的桌面上安装 Arch beasting 了。双击应用程序文件,它将打开一个类似命令行的窗口,如下所示。
安装完成后,您应该会看到如下图所示的消息。按任意键,我们的应用程序(ArchWSL)就安装好了。
第 5 步:启动应用程序
只需再次单击该应用程序,您就会有 Arch Linux 控制台等待您的命令。
用Scoop
scoop bucket add extras
scoop install archwsl
Exe 使用:
Usage :
<no args>
- Open a new shell with your default settings.
run <command line>
- Run the given command line in that instance. Inherit current directory.
runp <command line (includes windows path)>
- Run the given command line in that instance after converting its path.
config [setting [value]]
- `--default-user <user>`: Set the default user of this instance to <user>.
- `--default-uid <uid>`: Set the default user uid of this instance to <uid>.
- `--append-path <true|false>`: Switch of Append Windows PATH to $PATH
- `--mount-drive <true|false>`: Switch of Mount drives
- `--default-term <default|wt|flute>`: Set default type of terminal window.
get [setting]
- `--default-uid`: Get the default user uid in this instance.
- `--append-path`: Get true/false status of Append Windows PATH to $PATH.
- `--mount-drive`: Get true/false status of Mount drives.
- `--wsl-version`: Get the version os the WSL (1/2) of this instance.
- `--default-term`: Get Default Terminal type of this instance launcher.
- `--lxguid`: Get WSL GUID key for this instance.
backup [contents]
- `--tar`: Output backup.tar to the current directory.
- `--reg`: Output settings registry file to the current directory.
clean
- Uninstall that instance.
help
- Print this usage message.
结论
现在是在 Windows 环境中享受 Arch 实例的时候了,我们希望它会很有趣。如果你不是 Bash 的粉丝,你可以继续安装你最喜欢的 shell,也可以根据需要进行其他修改。总而言之,我们希望这篇文章是有用的和令人愉快的。您还可以考虑阅读下面列出的其他指南