完成翻译,等待校对

This commit is contained in:
vvvbbbcz 2022-09-24 23:04:09 +08:00
parent ac0337db7a
commit fb9f8d7728
2 changed files with 114 additions and 114 deletions

View File

@ -1,114 +0,0 @@
[#]: subject: "Systemd is Now Available in WSL"
[#]: via: "https://news.itsfoss.com/systemd-wsl/"
[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/"
[#]: collector: "lkxed"
[#]: translator: "vvvbbbcz"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Systemd is Now Available in WSL
======
Microsoft's WSL now supports systemd making the experience better for users.
Learn more about it here.
![Systemd is Now Available in WSL][1]
WSL (Windows Subsystem for Linux) has finally received support for Systemd, this comes in a few months after its creator joined Microsoft.
[More Linux Developers Joining Microsoft, Systemd Creator Adds to the List][2]
And this has been made possible with a partnership between Microsoft and Canonical.
**In case you're curious**:
It acts as an init system that starts up and keeps user space services in running order.
Let's see how it has been introduced to WSL.
### Systemd Enhancing the WSL Experience
![WSL: Partnering with Canonical to support systemd][4]
The main focus of introducing systemd to WSL is to improve the Linux workflow on Windows machines.
The likes of Debian, Ubuntu, Fedora, and more run systemd by default. So, this integration will now make it even more straightforward for users of those distros to conveniently do more with WSL.
Even though we have systemd-free distros available, it is not meant for everyone. So, the support for systemd on WSL makes sense.
A lot of critical Linux applications also rely on systemd to be functional. For instance, '**snap**', '**microk8s**' and '**LXD**' are dependent on it.
The presence of systemd also makes it possible to use more tools to test and run from within Windows, resulting in a better WSL experience.
#### Suggested Read 📖
[14 Best Systemd-Free Linux Distributions][5]
### Here's How It Was Made Possible
The team behind WSL had to make changes to the architecture, they made the WSL init process start within the Linux distro as a child process under systemd.
Doing so enabled the WSL init process to provide the necessary foundation for communication between the Windows and Linux sub-systems, as explained in their [official announcement][7].
They also did additional modifications to ensure a clean system shutdown by preventing systemd from keeping the WSL instance active.
You can also visit their official [documentation][8] website for more information.
### Get Started With Systemd on WSL
> Existing WSL users will have to opt in to enable systemd on their systems, this step was taken to avoid any booting issues that might occur due to the introduction of systemd.
First and foremost, you have to ensure that your system is running WSL: **Version 0.67.6** or above.
You can check your WSL version by running the following command
```
wsl --version
```
If you are running the older version, you can update it via the **Microsoft Store** or by running this command.
```
wsl --update
```
Furthermore, if you are not a part of Windows Insiders, you can go to the [WSL release page][9] and download it to test it out.
For systemd to work on your system, you will have to edit the '[wsl.conf][10]' file to ensure that systemd starts up on boot.
Add the following lines to make WSL run systemd on boot.
```
[boot]
systemd=true
```
Finally, restart your WSL instance to see the changes.
Microsoft has taken a big step forward in the development of WSL with the implementation of systemd, this should result in more users being attracted to WSL.
*💬 Excited to run WSL with systemd? Or do you prefer systemd-free distros?*
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/systemd-wsl/
作者:[Sourav Rudra][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/sourav/
[b]: https://github.com/lkxed
[1]: https://news.itsfoss.com/content/images/size/w1200/2022/09/systemd-now-available-on-wsl.png
[2]: https://news.itsfoss.com/systemd-creator-microsoft/
[3]: https://news.itsfoss.com/systemd-creator-microsoft/
[4]: https://youtu.be/Ja3qikzd-as
[5]: https://itsfoss.com/systemd-free-distros/
[6]: https://itsfoss.com/systemd-free-distros/
[7]: https://devblogs.microsoft.com/commandline/systemd-support-is-now-available-in-wsl/
[8]: https://learn.microsoft.com/en-in/windows/wsl/
[9]: https://github.com/microsoft/WSL/releases
[10]: https://learn.microsoft.com/en-in/windows/wsl/wsl-config#wslconf

View File

@ -0,0 +1,114 @@
[#]: subject: "Systemd is Now Available in WSL"
[#]: via: "https://news.itsfoss.com/systemd-wsl/"
[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/"
[#]: collector: "lkxed"
[#]: translator: "vvvbbbcz"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Systemd 已可用于 WSL
======
微软的 WSL 现已支持 systemd为用户提供了更好的体验。
你可阅读此文了解更多。
![Systemd 已可用于 WSL][1]
WSLWindows Subsystem for Linux终于拥有了对 Systemd 的支持,这是在 systemd 的创建者加入微软的几个月后实现的。
[更多 Linux 开发者们加入微软Systemd 的创建者也加入这一行列][2]
而这已使微软和 Cannonical 的合作成为可能。
**如果你好奇 Systemd 是什么**
它作为一个初始化系统,启动并维持用户空间其他服务的正常运行。
让我们看看它是如何被引入 WSL 的。
### Systemd 增强 WSL 的体验
![WSL: 与 Cannonical 合作以支持 Systemd][4]
在 WSL 中引入 systemd主要是为改善 Windows 机器上的 Linux 工作流程。
像 Debian、Ubuntu、Fedora 等,都是默认运行 systemd 的。因此,这项整合将使这些发行版的用户更方便地在 WSL 上做更多工作。
很多关键的 Linux 程序也是靠 systemd 实现的。例如 '**snap**'、'**microk8s**' 和 '**LXD**' 都依赖它。
即使我们有不含 systemd 的发行版可用,它们也并不适合所有人。因此,在 WSL 上添加对 systemd 的支持是很有意义的。
Systemd 的存在也使得在 Windows 中使用更多工具来测试和运行成为可能,从而带来更好的 WSL 体验。
#### 建议阅读 📖
[14 个无 Systemd 的 Linux 发行版][5]
### 它是如何实现的
WSL 背后的团队必须修改其架构,它们让 WSL 的初始化进程在 Linux 发行版中以 systemd 的一个子进程启动。
正如其 [官方公告][7] 所述,这样做使得 WSL 初始化程序能够为 Windows 和 Linux 子系统之间的通讯提供必要的基础。
它们还做了额外的修改,通过防止 systemd 保持 WSL 实例的活动以确保系统的干净关机。
你亦可访问他们的 [官方文档][8] 以了解更多。
### 在 WSL 上使用 Systemd
> 现有的 WSL 用户必须在他们的系统上手动启用 systemd以防止由于 systemd 的引入而导致的启动问题。
首先,你必须确保你的系统运行的是 **0.67.6** 或更高版本的 WSL。
你可以通过以下命令检查你的 WSL 版本。
```
wsl --version
```
如果你正在运行旧版本,你可以通过<ruby>**微软应用商店**<rt>**Microsoft Store**</rt></ruby>或者以下命令更新它。
```
wsl --update
```
此外,如果你不是 <ruby>Windows 预览体验成员<rt>Windows Insider</rt></ruby>,你可以到 [WSL 发行页面][9] 下载它来体验。
为了让 systemd 在你的系统上运行,你需要修改 '[wsl.conf][10]' 这个文件以确保 systemd 在启动时运行。
在 'wsl.conf' 添加以下几行以使 WSL 在启动时运行 systemd
```
[boot]
systemd=true
```
最后,重启你的 WSL 实例以见证更改。
随着对 systemd 的支持,微软在 WSL 的发展又前进了一大步,这将使得 WSL 吸引更多用户。
*💬 对 WSL 支持 systemd 感到兴奋?或是你更喜欢无 systemd 的发行版?*
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/systemd-wsl/
作者:[Sourav Rudra][a]
选题:[lkxed][b]
译者:[vvvbbbcz](https://github.com/vvvbbbcz)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/sourav/
[b]: https://github.com/lkxed
[1]: https://news.itsfoss.com/content/images/size/w1200/2022/09/systemd-now-available-on-wsl.png
[2]: https://news.itsfoss.com/systemd-creator-microsoft/
[3]: https://news.itsfoss.com/systemd-creator-microsoft/
[4]: https://youtu.be/Ja3qikzd-as
[5]: https://itsfoss.com/systemd-free-distros/
[6]: https://itsfoss.com/systemd-free-distros/
[7]: https://devblogs.microsoft.com/commandline/systemd-support-is-now-available-in-wsl/
[8]: https://learn.microsoft.com/en-in/windows/wsl/
[9]: https://github.com/microsoft/WSL/releases
[10]: https://learn.microsoft.com/en-in/windows/wsl/wsl-config#wslconf