WSL with GUI - anyway to get the IP automatically on start up


Well-known member
Power User
Local time
1:44 PM
Hafnarfjörður IS
Windows XP,7,10,11 Linux Arch Linux
Hi folks
I've got the WSLnow down to a fine art -- only 2 problems left

1) have to manually start after the WSL disto starts is the command : genie -t (which starts the systemd services)
2) Hostname -I to get the IP address (usally 172.x.x.x) as it changes on each boot.

Then one can connect via RDP with that address ( or vnc client if you prefer-- its easier using RDP though for local network) -- ensure xrdp is installed in the distro as well as the tigervncserver (as per documentation)

what would be nice would be to convert say the IP address into a computer nam on startup so one could enter the computer name every time in the rdo logon screen without worrying what the IP address is --- any ideas anyone. Remember also to follow the documentation to use xvnc rather than xorg - failing to do that and the whole kybosh won't work. It's in the documentation so no problems.

Automating the genie -t command isn't a problem -- but automating the IP address is -- OK it's not a big deal but it just "looks a bit amateur" having to enter a load of commands to start this process.

Note also when shutting down -- shut down the system properly from the console type : init 0 befor using the wsl distro -t to terminate the wsl to avoid "breaking" the system -- i.e it shuts down cleanly.

Don't forget also you can copy / move images between machines and W10/W11 releases simply via wsl --export and wsl --import commands. If running wsl2 ensure you'e installed the kernel update from the Ms site and set the default wsl version to 2.


My Computer

System One

  • OS
    Windows XP,7,10,11 Linux Arch Linux
    Computer type
    2 X Intel i7

Latest Support Threads

Latest Tutorials

Top Bottom