From 3c91fe1f0f1de9860e504bcd3e777747d1458af0 Mon Sep 17 00:00:00 2001 From: chris1320 Date: Sat, 5 Oct 2024 16:48:10 +0800 Subject: [PATCH] feat(kali-linux-wsl): update editing of `wsl.conf` file --- Operating Systems/WSL/Kali Linux WSL.md | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/Operating Systems/WSL/Kali Linux WSL.md b/Operating Systems/WSL/Kali Linux WSL.md index c8ad33e..b2d05f8 100644 --- a/Operating Systems/WSL/Kali Linux WSL.md +++ b/Operating Systems/WSL/Kali Linux WSL.md @@ -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.