Skip to content

Latest commit

 

History

History
7 lines (7 loc) · 993 Bytes

README.md

File metadata and controls

7 lines (7 loc) · 993 Bytes

Launch WSL2 at startup and setup SSH port forwarding

Setup

  1. In run_wsl2-at_startup.ps1, replace Ubuntu-20.04 with your distribution name.
  2. In run_wsl2-at_startup.ps1, replace $windows_port = 6022 with your desired port for exposing ssh server from wsl2
  3. In runner.vbs, replace C:\Users\cchi\dev\wsl_network\PsExec.exe and C:\Users\cchi\dev\wsl_network\run_wsl2_at_startup.ps1 with the actualy path to your copy of this repo.
  4. In task scheduler, setup a task following this tutorial, but action to execute their run_wsl2_at_startup.vbs with the path to runner.vbs in this repo.
  5. Run the task manually in task scheduler and check the content of stderr.txt and stdout.txt (created by the run_wsl2_at_startup.ps1) for error. Ideally, both of these files should be empty.