Steps to Start Automatically When WSL Starts

  1. Edit .bashrc or .profile: Open the .bashrc file in your home directory:

    nano ~/.bashrc
    
  2. Add the Start Command: Add the following lines at the end of the file:

    /dev/null 2>&1 & fi
    • The pgrep -f 'webui.sh' ensures it doesn’t start multiple instances if it's already running.
  3. Save and Exit: Save the file (Ctrl + O, then Enter) and exit (Ctrl + X).
  4. Apply Changes: Reload the .bashrc file to apply changes immediately:

    source ~/.bashrc
    

How It Works: