1

I'm running some servers on my Ubuntu instance on WSL through windows 11. For those servers to run, I need to mount a hard drive, which i do with the command

wsl --mount //./PHYSICALDRIVE0

The above command needs to be run from the PowerShell as Administrator
After that i need to launch my default instance

Is there a way to automate this process so it happens silently when i boot windows?

1 Answers1

4

Using the windows task scheduler, create a new task, and tell it to:

  • run at startup in the scheduling settings
  • run as administrator (with highest privileges)
  • run even if user is not logged in,

set it to launch a program: powershell.exe with arguments -C wsl --mount //./PHYSICALDRIVE0

Cpt.Whale
  • 10,914