DesktopECHO / Pi-Hole-for-WSL1

Ad-blocking DNS server for Windows • Unbound pre-configured • Deployment ready in minutes • Does not require hypervisor/docker
349 stars 53 forks source link

Since updating to 22H2, pihole doesn't autostart #74

Closed seanbperiod closed 1 year ago

seanbperiod commented 1 year ago

I have it set in task scheduler but it still doesn't seem to autostart, and I have to manually start it..

What's the best way to reset this.. just reinstall pihole?

DesktopECHO commented 1 year ago

You can do a re-install or try this first:

Try deleting the scheduled task:

SCHTASKS /Delete /TN:"Pi-hole for Windows"

...and re-create it:

SCHTASKS /CREATE /RU SHENRON\mydomainusername /RL HIGHEST /SC ONSTART /TN "Pi-hole for Windows" /TR 'C:\Program Files\Pi-hole Launcher.cmd'

Then:

Then enter your password and see if it sticks. Also worth mentioning your account needs a login password set (no blank passwords allowed)

DesktopECHO commented 1 year ago

You may also need KB5018496

seanbperiod commented 1 year ago

Thanks!

Already have KB5018496 installed.

After the second command, I got: ERROR: No mapping between account names and security IDs was done.

I assume I need to replace mydomainusername? but I tried entering my Windows user name, but I got the same error.

DesktopECHO commented 1 year ago

Yeah it looks like it's not recognizing your username; I was able to re-create this by using a bad username and then retrying it works with a valid user -- See below:

image

seanbperiod commented 1 year ago

Got it 👍

Just restarted, and it's still not auto-running.

Shall I try uninstall/reinstall? Any other way to diagnose?

Also, when I try to manually run it, by hitting the run button, it doesn't do anything either.

DesktopECHO commented 1 year ago

You can uninstall/reinstall.. but I suspect you'll have the same issue, unless the Pi-hole installation is messed up as well.

Does Pi-hole run manually when you open Pi-hole Launcher? (It's in the install folder)

Maybe try creating your own scheduled task and see if that runs, to determine if it's an issue with Windows in general or specific to this Pi-hole install.

seanbperiod commented 1 year ago

Yes, I'm able to run it from the Launcher fine.

One thing I noticed is that it was trying to Launch directly from the Program Files directory, and not the Pi-Hole directory. I updated that, but it still doesn't run at startup.

I added a new trigger to run at logon, and that seems to be working for the time being. Not really an issue otherwise, but interesting that this happened 🤷‍♂️ 👍

DesktopECHO commented 1 year ago

Cool, well that's good to hear at least. If that suffices for you then all's well, just means no Pi-hole until you're logged-in.

Will def keep an eye open for other reports like this... my 22H2 boxes aren't seeing this issue but they're not upgrades from 22H1.

seanbperiod commented 1 year ago

I appreciate the help! And thanks for making this to begin with 👍 :)

ichxorya commented 1 year ago

I have tried to make it start after failure, and add more 5 tries if fail. It works for me!