Skip to content

Commit

Permalink
feat(kali-linux-wsl): update editing of wsl.conf file
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris1320 committed Oct 5, 2024
1 parent 597da2b commit 3c91fe1
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions Operating Systems/WSL/Kali Linux WSL.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,22 @@ sudo apt update
sudo apt upgrade
```

I always change my WSL distro's hostname, so I use the following command to change it. Replace `edgeRunner` with a name that you like to use as the machine's hostname.
Edit the `/etc/wsl.conf` file according to your needs. You can see the documentation here: [Advanced settings configuration in WSL | Microsoft Learn](https://learn.microsoft.com/en-us/windows/wsl/wsl-config)

```bash
printf "[network]\nhostname = edgeRunner\ngenerateHosts = false\n" | sudo tee /etc/wsl.conf
```toml
[boot]
systemd = true

[automount]
enabled = true

[network]
hostname = edgeRunner
generateHosts = false

[interop]
enabled = false
appendWindowsPath = false
```

After changing the hostname via `wsl.conf`, you now have to update the `hosts` file. Open it and change all occurences of the old hostname with the new hostname you've chosen.
Expand Down

0 comments on commit 3c91fe1

Please sign in to comment.