Changing the hostname on WSL2
Edit /etc/wsl.conf in the WSL2: Add these lines (i.e. changing hostname to “PC”). generateHosts = false to disable WSL to auto generate /etc/hosts. Edit /etc/hosts to match with the configured hostname. Close all WSL terminals, and open a Command Prompt (not WSL terminal). Note: shutdown nor reboot won’t work on WSL: Open a WSL terminal, […]