0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

WSL2環境でsystemctlを使えるようにする方法

Last updated at Posted at 2023-01-28

環境

OS:Oracle Linux 8.7

問題

WSL2環境内でSystemctlを使おうとすると、以下のエラーが発生する。

System has not been booted with systemd as init system (PID 1). Can't operate.

genieをインストールして問題を解決しようとしたが、なにせOSがUbuntuじゃないから、なんやかんやで上手くいかなかった。
私は英語も読めないし書いてある内容がさっぱり分からないので、とりあえず適当に調べて解決した物を備忘録として残しておく。

解決策

/etc/wsl.confを作成し、以下の内容を入力。

[boot]
systemd=true

再起動したらsystemctlが使えるようになった。

[root@THIS_IS_MYPC I_AM_USER]# systemctl status telnet.socket
● telnet.socket - Telnet Server Activation Socket
   Loaded: loaded (/usr/lib/systemd/system/telnet.socket; enabled; vendor preset: disabled)
   Active: active (listening) since Sat 2023-01-28 17:22:15 JST; 8min ago
     Docs: man:telnetd(8)
   Listen: [::]:23 (Stream)
 Accepted: 0; Connected: 0;
    Tasks: 0 (limit: 26213)
   Memory: 8.0K
   CGroup: /system.slice/telnet.socket

Jan 28 17:22:15 THIS_IS_MYPC systemd[1]: Listening on Telnet Server Activation Socket.
[root@THIS_IS_MYPC I_AM_USER]#

参考サイト

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?