Building a $0 VPS on Google Cloud: DietPi, Tailscale, IPv6, and the traps I hit
说明与用途
在 Google Cloud 上使用 DietPi 和 Tailscale 构建零成本 VPS,去除公共 IPv4,启用 IPv6 出口,并通过解决五个常见陷阱实现零费用。
问题
Create a minimal, always‑on Linux VM on Google Cloud with no public IPv4, private SSH via Tailscale, and zero cost, while avoiding common pitfalls.
结果
The VM operates with no public IPv4, secure SSH via Tailscale, and zero monthly cost, after addressing five traps: DietPi conversion script, disk.raw naming, unintended public IP, IPv6 misconfiguration, and IPv4‑only egress.
工作流
- 1. Download DietPi Native PC image and repack it to meet GCP’s disk.raw requirement.
- 2. Create a new VM from the repacked image, ensuring UEFI_COMPATIBLE guest‑os‑features.
- 3. Verify instance has no external IPv4 and that SSH keys are used instead of passwords.
- 4. Configure network interfaces: use a custom VPC with IPV4_IPV6 stack, and set static IPv6 address and gateway in /etc/network/interfaces.d/eth0.conf.
- 5. Test reachability with tailscale ping and curl to confirm IPv6 connectivity and IPv4 egress.
- 6. Monitor Cloud Billing to confirm zero charges.
证据
"The RAM number matters. On plain Debian the box idled at 389 MB used. On DietPi it idles at 248 MB — 36% less, which on a 964 MB machine is the difference between "can run one small service" and "cannot".
"GCP only accepts a file literally named disk.raw"
"The VM came up with a public IP and a default password"
"active in the tailnet is not proof of reachability"
"IPv6-only egress cannot reach IPv4-only destinations"
- 记录日期: 2026-10-25T03:11:17.594Z