Giter VIP home page Giter VIP logo

pi-hole-for-wsl1's Introduction

PH4WSL1.cmd  ·  Pi-hole for Windows

image

Install script to help Pi-hole run semi-natively under Windows 10/11 and Server 2019/2022 by leveraging the Windows Subsystem for Linux, renamed later to WSL1. Because WSL1 does not require a hypervisor and full Linux kernel it's the most lightweight way to run Pi-hole on Windows. Pi-hole and associated Linux binaries are visible in Task Manager right alongside your Windows apps (See Windows 11 screenshot above.)

Latest Updates for 2022-06-24

  • Gravity Sync lets you easily synchronize multiple Pi-hole instances. Run Gravity Sync.cmd and copy/paste the command into the console of another Debian or Ubuntu-based Pi-hole.
  • Less Pi-hole code is patched since upstream moved from lsof to ss for port and service checking. Now a wrapper for ss on WSL1 reformats the output of netstat.exe into something Pi-hole can work with.
  • Integrated Unbound DNS Resolver and set the default Pi-hole configuration to use encrypted DNS.
  • Updated to Debian 11
  • Fixes for Windows 11 compatibility
  • Added links in the install folder for Pi-hole System Update.cmd, Pi-hole Gravity Update.cmd, and Pi-hole Web Admin.cmd
  • Debian updates regularly with unattended-upgrades

Note

There is no endorsement or partnership between this page and Pi-hole© LLC. They deserve your support if you find this useful.

Pi-hole for Windows can be used to block ads and encrypt DNS queries for your local Windows PC or entire network. If you use it to serve DNS for your entire network, it's highly recommended you install a second Pi-hole instance on your network, and enable Gravity Sync to ensure DNS is constantly available should your Windows PCs need to reboot for any reason.

Pi-hole for Windows is a great way to upcycle old hardware. If you have a Windows PC, tablet, or HDMI stick with 1GB RAM and it can boot Windows 10 x64 you are good to go. If you don't have a Windows license, Hyper-V Server 2019 works and is a free download from Microsoft.

INSTALL INSTRUCTIONS

  1. Download the installer script -> PH4WSL1.cmd
  2. Right click the file and select "Run as Administrator."

Download and configuration steps complete in 2-15 minutes, depending on your hardware and antivirus solution. If Windows Defender is active the installation will take longer. Some users have reported issues with other antivirus products during installation.

This script performs the following steps:

  1. Enable WSL1 and install a Debian-supplied image from salsa.debian.org
  2. Download the LxRunOffline distro manager and install Debian 11 (Bullseye) in WSL1
  3. Perform interface/gateway detection and create a /etc/pihole/setupVars.conf file for automated install
  4. Run the official installer from Pi-hole©
  5. Create shim so Pi-hole gets the expected output from /bin/ss along with other fix-ups for WSL1 compatibility.
  6. Add exceptions to Windows Firewall for DNS and the Pi-hole admin page

NOTE

After the install completes, the Scheduled Task needs to be configured for auto-start at boot (before logon).

  1. Open Windows Task Scheduler (taskschd.msc) and right-click the Pi-hole for Windows task, click edit.
  2. On the General tab, place a checkmark next to both Run whether user is logged on or not and Hidden
  3. On the Conditions tab, un-check the option Start the task only if the computer is on AC power

Additional Info

  • DHCP Server is not supported and is disabled in the Pi-hole Web UI.

  • IPv6 DNS now works in addition to IPv4.

  • Default location for Pi-hole install is C:\Program Files\Pi-hole. This folder contains utilities to update or modify your Pi-hole:

  • To completely uninstall Pi-Hole, open the Pi-hole install folder in Windows Explorer. Right-click Pi-hole Uninstall.cmd and click Run As Administrator. If you are uninstalling or reinstalling and need to retain your Pi-hole's configuration, export it first via the Pi-hole Teleport feature located in the web interface.

Screenshots

Installer run

image

Install Complete

Install Complete

Install Folder Contents

Install Folder

pi-hole-for-wsl1's People

Contributors

desktopecho avatar digitalcontemplation avatar dyras avatar salhernandez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pi-hole-for-wsl1's Issues

Readme ends abruptly

