So last week, I talked about how to create a PiHole on a Raspberry Pi running Ubuntu Server. Well, what if you don’t have a Raspberry Pi to use at home? If you are using Windows 10/11 Pro, you can enable the Hyper-V feature and create a VM that acts as a PiHole.

Materials Needed
1x Windows machine running the Pro edition
1x ISO from Ubuntu containing the Ubuntu Server version you choose. Ubuntu Downloads
1x Admin login to your router

  1. Open Hyper-V Manager.
  2. Right-Click on your machine name in the upper right hand corner, then click on New, then click Virtual Machine.
  3. Give your machine a display name for Hyper-V. This will NOT be the machine name itself. If you want to store the virtual machine on a different drive/location, check the box and choose a new location. I normally choose a drive that is not my C:\. Click Next.
  4. Ghoose Generation 1. Click Next.
  5. Allocate 1GB(1024) to your machine. You can go higher if you wish, but I wouldn’t go lower. You can also choose the option to have Dynamic Memory used(Info here). Click Next.
  6. You can use the Default Switch here. Click Next.
  7. I like to give my hard drives specific names for VM’s, which I normally just name after the VM itself. You can rename the drive, or keep it default. I allocate 10GB to my PiHole VM’s. That should be plenty. Click Next.
  8. Choose the second option: Install an Operating System from a bootable CD/DVD. Then choose the location of the .ISO file you downloaded for the operating system. Click Next.
  9. Once you verify everything looks correct, click Finish.
  10. This should bring you back to the main Hyper-V Manager window. Go ahead and double-click on the machine you just created. On the window that opens, click the green power button in the upper-left corner to start your virtual machine.
  11. Hit Enter to install Ubuntu Server.
  12. Choose your installation language, then hit enter.
  13. I choose to continue without updating, then hit enter.
  14. Choose your keyboard layout, then hit enter.
  15. Choose Ubuntu server at the top, then hit enter.
  16. Confirm your machine has an IP Address, then hit enter.
  17. If you want to use a proxy, enter it here, otherwise, just hit enter.
  18. Let the mirror test finish, then hit enter.
  19. Leave the default to let it use the entire disk, and hit your down arrow on the keyboard until you get to done, then hit enter.
  20. Hit enter on done again, and you will get a popup to confirm your destructive action(that any data on this volume will be destroyed). Use your down arrow, then hit enter on Continue.
  21. Fill out the information listed:
    Your Name: You can put whatever you want in here
    Server Name: This will be your machine name
    User Name: This will be your admin account
    Password: This will be the admin account password
    Confirm Password: Type in the password again.
  22. Hit the enter key on continue.
  23. Choose to skip Ubuntu Pro by hitting enter on done.
  24. Hit the space bar on install OpenSSH. Then arrow down to done.
  25. Ubuntu will now begin installing, this can take some time. Wait until it says the system will restart. Power down the machine by clicking the red power button in the upper left corner.
  26. Once the machine is powered down, right-click the machine name and then click settings. Choose the IDE drive that was created to hold the ISO file, and remove it.
  27. Once the drive is removed, go ahead and start up your virtual machine.
  28. Wait until you are prompted to login, it will say “<machine name> login:”. Go ahead and login with the admin account you created(root).
  29. Once you are logged in, you should run: sudo apt install net-tools. If prompted for root password, put in the password you created for your user. This will install tools needed to get the IP information for your device. Once installed, run ifconfig and get your local private IP Address and save it for later.
  30. Install curl by typing the following command: sudo apt install curl. Once again, input the password for your user account if prompted. Press “y” to accept.
  31. Install PiHole by typing this command: curl -sSL https://install.pi-hole.net | bash
  32. As the installer progresses, I normally use all of the defaults. Make sure you choose yes for the web page admin option. This will come in handy. When the installer finishes, it will generate a unique password for this website, WRITE IT DOWN!
  33. To check and make sure everything is funtioning right, go ahead and open up a web browser, and type in the ip address of your Raspberry Pi device, with a /admin at the end. Ex: 192.168.68.24/admin
  34. Use the password you wrote down in step 12 to login to your PiHole.
  35. The next step varies for whatever router you have at your home. But you want to edit the DNS settings in your router to a static value to your Raspberry Pi device. All of your local DNS requests should filter through this PiHole so that it can block out any unwanted ads. You may need to restart your router/pc/phones for it all to take effect.
  36. Once you have the DNS entries updated, watch the admin site and see how many queries get blocked in such a short time. In my home, Roku, Nest, and my LG SmartTV are the highest hitters.

By admin

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.