Celtic Coding Solutions Blog

Celtic Coding Solutions Blog - for everything computer related

Pi-hole on Ubuntu Server 18.04 within Hyper-V VM

So I wanted to use Pi-hole on my home network but making use of my server rather than adding a raspberry pi. I already had Hyper-V server installed so I created a new VM using only 1 processor and 1024mb of Ram (love how little system resources it needs). I gave it 5GB of Hard Drive space which is plenty, then I installed Ubuntu Server 18.04 from the ISO. Setup is pretty painless but before I could install Pi-hole I noticed on a few forums a few packages needed to be installed on Ubuntu first:

dialog 

First was to install dialog so on Ubuntu run:

sudo apt-get install dialog

dhcpcd5

Next was to install dhcpcd5 on Ubuntu run:

sudo apt-get install dhcpcd5

Pi-hole

Then run the Pi-hole installer:

curl -sSL https://install-pi-hole.net | bash

Run through the installation and remember the password that it gives you at the end, especially if you have installed the Web Admin Site which looks like this and provides a simple method of making changes to pi-hole:

 

 

 

Hyper-V 2016 Server - Add USB Hard Drive to Virtual Machine

I wanted to use an USB3 External Hard Drive to a Virtual Machine on my server which was running Windows Hyper-V 2016 Server.  From searching on the internet it seemed you needed to make the Hard Drive offline, however not much information on how to actually do this.  In the end this is my solution:-

Exit to Command Line from Hyper-V server [14]

Then enter disk management called diskpart [diskpart]:-

List the volumes [list volume]:-

Find the one that is the Hard Drive you wish to make offline.  In this case it is Toshiba Ext, Volume 4. 

So select the correct volume [select volume 4]:-

I like the make sure it is actually selected as I don't want to down my server.

So list the volumes again [list volume].  Notice the * next to Volume 4 indicating that it is selected:-

Make the disk offline [offline disk]:-

After this in Hyper-V manager you can now create a new Hard Drive selecting an actual Physical Hard Disk, in this case my Toshiba USB3 HD:-