shayne / go-wsl2-host

Automatically update your Windows hosts file with the WSL2 VM IP address
1.65k stars 140 forks source link

Doesn't work well as service. #79

Closed char-46 closed 1 year ago

char-46 commented 1 year ago

It only works on the command line wsl2host debug, not in the service. I tried versions 0.3.5 and 0.2.1 and they both had the same problem.

WSL version: 0.70.5.0 core version: 5.15.68.1 WSLg version: 1.0.45 MSRDC version: 1.2.3575 Direct3D version: 1.606.4 DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Windows version: 10.0.22621.755

iamqiz commented 1 year ago

我也发现wsl2host服务出问题了,索性用bash脚本实现更新,搞了两天,搞定 链接: iamqiz/bash-wsl2-host: bash script to Automatically update your Windows hosts file with the WSL2 VM IP address https://github.com/iamqiz/bash-wsl2-host

bayard commented 1 year ago

Wsl2host broken in latest update of windows 11 (Only work in debug mode, service mode result in wsl -l -v error and cannot obtain ip address of wsl.). I wrote a script in linux to complete the job, see: https://github.com/bayard/WSL2_UPDATE_HOSTS