Hi, what do you do after running the executable? I assume you proceed with installation normally, but I'm not sure what that is because this is my first exposure to Pi-Hole. Maybe a link to another setup guide would be good

Pi breaks down after every restart

Hi! Happy to see Pi-Hole on Windows. Straightforward setup, easy to use.

So, installation goes exactly as described. Pi-Hole admin tab pops up and everything's working fine. Then after the first restart, it stops working. Admin tab can't be opened and I have to run Pi-hole Configuration.cmd. Repair. It repairs it in 30 seconds, Pi-Hole admin tab pops up again and everything's ok. Until the next restart...

While it's working cron & atd processes are using 14% of CPU each. That seems pretty high to me.
My setup is: WIN10 Pro, Ver. 1903, Build 18362.836.
Machine: Intel Core i7-9750H CPU @ 2.60GHz (6 cores), 16Gb RAM

i dont have Pi-hole for Windows option on task sheduler?

i did everything and it is working. but i dont have Pi-hole for Windows option and i tryed to reboot my pc to see how it works and of course it was not working and no Pi-hole for Windows option.

btw it is my main pc i want to use it only on my pc...

Not an Issue - question

Will you implement the task to be scheduled automatically after installation? Is this something I can help test? :D

Revert all changes of script.

Hi, is there a way to revert all changes the script made? Once I ran it, I had no internet access and am unable to resolve the internet access issue with the built in Windows troubleshooter or looking at network adapters and seeing any obvious issues there.

WSL2 support?

With WSL2 being public and widely received as of now, has anyone gotten this to work on WSL2?

Would running a newer version of PH4WSL1.cmd upgrade the system?

I used PH4WSL1.cmd a year and change ago. The installation has worked great. I checked today and there's several changes I'm interested in the newer versions. I am not sure how to go about getting them without overwriting the current installation, though.

On one side there's the install mechanism (PH4WSL1.cmd) which would be overwritten. No mention is made of it being used to upgrade (I may be missing it elsewhere than the README).

Then there's the mechanism for upgrading pihole and WSL (as outlined in a couple of comments, but not in the README that I can see):

Run the Pi-hole updater:
"C:\Program Files\Pi-hole\LxRunOffline.exe" r -n Pi-hole -c "pihole -up"

Then install the WSL fix-ups, run:
"C:\Program Files\Pi-hole\Pi-hole Configuration.cmd"

Select "Repair"

And there're the uninstall instructions (Pi-hole Uninstall.cmd as admin), in the README.

I can't find how should a newer PH4WSL1.cmd be used to include the newer settings on a running installation.

Could I just download it and rerun and it will understand an existing installation is in place and only add the changes (for example encrypted DNS)?

can we get uninstall instructions

I decided Pihole isn't for me. I'd love to understand how to uninstall it and remove any configuration changes it made, specifically the installation of Debian linux? Can a short guide me added to the end of the readme?

[Bitdefender] Antivirus struggles

Hi,

thanks for your work, this script really helped a lot.

My Bitdefender anti-virus stopped the script half way for "suspicious behaviour" before the uninstall script was installedl. This led to a bit of work to manually revert to the original state, because simply using the install skript would cause it to immediately crash.

If you could add a warning to maybe deactivate anti-virus beforehand, that'd be great.

Thanks again, and keep it up
greetings

Revert all changes done by script.

Hi, is there a way to revert all changes the script made? Once I ran it, I had no internet access and am unable to resolve the internet access issue with the built in Windows troubleshooter or looking at network adapters and seeing any obvious issues there.

DNS settings after script install without docker etc

Hi DesktopECHO,

Your PH4WSL1.cmd script was just what I needed. Thank you SO much!

It Worked!

No having to learn about distros, docker, hyperV, Virtualbox - just run the script, it does everything. Which it did. The only hassle is I can't find how to set the Pihole as the DNS server on my particular setup. All of googles replies are about setting routers, or Docker, or HyperV, etc.

My setup

  1. I have only one Win 10 Pro desktop, which I use to run Anaconda, surf the net, play various Steam games on, named ZEN

  2. I use my mobile phone hotspot to connect to the internet, ie there is no router.

    (ZEN/Browser) ---> (ZEN/Wireless LAN adapter WiFi) ---> (Android/Hotspot)
    

