본문 바로가기
Server

__wsl2 에서 systemctl 사용하기__

by 동기 2023. 1. 8.
반응형

설치

sudo apt install git
cd ~
git clone https://github.com/DamionGans/ubuntu-wsl2-systemd-script.git

cd ubuntu-wsl2-systemd-script/

bash ubuntu-wsl2-systemd-script.sh

# wsl 재시작 후
systemctl

wsl 시작할 때마다 systemctl 활성화 하기

sudo cp ~/ubuntu-wsl2-systemd-script/ubuntu-wsl2-systemd-script.sh /systemd-script.sh
sudo chmod +x /systemd-script.sh

설정 후 window terminal setting.json에서 wsl2 시작 commandline을 다음과 같이 설정한다.

"commandline": "wsl.exe /systemd-script.sh -d Ubuntu-20.04"

wsl을 재시작해도 systemctl이 활성화 된다.

반응형

'Server' 카테고리의 다른 글

SFTP 설정  (0) 2024.02.01
[Ubuntu] SSL인증서 발급 | 갱신  (1) 2023.12.27
vmware ESXi  (0) 2022.10.02
CPU 과다 점유 이슈  (0) 2022.09.09
톰캣 다중 설정  (0) 2022.08.31

댓글