Showing posts with label proxmox. Show all posts
Showing posts with label proxmox. Show all posts
Saturday, 31 October 2026
Home-lab design part 5 - The perfect Serviio console
Continuing my [2026 homelab uplift series](https://blog.themillhousegroup.com/search/label/homelab), when I found my RPi 3B was no-longer cutting it with H265 videos, it was a no-brainer to try a [dockerised Serviio](https://hub.docker.com/r/soerentsch/serviio) on my Nuc/Proxmox/Alpine/Docker stack.
Some quick tests showed it to be extremely smooth.
But - for devices on your home network to see the DLNA advertisements from this Serviio instance, you need to do some tricky Docker networking so that your container is running in your network (e.g. for me, 10.240.0.0/16, maybe 192.168.0.0/24 for you, but probably NOT the 172.19.0.0/16 that a Docker container will typically be running in if not specifically configured)
While Arcane does support defining these networks within its GUI, it's got a bit of an impedance mismatch, so I head to the Proxmox console for my Docker VM. The command that worked for me was:
```
# docker network create \
-d macvlan \
--subnet=10.240.0.0/16 \
--gateway=10.240.0.1 \
--ip-range=10.240.1.96/30 \
-o parent=eth0 \
macvlan-on-home-network
```
This [Visual Subnet Calculator](https://www.davidc.net/sites/default/subnets/subnets.html) may prove handy if you're trying to find a safe IP range for your Serviio container to slot into!
This will now get DLNA advertisements out onto your home network, and devices will start showing Serviio(whatever) in their server lists. Note: it's highly likely that the `whatever` part of the server name will be random hex due to Docker, so you might want to edit your `profiles.xml` and replace `Serviio({hostname})` with a fixed string like just `Serviio`.
You'll also be able to access the Serviio console at `http://10.240.1.96:23423/console` or whatever, but that's both insecure and has an ugly and hard-to-remember port number, which we're able to eliminate with Nginx Proxy Manager, so let's get that working.
Sadly, simply adding a straightforward Proxy Host to make `https://serviio.lab.example.com` point to ``http://10.240.1.96:23423` won't work, because, by Docker design, the NGinx Docker container **cannot see into that MacVLAN network**; you'll get a _No Route To Host_ error, which manifests as a 502 in your browser.
#### Containers can't talk to each other
```mermaid
architecture-beta
group lab(affinity:house)[Home Lab]
group docker(affinity:grid)[Docker] in lab
service serviio(affinity:camera)[Serviio] in docker
service firewall(affinity:firewall) in docker
service npm(affinity:loadbalancer)[NPM] in docker
npm:R <-- L:firewall
firewall:R --> L:serviio
align row npm serviio
```
Now you *could* get extremely tricky with your Docker (and Alpine, and Proxmox) networking stack to get around this, and I'm sure it's possible following guides like [this MacVLAN document](https://blog.oddbit.com/post/2018-03-12-using-docker-macvlan-networks/) and maybe asking a friendly chatbot, but I've never really felt comfortable with advanced networking (routing, firewalls, IPtables etc etc) on Linux and would rather throw some existing specialised hardware at it. The right tool for the job I think. So instead, I'm punching through this limitation with my old friends [the Mikrotik hairpin triplets](https://blog.themillhousegroup.com/2025/07/mikrotik-automation.html), aka what a consumer-grade router calls "port forwarding".
### Mikrotik saves the day again
Going from the outside-in, here's how the Nginx Proxy Manager setup looks:
The trick here is that the host `mikrotik` has *nothing at all to do with Docker*, so packets can happily make their way from NPM to the router and then on to _the actual service_. Time for a diagram.
#### After
```mermaid
architecture-beta
group lab(affinity:house)[Home Lab]
group docker(affinity:grid)[Docker] in lab
service serviio(affinity:camera)[Serviio] in docker
service npm(affinity:loadbalancer)[NPM] in docker
service mikrotik(affinity:router)[Mikrotik] in lab
npm:L <--> B:mikrotik
mikrotik:R <--> T:serviio
align row npm serviio
```
##### Filter rules:
See [the aforementioned Mikrotik post](https://blog.themillhousegroup.com/2025/07/mikrotik-automation.html) for the details, but here's how it looks for the Serviio rules.
Allow Serviio packets (destined for port 23423) to cross the routing fabric.
##### NAT Rules:
The "outbound" DST-Nat rule:
Packets (destined for port 23423 of "me") get their destination IP rewritten to that of the Serviio container.
The "hairpin" SRC-Nat rule:
Packets (destined for port 23423 of "me") _also_ get their source IP rewritten to the Mikrotik's IP so that the container will respond to the right place.
Saturday, 28 March 2026
Home-lab design (2026 edition) part 2 - Inside the NUC
Following on from last-month's look at the [physical boxes that make up my home "lab"](https://blog.themillhousegroup.com/2026/02/home-lab-design-pt1-physical-boxes.html) in 2026, there's only one box that actually deserves any deeper inspection; the Intel NUC5PGYH, an incredibly-lucky hard-rubbish find from a few years back that, after sourcing a suitable 19V (i.e. laptop) power supply, de-Windows-ing, and most recently, a RAM doubling (at the princely cost of $25) to 8Gb, has proven itself to be an ideal platform for various x86-based experimentation.
Up until last month, the NUC has been running Debian Bookworm, keeping up my long-standing tradition of using Debian-based Linux for my home servers. The primary applications running on this box before 2026 were [_Home Assistant_](https://www.home-assistant.io/) via the [packaged-up `haos.qcow2` virtual machine image](https://www.home-assistant.io/installation/linux/#install-home-assistant-operating-system), the excellent [_OctoPrint_](https://octoprint.org/) for [3D printer](https://blog.themillhousegroup.com/search/label/3dprinting) monitoring, the [_BrickSync_](https://bricksync.net/) inventory-management software that keeps multiple [online LEGO parts stores](https://blog.themillhousegroup.com/2024/06/home-cooked-and-delicious.html) in sync, and various self-written node.js-based webapps that aren't suitable for public hosting on the otherwise-brilliant (and free) [Netlify](https://www.netlify.com/) platform.
HAOS runs as a VM, which was fairly easy to get going following the instructions as linked above, and pretty-much looks after itself. OctoPrint, being a "proper" solution, runs properly as a system service; the latter apps I'd run fairly erratically using `screen` sessions. Finally, after a particularly annoying festival of `screen`-cursing and port-interfering, I'd had enough. The SvelteKit apps I prefer these days are [fairly trivial to Dockerise](https://khromov.se/dockerizing-your-sveltekit-applications-a-practical-guide/), and I've spent enough time with Docker in my work life to appreciate the true segregation and repeatability that it brings - "cattle, not pets". And thus so began a new phase - transforming the NUC into a more-appropriate host for these "workloads".
### Moving it all over
After carefully tidying up the home directory of the Debian installation (which featured the usual assortment of scripts, Github clones and random downloaded files), it was time to say goodbye. My new OS for the NUC is [Proxmox VE](https://www.proxmox.com/en/products/proxmox-virtual-environment/overview), which is still Debian-based underneath, so I guess my run continues. I liked the idea of completely installing from scratch, and having the absolute thinnest layer possible between the VM workloads and the bare metal. It certainly shows in Proxmox's boot time, which is extremely impressive; no starting desktops or initializing sound systems here - just straight down to business!
The conceptual layout of the VMs inside Proxmox is also refreshingly simple:
```mermaid
architecture-beta
group prox(affinity:server)[Proxmox VE]
service ahaos(affcircle:c-house-blue)[HAOS 100] in prox
service zdocker(affcircle:c-nas-blue)[Docker 101] in prox
```
That's it. _Everything_ that's not Home Assistant will be run as a Docker container inside VM 101.
Moving the `HAOS` image (that I'd backed up over to my NAS, simply by stopping the VM and copying the `haos.qcow2` file) was easy, courtesy of this excellent [step-by-step guide](https://forum.proxmox.com/threads/guide-install-home-assistant-os-in-a-vm.143251/). With `haos.qcow2` safely copied into your Proxmox `local` storage, you can install it like this in the main Shell:
```
root@nuc:/home# qm importdisk 100 /var/lib/vz/import/haos.qcow2 local-lvm
importing disk '/var/lib/vz/import/haos.qcow2' to VM 100 ...
Logical volume "vm-100-disk-1" created.
Logical volume pve/vm-100-disk-1 changed.
transferred 0.0 B of 32.0 GiB (0.00%)
transferred 327.7 MiB of 32.0 GiB (1.00%)
transferred 655.4 MiB of 32.0 GiB (2.00%)
...
```
Now for *Docker*, there are many opinions about the best way to run it, but I like an easy life, so another VM is my choice. I already had a `docker.qcow2` image, which runs a super-slim _Alpine Linux_ host OS, [just enough to host Docker](https://wiki.alpinelinux.org/wiki/Docker), so we do it all again. Exactly the same. Cattle, not pets ;-)
```
root@nuc:~# qm importdisk 101 /var/lib/vz/import/docker.qcow2 local-lvm
importing disk '/var/lib/vz/import/docker.qcow2' to VM 101 ...
Logical volume "vm-101-disk-1" created.
Logical volume pve/vm-101-disk-1 changed.
transferred 0.0 B of 32.0 GiB (0.00%)
transferred 331.0 MiB of 32.0 GiB (1.01%)
transferred 665.2 MiB of 32.0 GiB (2.03%)
transferred 996.1 MiB of 32.0 GiB (3.04%)
transferred 1.3 GiB of 32.0 GiB (4.06%)
```
### Final touches (USB device mapping)
I have a couple of USB devices that hang off the NUC, and Proxmox VE has actually substantially improved my quality-of-life with its device-ID-specific mapping which means even if a device is power-cycled (as happens all the time with the 3D printer; it's too noisy to leave on) it still remains consistently available to the consuming applications. Under Debian, such a device would appear as a new `bus:device` pair every time, causing havoc.
#### Mapping the Sonoff Zigbee dongle through to the `haos` VM:
#### Mapping the 3D printer through to the `docker` VM:
Labels:
3dprinting,
alpine,
containerization,
debian,
docker,
haos,
homeassistant,
homeautomation,
homelab,
markdown-enabled,
nuc,
octoprint,
proxmox,
proxmoxve,
qcow2,
svelte,
sveltekit,
usb
Subscribe to:
Posts (Atom)







