I recently reinstalled Windows 10 and my 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. How do I change the hostname permanently?
In Windows 10 Home 64-bit, Fall Creators Update edition (Version 1709, Build 16299.19) I used:
Settings
▸ System
▸ About
▸ Rename this PC
After that a restart is required.