Skip to content

Build tpl-kali (VMID 902) on ifrit once it exists #790

Closed

Description

@Gerrrt

Follow-up to #440, split off by ADR-0071 (docs/adr/0071-build-the-lab-templates-with-packer-from-phoenix.md) part 2.

The Kali source is written and checked in CI (packer/kali.pkr.hcl, packer/kali/preseed.cfg.pkrtpl), but it has never been built. Its consumer is #421's attack VM, which lives on ifrit. A Proxmox template belongs to the node it was built on, so building it on Saruman would mean building it again later.

What to do

Once ifrit exists, follow docs/runbooks/build-the-lab-templates.md §5:

  • Port 8800 on phoenix. The preseed is served over Packer's HTTP server, because Debian's installer can't read one from a second disc. Admit the guest to that port for the length of the build, then remove the rule.
  • PhoenixBuilder on ifrit. Grant the role on ifrit's storage and bridge, as §2 did on Saruman. Add privileges to the role; never grant the role at /.
  • Build: packer build -only='kali.*' -var kali_iso_file=local:iso/<the iso> packer/. kali_node already defaults to ifrit.
  • Prove it: PROXMOX_NODE=ifrit scripts/packer-smoke.sh 902.

Untested parts of the source

  • The GRUB boot command typed at the installer's prompt.
  • pre_enrolled_keys = false. Secure Boot is off.
  • The disk storage. disk_storage defaults to large_data, which is Saruman's pool, so set it to ifrit's.
  • The installed packages: kali-linux-default on 64G.

The range NIC on vmbr1 belongs to the clone (build-the-playground.md), not the template.

Done when

  • tpl-kali exists on ifrit.
  • The smoke test passes against it.
  • A second packer build -force also passes the smoke test.
  • The runbook's §2 table records any privileges the build needed.

Waits on

ifrit (#421's host, not yet bought).

Activity

  1. Gerrrt commented on Oct 8, 2026

    @Gerrrt
    OwnerAuthor

    Progress made on 2026-10-08, ahead of ifrit. Everything here was done on Saruman, which kali_node's description allows "only to prove the preseed".

    Ready now:

    • The ISO. kali-linux-2026.2-installer-amd64.iso is on smaug-iso. Its hash comes from Kali's GPG-signed SHA256SUMS (key 827C 8569 F251 8CC6 77FE CA1A ED65 462E C8D5 E4C5, the fingerprint kali.org publishes). It is listed in the ISO store check by feat(iso-store): list the Kali 2026.2 installer for #790's template #1084, and the check reads state="match".

    • Three of this issue's four untested parts work:

      • the GRUB boot command;
      • the preseed served from phoenix:8800 (ufw is inactive on phoenix, so §5 step 1's rule isn't needed there today);
      • Secure Boot off.

      The fourth, kali-linux-default on 64G, installed in about 22 minutes.

    • A bug found and fixed in fix(packer): give the Kali template DHCP on eth0, the name kali-defaults gives its NIC (#790) #1096. The installer configures ens18, but kali-defaults masks 99-default.link, so the installed system names the NIC eth0. With no address, Packer timed out waiting for SSH in both builds. The fix, a DHCP stanza for eth0, was proven by hand on the live VM: Packer then connected and built the template. A clone of that template passed packer-smoke.sh, with cloud-init's user, key and DHCP, and SSH as smoke.

    Still to do when ifrit exists, with the build otherwise unchanged:

    • grant PhoenixBuilder on ifrit's storage and bridge;
    • trust ifrit's CA on phoenix, and let phoenix reach ifrit's 8006;
    • build with -var kali_iso_file=… and -var disk_storage=… for ifrit;
    • run the smoke test, a second -force build, and the smoke test again.

    The first ifrit build is also the first to prove #1096's late_command line itself; so far the stanza has only been written by hand.

    The Saruman proof template (902) was destroyed: the real one belongs on ifrit.

    🤖 Generated with Claude Code

  2. Gerrrt commented on Oct 8, 2026

    @Gerrrt
    OwnerAuthor

    Two things to watch for the ifrit build, from the #920 session's Debian and Fedora templates (#1083), which share Kali's d-i boot path.

    1. Boot timing. Debian's first build missed GRUB with Kali's boot_wait = "10s": the c landed before the menu was drawn, and the menu never times out, so the build sat waiting for SSH. feat(lab): dotfiles OS-layer VMs, phase 1: Debian, Fedora and Windows (#920) #1083 uses boot = "order=scsi0;ide2" with boot_wait = "20s". Kali sets neither, and on Saruman its 10s reached the GRUB prompt in both proof builds: the first screenshot of each shows the command typed in. So nothing is changed here without evidence. On ifrit's different hardware, if the first screenshot shows the menu still waiting, raise boot_wait. If the installer boots again after the install's reboot, add the boot order.
    2. The clone's username (for Build the range on gandalf #421). The tofu guest module defaults to username = "operator". Debian-family guests ship a system group operator (gid 37), so cloud-init's useradd exits 9 and the user isn't created. Kali is Debian-based, so a tofu-declared Kali clone needs another username; the dotfiles guests use tester. packer-smoke.sh uses smoke, which is why the Saruman smoke test passed.

    🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions