shayne / go-wsl2-host

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

dont work #47

Open dev1234567 opened 3 years ago

dev1234567 commented 3 years ago

after installing ping ubuntu1804.ws dont work C:\Windows\System32\drivers\etc\hosts - nothing new Debug C:\wsl>.\wsl2host.exe debug wsl2host.info(1): starting wsl2host service panic: runtime error: invalid memory address or nil pointer dereference [signal 0xc0000005 code=0x0 addr=0x8 pc=0x50c352]

goroutine 1 [running]: github.com/shayne/go-wsl2-host/cmd/wsl2host/pkg/service.Run(0x5812a0, 0xc00002e570, 0x2, 0x0) /workspaces/go-wsl2-host/cmd/wsl2host/pkg/service/service.go:92 +0x742 github.com/shayne/go-wsl2-host/cmd/wsl2host/internal.(*windowserver).Execute(0x687be0, 0xc00002e590, 0x1, 0x1, 0xc00003e180, 0xc00003e1e0, 0xc00000c4c0) /workspaces/go-wsl2-host/cmd/wsl2host/internal/service.go:33 +0x523 golang.org/x/sys/windows/svc/debug.Run(0x554639, 0x8, 0x57fc20, 0x687be0, 0x0, 0x0) /go/pkg/mod/golang.org/x/sys@v0.0.0-20190626221950-04f50cda93cb/windows/svc/debug/service.go:40 +0x153 github.com/shayne/go-wsl2-host/cmd/wsl2host/internal.RunService(0x554639, 0x8, 0xc00000a001) /workspaces/go-wsl2-host/cmd/wsl2host/internal/service.go:81 +0x1bf main.main() /workspaces/go-wsl2-host/cmd/wsl2host/main.go:42 +0x384

rbreaves commented 3 years ago

Same issue.

.\wsl2host.exe debug
wsl2host.info(1): starting wsl2host service
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x8 pc=0x50c352]

goroutine 1 [running]:
github.com/shayne/go-wsl2-host/cmd/wsl2host/pkg/service.Run(0x5812a0, 0xc000088560, 0x2, 0x0)
        /workspaces/go-wsl2-host/cmd/wsl2host/pkg/service/service.go:92 +0x742
github.com/shayne/go-wsl2-host/cmd/wsl2host/internal.(*windowserver).Execute(0x687be0, 0xc000088580, 0x1, 0x1, 0xc000086180, 0xc0000861e0, 0xc00009e2c0)
        /workspaces/go-wsl2-host/cmd/wsl2host/internal/service.go:33 +0x523
golang.org/x/sys/windows/svc/debug.Run(0x554639, 0x8, 0x57fc20, 0x687be0, 0x0, 0x0)
        /go/pkg/mod/golang.org/x/sys@v0.0.0-20190626221950-04f50cda93cb/windows/svc/debug/service.go:40 +0x153
github.com/shayne/go-wsl2-host/cmd/wsl2host/internal.RunService(0x554639, 0x8, 0xc0000a0001)
        /workspaces/go-wsl2-host/cmd/wsl2host/internal/service.go:81 +0x1bf
main.main()
        /workspaces/go-wsl2-host/cmd/wsl2host/main.go:42 +0x384