![]() If no distributions are running, you will receive the response: "There are no running distributions." You can now restart the distribution to see your wsl.conf updates applied. You can check to see whether your Linux distribution (shell) is still running after closing it by using PowerShell with the command: wsl -list -running. You must wait ~8 seconds for the subsystem to stop before relaunching in order to give enough time for your changes to be picked up. This is not currently the case as the subsystem could still be running. You might assume that your changes to the wsl.conf file have immediately gone into effect. ![]() Ubuntu), modify the wsl.conf file, close the distribution, and then re-launch it. You must wait ~8 seconds as mentioned below in the document. Close Ubuntu and re-launch.Ĭhange will not reflect immediately. "DESKTOP-ABC222") and replace with new one (e.g. # The following lines are desirable for IPv6 capable hostsįind all occurences of hostname (e.g. To stop automatic generation of this file, add the following entry to /etc/wsl.conf:ġ27.0.1.1 DESKTOP-ABC222.localdomain DESKTOP-ABC222Ĥ4.99.0.122 You will see some entries similar to below # This file was automatically generated by WSL. Open /etc/hosts and update sudo nano /etc/hosts The hosts file contains a static map of hostnames corresponding IP address. Sudo: unable to resolve host SrcCodes: Name or service not known Otherwise, hosts file change will be overwritten during re-launch of Ubuntu and we'll get " unable to resolve host : Name or service not known" sudo apt update ![]() GenerateHosts = false will prevent WSL from automatic generation of /etc/hosts file. Hostname = SrcCodes will update the hostname in /etc/hostname. Open /etc/wsl.conf or create the same if it does not exist. Here, DESKTOP-ABC222 is hostname of Ubuntu running in my Windows 10 ( OS Build 19043.1083) WSL. Once hostname is changed, if you get " unable to resolve host : Name or service not known" then follow the step #4 for the fix. If you are running Ubuntu on Windows WSL ( Windows Subsystem for Linux) and wondering how to change hostname permanently then follow all steps mentioned below.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |