-
Notifications
You must be signed in to change notification settings - Fork 58
/
0107.html
150 lines (141 loc) · 7.06 KB
/
0107.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Running Pi-Hole Ad-Blocker in a VirtualBox VM</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta charset="UTF-8">
<meta name="keywords" content="VirtualBox,Virtual Machine,Raspberry Pi OS,Raspbian,Pi-Hole,PiHole,DNS,Ad Blocker,DNS Ad Blocking,Block,Home Lab,Home Lab Ideas,Install Guide,Self-Hosted,Web Based,Ad Blocking,Ad,Free Software,Free Open-Source Software,FOSS,Debian,Install Pi-Hole On Debian,Hypervisor,VirtualBox VM,VM,Raspberry Pi VirtualBox,Pi-Hole Installation Guide,Open Source,Open-Source,Networking,Network Wide Ad Blocking,How To,Tutorial,i12bretro">
<meta name="author" content="i12bretro">
<meta name="description" content="Running Pi-Hole Ad-Blocker in a VirtualBox VM">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="revised" content="10/08/2022 09:25:18 AM" />
<link rel="icon" type="image/x-icon" href="includes/favicon.ico">
<script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script type="text/javascript" src="includes/js/steps.js"></script>
<link href="css/steps.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="gridContainer">
<div class="topMargin"></div>
<div id="listName" class="topMargin">
<h1>Running Pi-Hole Ad-Blocker in a VirtualBox VM</h1>
</div>
<div></div>
<div id="content">
<h2>Creating the VM</h2>
<ol>
<li>Download Raspberry Pi OS <a href="https://downloads.raspberrypi.org/rpd_x86_latest" target="_blank">Download</a></li>
<li>Launch Virtualbox</li>
<li>Create a New VM by selecting Machine > New
<p>Name: Raspberry Pi-Hole<br />
Machine Folder: C:\VMs<br />
Type: Linux<br />
Version: Debian (32-bit)<br />
Memory Size: 1024 MB<br />
Hard disk: Create a virtual hard disk now</p>
</li>
<li>Click Create</li>
<li>On the Create Virtual Hard Disk dialog
<p>Name the virtual disk image Raspberry Pi-Hole.vdi<br />
File size: 12-16 GB<br />
Hard disk file type: VDI<br />
Storage on physical hard disk: Dynamically Allocated</p>
</li>
<li>Click Create</li>
<li>Select the VM and Click Settings</li>
<li>Select System > Processor</li>
<li>Give the VM at least 2 processors</li>
<li>Select Display</li>
<li>Slide the Video Memory to 128 MB</li>
<li>Select Network</li>
<li>Set the attached to dropdown to Bridged Adapter</li>
<li>Select Storage</li>
<li>Click on the CD-ROM drive</li>
<li>Select the disc dropdown to the right > Choose a virtual optical disc file...</li>
<li>Browse to and select the Raspberry Pi desktop .iso file</li>
<li>Click OK</li>
<li>Make sure the Raspberry Pi-Hole VM is selected and click Start > Normal</li>
<li>Select Graphical Install</li>
<li>Select a keyboard map > click Continue</li>
<li>Select Guided - use entire disk > click Continue</li>
<li>Click Continue, Continue, Continue</li>
<li>Select Yes to confirm writing the changes to disk > click Continue</li>
<li>Wait while Debian and the Raspberry Pi Desktop are installed</li>
<li>Select Yes to install GRUB on the master boot record > click Continue</li>
<li>Select /dev/sda > click Continue</li>
<li>Click Continue to reboot the VM</li>
<li>Click Next on the welcome dialog</li>
<li>Set the Country, Language and Time Zone > click Next</li>
<li>Enter and confirm a password for the pi user > click Next</li>
<li>Click Skip to updating software</li>
<li>Click Finish to reboot the VM and complete setup</li>
</ol>
<h2>Installing Updates and Pi-Hole</h2>
<ol>
<li>Click the Applications button > Accessories > Terminal</li>
<li>Run the following commands to install updates
<div class="codeBlock">sudo apt update<br />
sudo apt upgrade -y<br />
sudo apt clean<br />
sudo reboot now</div>
</li>
<li>Select Devices > Insert Guest Additions CD image...</li>
<li>If the installation autoruns, select Run</li>
<li>On the desktop, Right click on the Guest Additions disc > Open in Terminal</li>
<li>In the Terminal window run the following commands
<div class="codeBlock">sudo sh ./VBoxLinuxAdditions.run<br />
sudo reboot now</div>
</li>
<li>The VM will reboot</li>
<li>Upon rebooting, you can now full screen the VM and the internal resolution will automatically change to match the window size</li>
<li>Click the Applications button > Accessories > Terminal</li>
<li>Run the following command to install Pi-Hole
<div class="codeBlock">curl -sSL https://install.pi-hole.net | bash</div>
</li>
<li>Press Enter until the DNS selection is displayed</li>
<li>Select a DNS provider and press Enter</li>
<li>Press Enter through the rest of the Pi-Hole installer, selecting the defaults</li>
<li>Copy the randomly generated admin password (just in case)</li>
<li>Press Enter to complete the installation</li>
<li>Run the following command to change the Pi-Hole admin password
<div class="codeBlock">sudo pihole -a -p</div>
</li>
<li>Enter and confirm the new password</li>
<li>Click the Applications button > Internet > Chromium Web Browser</li>
<li>Navigate to http://DNSorIP/admin</li>
<li>Click Login</li>
<li>Authenticate with the admin password</li>
</ol>
<h2>Testing Pi-Hole</h2>
<ol>
<li>Right click the VM network connection > Wireless & Wired Network Settings</li>
<li>Select eth0 from the interface dropdown</li>
<li>Clear out the DNS servers and input the VM IP address</li>
<li>Click Apply</li>
<li>Click Devices > Network > Connect Network Adapter to disable networking</li>
<li>Click Devices > Network > Connect Network Adapter to re-enable networking</li>
<li>In Chromium, open a new tab and navigate to https://yahoo.com</li>
<li>Go back to the Pi-Hole tab and see that some DNS queries have been blocked</li>
</ol>
<h2>Setting Up From Windows Client</h2>
<ol>
<li>Click the Start button > Type control panel > press Enter</li>
<li>Click View By > Small Icons</li>
<li>Click Network and Sharing Center</li>
<li>Click Change adapter settings</li>
<li>Right click on the network connection > Properties</li>
<li>Select Internet Protocol Version 4 (TCP/IPv4) > Properties</li>
<li>Select the radio option next to Use the following DNS server addresses</li>
<li>Input the IP address of the Pi-Hole VM</li>
<li>Click OK on both of the open dialog windows</li>
<li>Right click the Start button > Command Prompt (Admin)</li>
<li>Type the following commands to flush your DNS cache and restart the network connections (note: your network connection will drop if running the commands on a remote machine)
<div class="codeBlock">ipconfig /flushdns<br />
ipconfig /release<br />
ipconfig /renew</div>
</li>
</ol>
<p>More on Pi-Hole <a href="https://pi-hole.net/" target="_blank">https://pi-hole.net/</a></p> </div>
</div>
</body>
</html>