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

Pihole not installing correctly #68

Closed swaggyboi closed 1 year ago

swaggyboi commented 1 year ago

image Its prob something im doing wrong but i dont get why its not installing correctly. When I continue with the installation it closes and attempts to run the site but it says it cant be reached.

DesktopECHO commented 1 year ago

I see something weird... your IP and interface info aren't being picked up, like so: image

swaggyboi commented 1 year ago

I live in the US, there should be no restrictions here. Tried disabling an NIC and didn't work. Thank you for the suggestions tho!

swaggyboi commented 1 year ago

I see something weird... your IP and interface info aren't being picked up, like so: image

  • If you are from a region with restricted Internet access, try changing the discovery beacon on line 63 and 64 from Quad9 to something closer to home.
  • If you have 2 NICs try disabling one, then uninstall/reinstall.
  • Out of other ideas for the moment... that detection code hasn't been messed-with in ages and it has always worked great!

Hey so I tried installing pihole on an older computer running the same OS i have on this, (windows 10) and i encountered the same issue. Is it something with my router?

DesktopECHO commented 1 year ago

Certainly sounds that way... Try this:
Change lines 63 and 64 of PH4WSL1.CMD from 9.9.9.9 to the IP of your router.
Un-install and re-run the modified script.

swaggyboi commented 1 year ago

Certainly sounds that way... Try this: Change lines 63 and 64 of PH4WSL1.CMD from 9.9.9.9 to the IP of your router. Un-install and re-run the modified script.

Tried and got the same results, is there anything else i could try? Thank you for your help up until now btw.

DesktopECHO commented 1 year ago

Just tried on a test machine to be sure.... no issues.

image

Try this: Line 67 and 68 are as follows: %GO% "echo IPV4_ADDRESS=%IPC% >> /etc/pihole/setupVars.conf" %GO% "echo PIHOLE_INTERFACE=%IPF% >> /etc/pihole/setupVars.conf"

Enter your machine's IP, for my example it's 192.168.0.10 Change it like so: %GO% "echo IPV4_ADDRESS=192.168.0.10/24 >> /etc/pihole/setupVars.conf" %GO% "echo PIHOLE_INTERFACE=eth0 >> /etc/pihole/setupVars.conf"

...Then uninstall and re-run the modified script.

If that doesn't work, only other thing I can suggest for the moment is to run the "Reconfigure" utility here: C:\Program Files\Pi-hole\Pi-hole Configuration.cmd

swaggyboi commented 1 year ago

The reconfig util crashes on startup and i tried replacing lines 67 and 68 as you said but got the same results.

DesktopECHO commented 1 year ago

Open a command prompt and run: wsl -d Pi-hole Then run the interface detection lines manually:

IPC=$(ip route get 9.9.9.9 | grep -oP 'src \K\S+') ; IPC=$(ip -o addr show | grep $IPC) ; echo $IPC | sed 's/.*inet //g' | sed 's/\s.*$//'

IPF=$(ip route get 9.9.9.9 | grep -oP 'src \K\S+') ; IPF=$(ip -o addr show | grep $IPF) ; echo $IPF | sed 's/.*: //g' | sed 's/\s.*$//'

...and let me know the output.

swaggyboi commented 1 year ago

image am 99% sure im doing something wrong

DesktopECHO commented 1 year ago

Are you able to set WSL1 as default: wsl --set-default-version 1

Then try to install Debian from the Microsoft store. https://apps.microsoft.com/store/detail/debian/9MSVKQC78PK6

Then in Debian try interface detection: IPC=$(ip route get 9.9.9.9 | grep -oP 'src \K\S+') ; IPC=$(ip -o addr show | grep $IPC) ; echo $IPC | sed 's/.*inet //g' | sed 's/\s.*$//'

IPF=$(ip route get 9.9.9.9 | grep -oP 'src \K\S+') ; IPF=$(ip -o addr show | grep $IPF) ; echo $IPF | sed 's/.*: //g' | sed 's/\s.*$//'

swaggyboi commented 1 year ago

Are you able to set WSL1 as default: wsl --set-default-version 1

Then try to install Debian from the Microsoft store. https://apps.microsoft.com/store/detail/debian/9MSVKQC78PK6

Then in Debian try interface detection: IPC=$(ip route get 9.9.9.9 | grep -oP 'src \K\S+') ; IPC=$(ip -o addr show | grep $IPC) ; echo $IPC | sed 's/.*inet //g' | sed 's/\s.*$//'

