Linux

WSL2 Ubuntu 시작 시 /var/run/utmp 파일을 생성하지 않음

Segel 2021. 3. 13. 04:03

WSL2에서 Ubuntu를 시작할 때 /var/run/utmp 파일을 생성하지 않아 who 등의 명령이 정상적으로 출력되지 않는다.

 

해결:

login 명령을 직접 실행해준다.

 

wsl sudo bash -c "echo '[1] [00049] [~~ ] [runlevel] [~ ] [4.4.0-17115-Micoroso] [0.0.0.0 ] [Wed Feb 28 13:27:14 2018 STD]' | utmpdump -r > /var/run/utmp" ;

wsl sudo login -f 사용자명

두 명령을 통해 시작한다.

github.com/microsoft/WSL/issues/573#issuecomment-638455153

 

/init does not create /var/run/utmp · Issue #573 · microsoft/WSL

An empty (0 bytes) /var/run/utmp file should be created by /init This would help with certain failures and/or warning messages of various programs (not only /bin/who). My current workaround: Use &#...

github.com

 

반응형