wsl:: wsl에서 systemctl 실행 설정

ERROR Message

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

 

wsl에서는 systemctl을 기본적으로 사용할 수 없어, 아래처럼 추가 설정을 해야 사용이 가능하다.

 

윈도우/리눅스 멀티부팅이 아니라 기본적으로 window를 main server로 사용하고 ubuntu의 service도 같이 사용하려면 윈도우 시작시 리눅스 서비스도 같이 실행해야 하기 때문에 systemctl 명령어 활성화가 필요하다 

 

 

# git install
sudo apt install git


# WSL2 regist Script clone

git clone https://github.com/DamionGans/ubuntu-wsl2-systemd-script.git
cd ubuntu-wsl2-systemd-script/
bash ubuntu-wsl2-systemd-script.sh
# Enter your password and wait until the script has finished


# restart WSL window and Check status
systemctl


#

 

 

 

https://github.com/DamionGans/ubuntu-wsl2-systemd-script

 

GitHub - DamionGans/ubuntu-wsl2-systemd-script: Script to enable systemd support on current Ubuntu WSL2 images [Unsupported, no

Script to enable systemd support on current Ubuntu WSL2 images [Unsupported, no longer updated] - GitHub - DamionGans/ubuntu-wsl2-systemd-script: Script to enable systemd support on current Ubuntu ...

github.com

 

 

 

 

 

=end

반응형