IPF=$(ip route get 9.9.9.9 | grep -oP 'src \K\S+') ; IPF=$(ip -o addr show | grep $IPF) ; echo $IPF | sed 's/.*: //g' | sed 's/\s.*$//' image

DesktopECHO commented 1 year ago

That worked. Ok, try to download and run the script from the repo:

PowerShell -c "Invoke-Webrequest https://raw.githubusercontent.com/DesktopECHO/Pi-Hole-for-WSL1/master/PH4WSL1.cmd -OutFile PH4WSL1.cmd ; .\PH4WSL1.CMD"

Any luck?

swaggyboi commented 1 year ago

That worked. Ok, try to download and run the script from the repo:

PowerShell -c "Invoke-Webrequest https://raw.githubusercontent.com/DesktopECHO/Pi-Hole-for-WSL1/master/PH4WSL1.cmd -OutFile PH4WSL1.cmd ; .\PH4WSL1.CMD"

Any luck?

no luck image

DesktopECHO commented 1 year ago

What's the output from: CMD /C VER and wslconfig /l and wsl -d Pi-hole

swaggyboi commented 1 year ago

image

DesktopECHO commented 1 year ago

That is so weird... your machine tells us Pi-hole is installed.
But you try to access it, and it says it can't find it.

What does LXrunOffline make of this mess? What's the output from: CMD /C "C:\Program Files\Pi-hole\LxRunOffline.exe" r -n Pi-hole

swaggyboi commented 1 year ago

huhhhhh image

DesktopECHO commented 1 year ago

Wow. That is... not what I was expecting.
Sorry no idea what's happening here...

DesktopECHO commented 1 year ago

Just for fun you can try uninstalling the instance in C:\Program Files and install to C: (It will install to C:\Pi-hole) May work, but there is still something wrong with your OS by the looks of it.

swaggyboi commented 1 year ago

Just for fun you can try uninstalling the instance in C:\Program Files and install to C: (It will install to C:\Pi-hole) May work, but there is still something wrong with your OS by the looks of it.

I'm running windows 10 Home and tried it with an older computer that uses win 10 home as well

DesktopECHO commented 1 year ago

Uninstall the existing instance in C:\Program Files and install to C:\ instead. Then you can try: CMD /C "C:\Pi-hole\LxRunOffline.exe" r -n Pi-hole

DesktopECHO commented 1 year ago

Also, verify that LongPathsEnabled =1

PowerShell -c 'Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled"'

swaggyboi commented 1 year ago

Also, verify that LongPathsEnabled =1

PowerShell -c 'Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled"'

LongPathEnables = 0 for some reason image Just changed it to 1 in reg edit

DesktopECHO commented 1 year ago

Are these machines 'clean' Windows 10 Home installs? As opposed to upgraded from Windows 7/8

You can also try installing to C:\ProgramData instead of C:\Program Files to see if it's the space character causing the issue.

swaggyboi commented 1 year ago

C:\ProgramData

Downgraded from Win 11 on this computer and other computer has been on win 10 only

DesktopECHO commented 1 year ago

Did you try installing to C:\ProgramData or C:\ and if so what was the outcome?

swaggyboi commented 1 year ago

Did you try installing to C:\ProgramData or C:\ and if so what was the outcome? image

:/

DesktopECHO commented 1 year ago

Can you try dir c:\ProgramData to confirm you have that folder? Uninstall the previous attempt and try C: instead.

swaggyboi commented 1 year ago

image Tried C: came out the same way

DesktopECHO commented 1 year ago

Sorry mate, not sure what else I can recommend.

I downloaded the Windows Meda Creator and made a Windows 10 ISO. Just a few moments ago I did a clean install to a virtual machine -- No issues

image

I think you'll need a clean install as well.

swaggyboi commented 1 year ago

Sorry mate, not sure what else I can recommend.

I downloaded the Windows Meda Creator and made a Windows 10 ISO. Just a few moments ago I did a clean install to a virtual machine -- No issues

image

I think you'll need a clean install as well.

Okay what the fuck it works now that i have a VM lol image

DesktopECHO commented 1 year ago

Cool! This kind of re-affirms that something is screwy with your existing Windows 10 instal(s)

swaggyboi commented 1 year ago

Thank you so much for bearing with my stupidity lol