Protože se české servery přizpůsobily v poslední době blokátorům reklamy tak, že po zákazu reklamy v Opeře z webové stránky nezůstane téměř nic, rozhodl jsem se vyzkoušet Pi-hole.
1 .Nejprve jsem ve Foris povolil LXC podporu, potvrdil instalaci a restartoval router.
2. dále jsem v Luci (Services -LXC Containers) dal pokyn k vytvoření kontejneru Pihole - Debian Jessie a po stisku tlačítka Create se nestane vůbec nic.
Když už jsme u té instalace LXC, tak bych uvítal, kdyby se přímo v LuCI objevila při instalaci možnost výběru, kam kontejner instalovat, když už tam je možnost vytvoření kontejneru, myslím, že by potom pro dost lidí byla jednodušší instalace na SSD, flashDisk atd…
Děkujeme za námět, ale ohledně přidání této možnosti byste se měl raději obrátit na vývojáře LuCI.
Do dokumentace přidáme, jak umístit kontejnery do jiné složky a případně namountovat USB zařízení do složky /srv (nebo /srv/lxc), případně přidáme příkaz, jak nainstalovat LXC kontejnery jinam ( lxc-create také s parametrem -P)
Možná zkuste spíš Ubuntu. V době, kdy vyšla ta verze Turris OS, co rozhodila LXC, mi Pi-hole začal blbnout a měl jsem s Debianem problém, tak jsem tam nahodil LXC s Ubuntu a není problém - příkazy jsou pak stejné.
To je ten důvod, proč jsem dal do návodu Debian, tam je to takové přímočařejší. Čistě z instinktu bych volil Xenial, protože to je LTS podporovaná verze někdy do roku 2021 viz. info v odkazu https://en.wikipedia.org/wiki/Ubuntu_(operating_system). Netuším, co by udělal Artful - ten není LTS a je to aktuální verze Ubuntu. Bionic není finální verze (má vyjít v dubnu).
První kroky v kontejneru – stále v pořádku ? Mám pokračovat ?
root@LXC_NAME:~# apt-get update
Err:1 http://ports.ubuntu.com/ubuntu-ports xenial InRelease
Temporary failure resolving 'ports.ubuntu.com'
Err:2 http://ports.ubuntu.com/ubuntu-ports xenial-updates InRelease
Temporary failure resolving 'ports.ubuntu.com'
Err:3 http://ports.ubuntu.com/ubuntu-ports xenial-security InRelease
Temporary failure resolving 'ports.ubuntu.com'
Reading package lists... Done
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/xenial/InRelease Temporary failure resolving 'ports.ubuntu.com'
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/xenial-updates/InRelease Temporary failure resolving 'ports.ubuntu.com'
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/xenial-security/InRelease Temporary failure resolving 'ports.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.
root@LXC_NAME:~#
==
root@LXC_NAME:~# apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@LXC_NAME:~#
==
– tak to zkusím nasměrovat na flešku - noch einmall
root@LXC_NAME:~# apt-get install curl
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
curl
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 135 kB of archives.
After this operation, 298 kB of additional disk space will be used.
Err:1 http://ports.ubuntu.com/ubuntu-ports xenial-security/main armhf curl armhf 7.47.0-1ubuntu2.5
Temporary failure resolving 'ports.ubuntu.com'
Err:1 http://ports.ubuntu.com/ubuntu-ports xenial-security/main armhf curl armhf 7.47.0-1ubuntu2.5
Temporary failure resolving 'ports.ubuntu.com'
E: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/pool/main/c/curl/curl_7.47.0-1ubuntu2.5_armhf.deb Temporary failure resolving 'ports.ubuntu.com'
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
root@LXC_NAME:~#
Připojení ke kontejneru (2x chybný pokus- třetí úspěch)
root@Omnia:~# lxc-start -n Pihole
lxc-start: lxc_start.c: main: 295 Executing '/sbin/init' with no configuration file may crash the host
root@Omnia:~# lxc-start -n -P /mnt/sda1 Pihole
lxc-start: lxc_start.c: main: 344 The container failed to start.
lxc-start: lxc_start.c: main: 346 To get more details, run the container in foreground mode.
lxc-start: lxc_start.c: main: 348 Additional information can be obtained by setting the --logfile and --logpriority options.
root@Omnia:~# lxc-start -P /mnt/sda1 -n Pihole
root@Omnia:~# lxc-attach -P /mnt/sda1 -n Pihole
root@LXC_NAME:~#
Tak třetí krok končí zase stejnou chybou a následně nezná curl … na které straně je chyba ? Zkusit jinou verzi Ubuntu ?
root@LXC_NAME:~# apt-get update
Err:1 http://ports.ubuntu.com/ubuntu-ports xenial InRelease
Temporary failure resolving 'ports.ubuntu.com'
Err:2 http://ports.ubuntu.com/ubuntu-ports xenial-updates InRelease
Temporary failure resolving 'ports.ubuntu.com'
Err:3 http://ports.ubuntu.com/ubuntu-ports xenial-security InRelease
Temporary failure resolving 'ports.ubuntu.com'
Reading package lists... Done
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/xenial/InRelease Temporary failure resolving 'ports.ubuntu.com'
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/xenial-updates/InRelease Temporary failure resolving 'ports.ubuntu.com'
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/xenial-security/InRelease Temporary failure resolving 'ports.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.
root@LXC_NAME:~# apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@LXC_NAME:~# curl -sSL https://install.pi-hole.net | bash
bash: curl: command not found
root@LXC_NAME:~# curl -L install.pi-hole.net | bash
bash: curl: command not found
root@LXC_NAME:~# apt-get install curl
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
curl
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 135 kB of archives.
After this operation, 298 kB of additional disk space will be used.
Err:1 http://ports.ubuntu.com/ubuntu-ports xenial-security/main armhf curl armhf 7.47.0-1ubuntu2.5
Temporary failure resolving 'ports.ubuntu.com'
Err:1 http://ports.ubuntu.com/ubuntu-ports xenial-security/main armhf curl armhf 7.47.0-1ubuntu2.5
Temporary failure resolving 'ports.ubuntu.com'
E: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/pool/main/c/curl/curl_7.47.0-1ubuntu2.5_armhf.deb Temporary failure resolving 'ports.ubuntu.com'
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
root@LXC_NAME:~# curl -sSL https://install.pi-hole.net | bash
bash: curl: command not found
root@LXC_NAME:~#
A teprve potom po přidělení IP adresy proběhne proces instalací v kontejneru standardně. U mně je trochu atyp, že mám celý rozsah přidělovaných IP obsazen reálnými a rezervní IP pozice “fiktivními” MAC adresami. Až když jsem povolil MAC kontejneru, tak se to rozhýbalo.
root@Omnia:~# lxc-attach -P /mnt/sda1 -n Pihole
root@LXC_NAME:~# apt-get update
Get:1 http://security.debian.org jessie/updates InRelease [63.1 kB]
Ign http://deb.debian.org jessie InRelease
Hit http://deb.debian.org jessie Release.gpg
Hit http://deb.debian.org jessie Release
Get:2 http://security.debian.org jessie/updates/main armhf Packages [473 kB]
Get:3 http://deb.debian.org jessie/main armhf Packages [6644 kB]
Get:4 http://security.debian.org jessie/updates/main Translation-en [243 kB]
Get:5 http://deb.debian.org jessie/main Translation-en [4583 kB]
Fetched 12.0 MB in 24s (483 kB/s)
Reading package lists... Done
root@LXC_NAME:~# apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
sensible-utils
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 10.9 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://security.debian.org/ jessie/updates/main sensible-utils all 0.0.9+deb8u1 [10.9 kB]
Fetched 10.9 kB in 0s (91.3 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
(Reading database ... 8623 files and directories currently installed.)
Preparing to unpack .../sensible-utils_0.0.9+deb8u1_all.deb ...
Unpacking sensible-utils (0.0.9+deb8u1) over (0.0.9) ...
Setting up sensible-utils (0.0.9+deb8u1) ...
root@LXC_NAME:~# apt-get install curl
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
ca-certificates libcurl3 libffi6 libgmp10 libgnutls-deb0-28 libhogweed2 libidn11
libldap-2.4-2 libnettle4 libp11-kit0 librtmp1 libsasl2-2 libsasl2-modules libsasl2-modules-db
libssh2-1 libtasn1-6 openssl
Suggested packages:
gnutls-bin libsasl2-modules-otp libsasl2-modules-ldap libsasl2-modules-sql
libsasl2-modules-gssapi-mit libsasl2-modules-gssapi-heimdal
The following NEW packages will be installed:
ca-certificates curl libcurl3 libffi6 libgmp10 libgnutls-deb0-28 libhogweed2 libidn11
libldap-2.4-2 libnettle4 libp11-kit0 librtmp1 libsasl2-2 libsasl2-modules libsasl2-modules-db
libssh2-1 libtasn1-6 openssl
0 upgraded, 18 newly installed, 0 to remove and 0 not upgraded.
Need to get 3330 kB of archives.
After this operation, 5747 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://deb.debian.org/debian/ jessie/main libgmp10 armhf 2:6.0.0+dfsg-6 [207 kB]
Get:2 http://deb.debian.org/debian/ jessie/main libnettle4 armhf 2.7.1-5+deb8u2 [183 kB]
Get:3 http://deb.debian.org/debian/ jessie/main libhogweed2 armhf 2.7.1-5+deb8u2 [117 kB]
Get:4 http://deb.debian.org/debian/ jessie/main libffi6 armhf 3.1-2+deb8u1 [18.8 kB]
Get:5 http://deb.debian.org/debian/ jessie/main libp11-kit0 armhf 0.20.7-1 [70.2 kB]
Get:6 http://deb.debian.org/debian/ jessie/main libtasn1-6 armhf 4.2-3+deb8u3 [43.3 kB]
Get:7 http://deb.debian.org/debian/ jessie/main libgnutls-deb0-28 armhf 3.3.8-6+deb8u7 [635 kB]
Get:8 http://deb.debian.org/debian/ jessie/main libidn11 armhf 1.29-1+deb8u2 [133 kB]
Get:9 http://deb.debian.org/debian/ jessie/main libsasl2-modules-db armhf 2.1.26.dfsg1-13+deb8u1 [65.4 kB]
Get:10 http://deb.debian.org/debian/ jessie/main libsasl2-2 armhf 2.1.26.dfsg1-13+deb8u1 [97.5 kB]
Get:11 http://deb.debian.org/debian/ jessie/main libldap-2.4-2 armhf 2.4.40+dfsg-1+deb8u3 [195 kB]
Get:12 http://deb.debian.org/debian/ jessie/main librtmp1 armhf 2.4+20150115.gita107cef-1+deb8u1 [55.3 kB]
Get:13 http://deb.debian.org/debian/ jessie/main libssh2-1 armhf 1.4.3-4.1+deb8u1 [117 kB]
Get:14 http://deb.debian.org/debian/ jessie/main libcurl3 armhf 7.38.0-4+deb8u8 [236 kB]
Get:15 http://deb.debian.org/debian/ jessie/main openssl armhf 1.0.1t-1+deb8u7 [659 kB]
Get:16 http://deb.debian.org/debian/ jessie/main ca-certificates all 20141019+deb8u3 [207 kB]
Get:17 http://deb.debian.org/debian/ jessie/main curl armhf 7.38.0-4+deb8u8 [196 kB]
Get:18 http://deb.debian.org/debian/ jessie/main libsasl2-modules armhf 2.1.26.dfsg1-13+deb8u1 [94.8 kB]
Fetched 3330 kB in 7s (472 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package libgmp10:armhf.
(Reading database ... 8623 files and directories currently installed.)
Preparing to unpack .../libgmp10_2%3a6.0.0+dfsg-6_armhf.deb ...
Unpacking libgmp10:armhf (2:6.0.0+dfsg-6) ...
Selecting previously unselected package libnettle4:armhf.
Preparing to unpack .../libnettle4_2.7.1-5+deb8u2_armhf.deb ...
Unpacking libnettle4:armhf (2.7.1-5+deb8u2) ...
Selecting previously unselected package libhogweed2:armhf.
Preparing to unpack .../libhogweed2_2.7.1-5+deb8u2_armhf.deb ...
Unpacking libhogweed2:armhf (2.7.1-5+deb8u2) ...
Selecting previously unselected package libffi6:armhf.
Preparing to unpack .../libffi6_3.1-2+deb8u1_armhf.deb ...
Unpacking libffi6:armhf (3.1-2+deb8u1) ...
Selecting previously unselected package libp11-kit0:armhf.
Preparing to unpack .../libp11-kit0_0.20.7-1_armhf.deb ...
Unpacking libp11-kit0:armhf (0.20.7-1) ...
Selecting previously unselected package libtasn1-6:armhf.
Preparing to unpack .../libtasn1-6_4.2-3+deb8u3_armhf.deb ...
Unpacking libtasn1-6:armhf (4.2-3+deb8u3) ...
Selecting previously unselected package libgnutls-deb0-28:armhf.
Preparing to unpack .../libgnutls-deb0-28_3.3.8-6+deb8u7_armhf.deb ...
Unpacking libgnutls-deb0-28:armhf (3.3.8-6+deb8u7) ...
Selecting previously unselected package libidn11:armhf.
Preparing to unpack .../libidn11_1.29-1+deb8u2_armhf.deb ...
Unpacking libidn11:armhf (1.29-1+deb8u2) ...
Selecting previously unselected package libsasl2-modules-db:armhf.
Preparing to unpack .../libsasl2-modules-db_2.1.26.dfsg1-13+deb8u1_armhf.deb ...
Unpacking libsasl2-modules-db:armhf (2.1.26.dfsg1-13+deb8u1) ...
Selecting previously unselected package libsasl2-2:armhf.
Preparing to unpack .../libsasl2-2_2.1.26.dfsg1-13+deb8u1_armhf.deb ...
Unpacking libsasl2-2:armhf (2.1.26.dfsg1-13+deb8u1) ...
Selecting previously unselected package libldap-2.4-2:armhf.
Preparing to unpack .../libldap-2.4-2_2.4.40+dfsg-1+deb8u3_armhf.deb ...
Unpacking libldap-2.4-2:armhf (2.4.40+dfsg-1+deb8u3) ...
Selecting previously unselected package librtmp1:armhf.
Preparing to unpack .../librtmp1_2.4+20150115.gita107cef-1+deb8u1_armhf.deb ...
Unpacking librtmp1:armhf (2.4+20150115.gita107cef-1+deb8u1) ...
Selecting previously unselected package libssh2-1:armhf.
Preparing to unpack .../libssh2-1_1.4.3-4.1+deb8u1_armhf.deb ...
Unpacking libssh2-1:armhf (1.4.3-4.1+deb8u1) ...
Selecting previously unselected package libcurl3:armhf.
Preparing to unpack .../libcurl3_7.38.0-4+deb8u8_armhf.deb ...
Unpacking libcurl3:armhf (7.38.0-4+deb8u8) ...
Selecting previously unselected package openssl.
Preparing to unpack .../openssl_1.0.1t-1+deb8u7_armhf.deb ...
Unpacking openssl (1.0.1t-1+deb8u7) ...
Selecting previously unselected package ca-certificates.
Preparing to unpack .../ca-certificates_20141019+deb8u3_all.deb ...
Unpacking ca-certificates (20141019+deb8u3) ...
Selecting previously unselected package curl.
Preparing to unpack .../curl_7.38.0-4+deb8u8_armhf.deb ...
Unpacking curl (7.38.0-4+deb8u8) ...
Selecting previously unselected package libsasl2-modules:armhf.
Preparing to unpack .../libsasl2-modules_2.1.26.dfsg1-13+deb8u1_armhf.deb ...
Unpacking libsasl2-modules:armhf (2.1.26.dfsg1-13+deb8u1) ...
Setting up libgmp10:armhf (2:6.0.0+dfsg-6) ...
Setting up libnettle4:armhf (2.7.1-5+deb8u2) ...
Setting up libhogweed2:armhf (2.7.1-5+deb8u2) ...
Setting up libffi6:armhf (3.1-2+deb8u1) ...
Setting up libp11-kit0:armhf (0.20.7-1) ...
Setting up libtasn1-6:armhf (4.2-3+deb8u3) ...
Setting up libgnutls-deb0-28:armhf (3.3.8-6+deb8u7) ...
Setting up libidn11:armhf (1.29-1+deb8u2) ...
Setting up libsasl2-modules-db:armhf (2.1.26.dfsg1-13+deb8u1) ...
Setting up libsasl2-2:armhf (2.1.26.dfsg1-13+deb8u1) ...
Setting up libldap-2.4-2:armhf (2.4.40+dfsg-1+deb8u3) ...
Setting up librtmp1:armhf (2.4+20150115.gita107cef-1+deb8u1) ...
Setting up libssh2-1:armhf (1.4.3-4.1+deb8u1) ...
Setting up libcurl3:armhf (7.38.0-4+deb8u8) ...
Setting up openssl (1.0.1t-1+deb8u7) ...
Setting up ca-certificates (20141019+deb8u3) ...
Updating certificates in /etc/ssl/certs... 174 added, 0 removed; done.
Setting up curl (7.38.0-4+deb8u8) ...
Setting up libsasl2-modules:armhf (2.1.26.dfsg1-13+deb8u1) ...
Processing triggers for libc-bin (2.19-18+deb8u10) ...
Processing triggers for ca-certificates (20141019+deb8u3) ...
Updating certificates in /etc/ssl/certs... 0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d....done.
root@LXC_NAME:~#
Je třeba po vytvoření kontejneru nejprve přidělit IP adresu — aby viděl síť ??
Tak jsem si odpověděl sám … to jsem ale hlava chytrá = stavební český inženýr 65 let … viz základní dílo české opery “„Úspěch českého inženýra v Indii“,”)
(v mém případě nemám v LAN volnou IP pozici. Vše přiděluji pouze fixně dle MAC a proto vznikl celý zádrhel — kontejner nedostal IP automaticky, tím ani přístup do LAN a WAN !!! a proto nic nemohl stáhnout !!!)
Postup jsem naznačil výše. Na definitivní zprovoznění si dám pauzičku …
v seznamu Pihole distribuci je i
Turris_OS stable armv7l default 2019-10-20
Turris_OS stable ppc default 2019-10-20
Nebude to vhodnejsi nez pouzit pro T_Omnii distribuci Ubuntu?
jaky je pak v tomto pripade rozdil mezi armv7l a ppc?
Downloading the image index
Downloading the rootfs
Downloading the metadata
The image cache is now ready
Unpacking the rootfs
Distribution Debian version Buster was just installed as a container.
Content of the tarballs is provided by third party, thus there is no warranty of any kind nor support from Turris team.
Do not use containers on internal flash, they can wear it down really fast!!!
root@turris:~# lxc-start -n Pihole
root@turris:~# lxc-attach -n Pihole
lxc-attach: Pihole: attach.c: lxc_attach: 1095 Failed to get init pid
root@turris:~# lxc-start -n Pihole
root@turris:~# lxc-attach -n Pihole
lxc-attach: Pihole: attach.c: lxc_attach: 1095 Failed to get init pid
root@turris:~#