and I want to change it to

  (ZEN/Browser) ---> (ZEN/WSL/PiHole) ---> (ZEN/Wireless LAN adapter WiFi) ---> (Android/Hotspot)

PiHole Setup Works

I have run your script and pihole tells me it is running

PIHOLE DNS

  • ii. If I open Powershell and type wsl, I get "root@ZEN:/mnt/c/Users/User#"

  • iii. It reports Pi-hole as the version of linux installed
    PIHOLE running

But it's not logging/blocking anything

Data Flow

I know that the normal setup is
PC ---> Router ---> Internet

and that one sets up PiHole as the DNS on the router so that the flow is
PC request --> Router --> Pihole --> (either block or send upstream eg Google)

but without a router, I can't get my head around, setting this flow up
PC request --> WSL--> Pihole --> (either block or send upstream eg Google)

Attempts

I tried setting the Wifi card as static DNS and it connected, no internet (it no longer worked).
Win 10 troubleshooter set it back to DHCP and it worked again.

Request

What I'm looking for is literally a set of steps to achieve PiHole between the PC and the hotspot.
It would be nice to know what the flow is when the Win 10 PC making the request is the same PC hosting PiHole on WSL and the internet has no router just a USB wifi dongle receiving from an Android 10 mobile?

ie (ZEN/Chrome) ---> (ZEN/WSL/PiHole) ---> (ZEN/Wireless LAN adapter WiFi) ---> (Android/Hotspot)

It may help if you added this knowledge to the end of your writeup on PH4WSL1.cmd. There are bound to be others like me needing a quick n easy way.

(Pardon the rambling issue description - I used to be a software developer but then I had a burnout and I cannot follow simple instructions any more, so things like MAN pages and PiHole's own documentation blow my mind. After reading that I'd have to have another licence to run windows inside HyperV just about made me give up, then I found your page)

Cannot run Pi-hole on my mini PC

3 Months ago, I installed Pi-hole, and it was running like a dream.
Today, after upgrading my mini pc drive, and tried to reinstall Pi-hole, I got the following error message:
Here is the script:


Pi-hole for Windows v.20220128
-------------------------------- Set location for 'Pi-hole' install folder or hit enter for default [C:\Program Files] -> Pi-hole will be installed in "C:\Program Files\Pi-hole" and Web Admin will listen on port 80 Press any key to continue . . . Downloading packages . . . Start-BitsTransfer : The server did not return the file size. The URL might point to dynamic content. The Content-Length header is not available in the server's HTTP reply. At line:1 char:1 + Start-BitsTransfer -Source https://github.com/DesktopECHO/Pi-Hole-for ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [Start-BitsTransfer], Exception + FullyQualifiedErrorId : StartBitsTransferCOMException,Microsoft.BackgroundIntelligentTransfer.Management.NewBits TransferCommand Expand-Archive : The path 'PH4WSL1.zip' either does not exist or is not a valid file system path. At line:1 char:133 + ... Destination PH4WSL1.zip ; Expand-Archive 'PH4WSL1.zip' -Force ; Remov ...

  •                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidArgument: (PH4WSL1.zip:String) [Expand-Archive], InvalidOperationException
    • FullyQualifiedErrorId : ArchiveCmdletPathNotFound,Expand-Archive

Remove-Item : Cannot find path 'C:\Program Files\Pi-hole\PH4WSL1.zip' because it does not exist.
At line:1 char:171

  • ... zip ; Expand-Archive 'PH4WSL1.zip' -Force ; Remove-Item 'PH4WSL1.zip'
  •                                             ~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : ObjectNotFound: (C:\Program Files\Pi-hole\PH4WSL1.zip:String) [Remove-Item], ItemNotFoun
      dException
    • FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.RemoveItemCommand

Expand-Archive : The path '.\PH4WSL1\Pi-Hole-for-WSL1-master\LxRunOffline-v3.5.0-33-gbdc6d7d-msvc.zip' either does not
exist or is not a valid file system path.
At line:1 char:1

  • Expand-Archive -Force -Path '.\PH4WSL1\Pi-Hole-for-WSL1-master\LxRunO ...
  •   + CategoryInfo          : InvalidArgument: (.\PH4WSL1\Pi-Ho...dc6d7d-msvc.zip:String) [Expand-Archive], InvalidOpe
     rationException
      + FullyQualifiedErrorId : ArchiveCmdletPathNotFound,Expand-Archive
    
    
    

This will take a few minutes to complete . . .
Installing Debian -> Compacting install The system cannot find the path specified.
-> Install dependencies . . .
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.

Launching Pi-hole installer...

The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the file specified.
The system cannot find the path specified.

SUCCESS: The scheduled task "Pi-hole for Windows" has successfully been created.

NOTE Additional configuration steps are required
for Pi-hole to start automatically at boot time.

   - Open Windows Task Scheduler (taskschd.msc)
     Right-click the task "Pi-hole for Windows" and click "Edit"

   - On the General tab, place a checkmark next to both
     "Run whether user is logged on or not" and "Hidden"

   - On the Conditions tab, un-check the option
     "Start the task only if the computer is on AC power"

Press any key to continue . . .

using wsl2 "/etc/resolv.conf" does not get generated under hyper-v with multiple interfaces

I found that it installs well on any win 10 PC where hyper-v is not active. But it does not work on a Hyper-v server or when win 10 pro has hyper-v active.
My assumption it has to do with the way wsl 2 starts up with hyper-v present.

This is the output:

--------------------------------
 Pi-hole for Windows v.20210522
--------------------------------

Set location for 'Pi-hole' install folder or hit enter for default [C:\Program Files] ->

Pi-hole will be installed in "C:\Program Files\Pi-hole" and Web Admin will listen on port 60080
Press any key to continue . . .

This will take a few minutes to complete...
Installing LXrunOffline.exe and Debian -> Compacting the install
W: Failed to fetch http://deb.debian.org/debian/dists/buster/InRelease  Temporary failure resolving 'deb.debian.org'
W: Failed to fetch http://deb.debian.org/debian/dists/buster-updates/InRelease  Temporary failure resolving 'deb.debian.org'
W: Failed to fetch http://security.debian.org/debian-security/dists/buster/updates/InRelease  Temporary failure resolving 'security.debian.org'
W: Failed to fetch http://ftp.debian.org/debian/dists/buster-backports/InRelease  Temporary failure resolving 'ftp.debian.org'
W: Some index files failed to download. They have been ignored, or old ones used instead.
-> Install dependencies
E: Unable to locate package gpg
E: Unable to locate package wget
E: Unable to locate package curl
E: Package 'ca-certificates' has no installation candidate
E: Unable to locate package libpcre2-8-0
E: Unable to locate package libpsl5
E: Unable to locate package openssl
E: Unable to locate package perl-modules-5.28
E: Couldn't find any package by glob 'perl-modules-5.28'
E: Couldn't find any package by regex 'perl-modules-5.28'
E: Unable to locate package libgdbm6
E: Unable to locate package libgdbm-compat4
E: Unable to locate package libperl5.28
E: Couldn't find any package by glob 'libperl5.28'
E: Couldn't find any package by regex 'libperl5.28'
E: Package 'perl' has no installation candidate
E: Unable to locate package libcurl3-gnutls
E: Unable to locate package liberror-perl
E: Unable to locate package git
E: Unable to locate package lsof
E: Unable to locate package unattended-upgrades
E: Package 'anacron' has no installation candidate
E: Unable to locate package inetutils-syslogd
E: Unable to locate package dns-root-data
E: Unable to locate package dnsutils
E: Unable to locate package gamin
E: Unable to locate package idn2
E: Unable to locate package libgamin0
E: Package 'lighttpd' has no installation candidate
E: Unable to locate package netcat
E: Unable to locate package php-cgi
E: Unable to locate package php-common
E: Unable to locate package php-intl
E: Unable to locate package php-sqlite3
E: Unable to locate package php-xml
E: Unable to locate package php7.3-cgi
E: Couldn't find any package by glob 'php7.3-cgi'
E: Couldn't find any package by regex 'php7.3-cgi'
E: Unable to locate package php7.3-cli
E: Couldn't find any package by glob 'php7.3-cli'
E: Couldn't find any package by regex 'php7.3-cli'
E: Unable to locate package php7.3-common
E: Couldn't find any package by glob 'php7.3-common'
E: Couldn't find any package by regex 'php7.3-common'
E: Unable to locate package php7.3-intl
E: Couldn't find any package by glob 'php7.3-intl'
E: Couldn't find any package by regex 'php7.3-intl'
E: Unable to locate package php7.3-json
E: Couldn't find any package by glob 'php7.3-json'
E: Couldn't find any package by regex 'php7.3-json'
E: Unable to locate package php7.3-opcache
E: Couldn't find any package by glob 'php7.3-opcache'
E: Couldn't find any package by regex 'php7.3-opcache'
E: Unable to locate package php7.3-readline
E: Couldn't find any package by glob 'php7.3-readline'
E: Couldn't find any package by regex 'php7.3-readline'
E: Unable to locate package php7.3-sqlite3
E: Couldn't find any package by glob 'php7.3-sqlite3'
E: Couldn't find any package by regex 'php7.3-sqlite3'
E: Unable to locate package php7.3-xml
E: Couldn't find any package by glob 'php7.3-xml'
E: Couldn't find any package by regex 'php7.3-xml'
E: Unable to locate package sqlite3
E: Unable to locate package unzip
E: Unable to locate package dhcpcd5
/bin/bash: wget: command not found
/bin/bash: wget: command not found
dpkg: error: cannot access archive './cloudflared-stable-linux-amd64.deb': No such file or directory
chmod: cannot access 'cloudflared': No such file or directory
mv: cannot stat 'cloudflared': No such file or directory
update-rc.d: error: unable to read /etc/init.d/cloudflared
/bin/bash: gpg: command not found
Usage: useradd [options] LOGIN
       useradd -D
       useradd -D [options]

Options:
  -b, --base-dir BASE_DIR       base directory for the home directory of the
                                new account
  -c, --comment COMMENT         GECOS field of the new account
  -d, --home-dir HOME_DIR       home directory of the new account
  -D, --defaults                print or change default useradd configuration
  -e, --expiredate EXPIRE_DATE  expiration date of the new account
  -f, --inactive INACTIVE       password inactivity period of the new account
  -g, --gid GROUP               name or ID of the primary group of the new
                                account
  -G, --groups GROUPS           list of supplementary groups of the new
                                account
  -h, --help                    display this help message and exit
  -k, --skel SKEL_DIR           use this alternative skeleton directory
  -K, --key KEY=VALUE           override /etc/login.defs defaults
  -l, --no-log-init             do not add the user to the lastlog and
                                faillog databases
  -m, --create-home             create the user's home directory
  -M, --no-create-home          do not create the user's home directory
  -N, --no-user-group           do not create a group with the same name as
                                the user
  -o, --non-unique              allow to create users with duplicate
                                (non-unique) UID
  -p, --password PASSWORD       encrypted password of the new account
  -r, --system                  create a system account
  -R, --root CHROOT_DIR         directory to chroot into
  -s, --shell SHELL             login shell of the new account
  -u, --uid UID                 user ID of the new account
  -U, --user-group              create a group with the same name as the user
  -Z, --selinux-user SEUSER     use a specific SEUSER for the SELinux user mapping


Launching Pi-hole installer...

/bin/bash: curl: command not found
sed: can't read /var/www/html/admin/settings.php: No such file or directory
sed: can't read /var/www/html/admin/settings.php: No such file or directory
sed: can't read /var/www/html/admin/scripts/pi-hole/php/header.php: No such file or directory
sed: can't read /var/www/html/admin/scripts/pi-hole/php/header.php: No such file or directory
sed: can't read /etc/lighttpd/lighttpd.conf: No such file or directory
sed: can't read /opt/pihole/piholeDebug.sh: No such file or directory
sed: can't read /opt/pihole/piholeDebug.sh: No such file or directory
sed: can't read /usr/local/bin/pihole: No such file or directory
sed: can't read /usr/local/bin/pihole: No such file or directory
sed: can't read /usr/local/bin/pihole: No such file or directory
sed: can't read /usr/local/bin/pihole: No such file or directory
sed: can't read /usr/local/bin/pihole: No such file or directory
sed: can't read /usr/local/bin/pihole: No such file or directory
/bin/bash: pihole: command not found
chown: invalid user: ‘pihole:pihole’
chown: invalid user: ‘pihole:pihole’
/bin/bash: pihole: command not found

--------------------------------------------------------------------------------
Pi-hole Web Admin, /bin/bash: pihole: command not found
--------------------------------------------------------------------------------
SUCCESS: The scheduled task "Pi-hole for Windows" has successfully been created.

Pi-hole for Windows installed in C:\Program Files\Pi-hole
Press any key to continue . . .

C:\Program Files>

If I run bash I see that the /etc/resolv.conf as originally shipped is still in place and has not been adjusted by the wsl 2 startup as it should have been.

PS C:\Program Files\Pi-hole>lxrunoffline r -n Pi-Hole
root@WIN:/mnt/c/Program Files\Pi-hole# ping -c 1 1.1.1.1
PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data.
64 bytes from 1.1.1.1: icmp_seq=1 ttl=58 time=17.9 ms

--- 1.1.1.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 17.857/17.857/17.857/0.000 ms
root@WIN:/mnt/c/Program Files\Pi-hole# ping -c 1 www.google.com
ping: www.google.com: Temporary failure in name resolution
root@WIN:/mnt/c/Program Files\Pi-hole# cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 192.168.108.1
root@WIN:/mnt/c/Program Files\Pi-hole# 

Gravity Update

There is a way to create a .cmd file for gravity update? Thanks so much for the job, my pihole work great in a VPS with Windows Server 2019.

Pi-hole error on installation

Hi
Thank you for this application
Please assist, as I get errors on installing it in Windows 10
Please see attached screenshots
github_error2
github_error
Kind regards

Unable to connect

After running the script and it opens up the browser.
It unable to connect to mediaserver:60080/admin.

Not sure what is going on

curl failed to verify the legitimacy of the server and therefore could not

Hi! I can't install Pi-hole-for-WSL1.
Installation of "PH4WSL1.cmd" is interrupted at the stage of downloading the installer from the "GitHub" site.

---- ERROR
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.haxx.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
---- ERROR

If I run this command separately everything goes fine:
curl -L https://install.Pi-hole.net
The file "curl.exe" is in my "system32" directory.

Pi-hole for Windows

Location of "Pi-hole" folder [Default = C:\Program Files]
Response: c:\pi-hole

Pi-hole listener IP and subnet in CIDR format, ie: 192.168.1.99/24
Response: 192.168.178.20/24

Port for Pi-hole. Port 80 is good if you don't have a webserver, or hit enter for default [8880]:
Response:

Install to: c:\pi-hole\Pi-hole
Network: 192.168.178.20/24
Port: 8880

Fetching LxRunOffline...

Installing Ubuntu 20.04...

Shrinking footprint...

Installing dependencies...
Extracting templates from packages: 100%

Launching Pi-hole installer...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.haxx.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.

Web Interface Admin
/bin/bash: pihole: command not found

ERFOLGREICH: Die geplante Aufgabe "Pi-hole for Windows" wurde erfolgreich erstellt.
Drücken Sie eine beliebige Taste . . .
Pi-hole for Windows Installed to c:\pi-hole\Pi-hole

c:\pi-hole\Pi-hole>

Startup Crash

Hello, the issue I'm having is on a win10 machine where I get the administrator check and then the program closes instantly.

I have tried:
enabling / disabling UAC control
deleting temp folder and restarting
adding PAUSE at the end of the code to view error

Win10 Pro
Version: 21H2
OS Build: 19044.1466
Experience pack: 120.2212.3920.0

Desktop.2022.01.22.-.19.10.25.07.DVR_Trim.2.mp4

Install fail on Curl command

Hi,

OS: Windows 11 Home 10.0.22000
RAM: 16GB

During the execution of the install script (ph4wsl1.cmd). The script displayed the following error(s):


Launching Pi-hole installer...

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (6) Could not resolve host: install.Pi-hole.net
sed: can't read /var/www/html/admin/settings.php: No such file or directory
sed: can't read /var/www/html/admin/settings.php: No such file or directory
sed: can't read /opt/pihole/piholeDebug.sh: No such file or directory
sed: can't read /opt/pihole/piholeDebug.sh: No such file or directory
chown: invalid user: ‘pihole:pihole’
chown: invalid user: ‘pihole:pihole’

Pi-hole Web Admin, /bin/bash: line 1: pihole: command not found

SUCCESS: The scheduled task "Pi-hole for Windows" has successfully been created.

NOTE! The Scheduled Task needs additional configuration steps
for Pi-hole to start automatically at boot time.

   - Open Windows Task Scheduler (taskschd.msc)
     Right-click the task "Pi-hole for Windows" and click "Edit"

   - On the General tab, place a checkmark next to both
     "Run whether user is logged on or not" and "Hidden"

   - On the Conditions tab, un-check the option
     "Start the task only if the computer is on AC power"

Press any key to continue . . .
Pi-hole for Windows - Installation complete!


Note: I uninstalled and reinstalled and also tested the curl -L command using both the URL in the script and the re-directed URL. Both worked from the command line. I'll update this issue if I can make further progress on root cause.

No Distribution Available?

After copying the CMD file to my W10 PC and running as admin, it seems to be not finding anything to download?

This is on a newly installed NUC running up to date 21H1.
nodistro

installed successfully but nothing seems to be blocked

Hello,
after trying many other scripts on windows, i have tried yours (and seems to be most easiest of all)

but after i installed, i don't see any ads being blocked.

do i need to do anything else after installation?

dashboard says 0 total queries and 0 queries blocked

thanks.


update: restarted PC and still i don't see any difference.
google ads are being displayed, youtube is showing ads and other sites showing ads aswell.

The system cannot find the path specified.

I've been trying to get this set up on my personal computer for an hour and I keep getting the same errors every time. I've tried different install paths, and I've tried a couple of fixes I found on Reddit to no avail. I also didn't see this specific error in any previous Issues posts. I'm on Windows 10 Home 21H2. The second screenshot is what happens if I hit continue; it just tries to connect to "http://desktop-rsrrmpt/admin" with (desktop-rsrrmpt) being my personal computer's name.
github
image

How to update?

More of a noob question really, how do I update pihole?

I get unknown command if I run pihole -up from CMD?

how to update?

Hello,

in admin panel, it is showing me that some updates are available.

how can we update to latest version of pihole?

thanks

Install Fails with "Curl: (6) Could not resolve host: install.pi-hole.net"

Every time I have tried the install, it fails after the "Launching Pi-Hole Installer" step with the error: "Curl: (6) Could not resolve host: install.pi-hole.net"

I am running Windows 11 on an AMD Ryzen 5600G processor. I have Private Internet Access (VPN software) running on the same system, but I experience the same failure whether it is enabled or not.

I can access that domain directly in a web browser on the same computer. Any ideas on what else to try?

Screenshot Gallery

Installer:

Installer

Pi-hole-Reconfigure.cmd

image

Install Folder

PiHoleInstallfOLDER

Install Complete

CapturePiHoleFull

Hyper-V Server 2019 VM with 768MB RAM

Hyper-V Server 2019 VM with 768MB RAM

Installation fails

when trying to install, it fails during the Debian installation with the following message

This will take a few minutes to complete...
Installing LXrunOffline.exe and Debian -> Compacting install E: Unable to locate package libidn11
E: Unable to locate package libjson-c3
-> Install dependencies
E: Unable to correct problems, you have held broken packages.
/bin/bash: line 1: wget: command not found
/bin/bash: line 1: wget: command not found
dpkg: error: cannot access archive './cloudflared-stable-linux-amd64.deb': No such file or directory
chmod: cannot access 'cloudflared': No such file or directory
mv: cannot stat 'cloudflared': No such file or directory
update-rc.d: error: unable to read /etc/init.d/cloudflared
/bin/bash: line 1: gpg: command not found

according to the log seems it was stuck at perl

Pi-hole Dependency Stage.log

NaN on Dashboard

Yesterday I set up Pihole on a mini pc that I'm using for my plex server as well (since it was on all the time anyway, I figured might as well add pihole).

I used this github to set it up

I then set the minipc to have a static IP on my network, and used the TP-Link software on my router to set up that static IP as my Primary DNS through the DHCP server settings.

Everything was going great yesterday and the pihole was working very well. I didn't change any settings as of yet, but I did make a backup using the teleporter, just to see how that worked.

All the sudden today I see that on the dashboard the 4 main metric boxes (Total queries, blocked queries, percentage blocked and domains on adlists) all say NaN. The charts and graphs below have spinning circular arrows in the upper left hand corner and display nothing.

