Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No matter what I do, it won't run on startup? #81

Closed
matthew-dean opened this issue Dec 14, 2022 · 11 comments
Closed

No matter what I do, it won't run on startup? #81

matthew-dean opened this issue Dec 14, 2022 · 11 comments

Comments

@matthew-dean
Copy link

I've followed the instructions to startup PiHole on Windows 11 and checked / re-checked settings. In fact, Windows Task Scheduler says it's running.

However, it isn't. If I go into the Pi-Hole Configuration tool and reset or reconfigure pi-hole, then it works again. I double-check it, and yes, the admin interface is now accessible and working with DNS requests locally. However, with every Windows 11 restart, nope, it's dead again.

What am I not thinking of / need to try?

@matthew-dean
Copy link
Author

Oops, either I wasn't waiting long enough for all startup services or it resolved itself? 🤷‍♂️

@kevin01523
Copy link

for me it wont even run so i had to make a startup script for it an put it on the startup folder

@DesktopECHO
Copy link
Owner

Hi @kevin01523 I think you are running into an issue that affects anyone who upgraded to Windows 22H2 from 21H2. If you search '22h2 Scheduled Task broken' you will invariably be led to Windows 11 22H2 upgrade breaks "Run whether user is logged on or not" scheduled tasks (I jumped into the thread around page 12) but MS has not acknowledged this as an issue. :-/

If you recreate your user profile (or create a new user) and try to set the Scheduled Task to run at startup, it will likely work for you.

Also worth noting, if Windows was installed directly from 22H2 install media, the Scheduled Task runs at startup without issue.

@DesktopECHO DesktopECHO pinned this issue Mar 15, 2023
@kevin01523
Copy link

i had just tested this on a clean install of windows 11 22h2 pro and still fails but ill test it now on a fresh install of a 22h2 win 11 iot enterprise will now test on a blank password user as previous users do have passwords

@DesktopECHO
Copy link
Owner

Don't use a blank password, the scheduled task will not work without one set.

@kevin01523
Copy link

yeah realized it wont work lol. yeah and it seems that salsa.debian.org is down at the moment so i cant really reinstall and test it for now.

@DesktopECHO
Copy link
Owner

To deal with Salsa being down, you can change line 25:

POWERSHELL.EXE -Command "Start-BitsTransfer -Source https://salsa.debian.org/debian/WSL/-/raw/master/x64/install.tar.gz?inline=false -Destination '%TEMP%\%IMG%'" >NUL 2>&1

To:

POWERSHELL.EXE -Command "Start-BitsTransfer -Source https://github.com/DesktopECHO/Pi-Hole-for-WSL1/raw/cdf4465044cdfafbc1a0e0098cea5271a217d587/debian11.1b9e7597.tar.gz -Destination '%TEMP%\%IMG%'" >NUL 2>&1

@kevin01523
Copy link

yeah tested a bit it only affects the main local admin account the one you made during the fresh install of windows.
its always 0x1 as status
it seems that the user account doesn't have enough privileges to run it.
im not sure of install location does affect it like in root of C:.

@kevin01523
Copy link

i do suggest to make a alternative way to setup a startup task or script like what most common apps do

@DesktopECHO
Copy link
Owner

Getting it to run at automatically at boot is going to be a hassle thanks to this obscure bug. It only happens with user profiles upgraded from 21H2 to 22H2.

If Windows 10 or 11 is a clean 22H2 install from media, this problem doesn't appear. See: Windows 11 22H2 upgrade breaks "Run whether user is logged on or not" scheduled tasks for others with the exact same problem.

Actually, the scheduled task will work if you set the Trigger to run At log on and in the General tab select Run only when user is logged on - I might just make run at login the default moving forward.

@kevin01523
Copy link

yeah at log on works flawlessly and Run only when user is logged on is mostly needed if you use a standalone pc or a home server that doesn't need a user logged on which is a rare case or in a environment where it serves many devices.

i guess just include some warning that the pc must log on at least once in readme.md or faq
i do suggest add a fallback to the script incase salsa goes down i guess

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants