sudo hostname XYZ does not seems to work in WSL.
I recently reinstalled Windows 10 and my wsl hostname is DESKTOP-XXXXXX. I'm trying to change it to something else. I tried the following:
sudo hostname wsl
I also changed /etc/hostname
to "wsl" and changed /etc/hosts
to "127.0.1.1 wsl.localdomain wsl".
Every time I restart WSL, it resets the hostname to the windows name. How do I change the wsl hostname permanently?