The pihole still works just as it did yesterday though. It's blocking the same adds, and if I go into view the long term data, it updates the data, and shows that it's still receiving queries blocking some. I did a restart, and that did nothing.

I supposed it's not a big deal since the pihole is still doing it's job, but is there a way to get the dashboard corrected?

Can't download the debian.tar.gz

coming to the line;
IF NOT EXIST %TEMP%\Debian.tar.gz POWERSHELL.EXE -Command "Start-BitsTransfer -source https://salsa.debian.org/debian/WSL/-/raw/master/x64/install.tar.gz?inline=false -destination '%TEMP%\Debian.tar.gz'"
the download fails, upon looking it up the 'https://salsa.debian.org/debian' page seems to be down
Can we look for some other distro or any means or is this just temporary?

question - how do i use DNSCrypt instead of CloudflareDNS

Right now i'm running DNSCrypt which runs as a windows service on port 53. How can i make it run as a service on startup on linux side (WSL) ? Want some help writing the configuration. Or instead can the existing Windows service be used along with Pi-Hole ?

[Kaspersky] wrong terminal?

when i ran the installer it opened command prompt instead of powershell and after installing i cant access the admin page i wonder if thats the reason i cant go to the admin page on my browser

add debian wsl support

adding debian wsl support would be a nice addition. Debian is much more slim in comparison and is compatible with pihole.

RAM shortage / Disk shortage warnings when it's not really a shortage.

RAM shortage (/dev/shm) ahead: 92% used
/dev/shm: 923.0GB used, 999.1GB total, FTL uses 717.1KB
Disk shortage (/etc/pihole/pihole-FTL.db) ahead: 92% used
/etc/pihole: 923.1GB used, 999.1GB total
Disk shortage (/var/log/pihole-FTL.log) ahead: 92% used
/var/log: 923.1GB used, 999.1GB total

Sure, it 92% full. But there is still 76GB of free space left.

/bin/bash: line 1: pihole: command not found

Hello, seems all pretty straightforwared, however I'm getting stuck when trying to install it on Windows 10 (Pro).
Looking at your video, when running PH4WSL1.cmd, after the script has installed Debian, it should automatically launch the Pi-hole Installer. Not sure what actually happens on my system, but after "Extracting templates from packages: 100%", it jumps immediately to the end - obviously without launching the Pi-hole installer (System is localized for Germany, hope this doesn't cause an issue here?):

Pi-hole for Windows v.20220128

Set location for 'Pi-hole' install folder or hit enter for default [C:\Program Files] ->
Pi-hole will be installed in "C:\Program Files\Pi-hole" and Web Admin will listen on port 80

Drücken Sie eine beliebige Taste . . .
Downloading packages . . .
This will take a few minutes to complete . . .
Installing Debian -> Compacting install -> Install dependencies . . .

Launching Pi-hole installer...

ERFOLGREICH: Die geplante Aufgabe "Pi-hole for Windows" wurde erfolgreich erstellt.

NOTE Additional configuration steps are required
for Pi-hole to start automatically at boot time.

   - Open Windows Task Scheduler (taskschd.msc)
     Right-click the task "Pi-hole for Windows" and click "Edit"

   - On the General tab, place a checkmark next to both
     "Run whether user is logged on or not" and "Hidden"

   - On the Conditions tab, un-check the option
     "Start the task only if the computer is on AC power"

Drücken Sie eine beliebige Taste . . .

After closing the cmd window, an empty browser page appears.
Tried to start

Pi-hole Configuration.cmd

But without success.

There is also no /etc/Pi-hole/install.log (not even an /etc folder in rootfs!)

I ran the Pi-hole Uninstall.cmd several times, after one of the attempts, I got the following error messages (but can't reproduce them now):

/bin/bash: line 1: pihole: command not found
sed: can't read /var/www/html/admin/settings.php: No such file or directory
sed: can't read /var/www/html/admin/settings.php: No such file or directory
sed: can't read /opt/pihole/piholeDebug.sh: No such file or directory
sed: can't read /opt/pihole/piholeDebug.sh: No such file or directory

Seems wiered. Any idea, how to troubleshoot or resolve this?
Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.