Repository navigation
fix(packer): Kali clones no longer come up without cloud-init - #1160
Merged
Merged
Conversation
On a clone's first boot, cloud-init's generator could be cut off before it enabled cloud-init.target, leaving no user, no key and the template's hostname. It happened on 2 of 7 first boots of template 910 on 2026-10-10: garuda, and one of four reproduction clones. On garuda's first boot sslh's generator, from kali-linux-headless, aborted beside it. The Kali build now links cloud-init.target into multi-user.target, which makes cloud-init start whatever cuts its generator off, and masks sslh's generator with a /dev/null link, keeping the package. The cause is not proved, so the two are one fix, proved together: after a rebuild of 910, 12 of 12 first boots of disposable clones ran cloud-init. Both template sources share the build, so 902 gets it as well. Garuda's runbook section 4 now expects a 910 built since then not to need the reboot workaround, and the changelog has the counts. This replaces PR 1157, whose history carried a stray close keyword. Refs #1127. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟢 Approval recommended
The focused systemd changes address the documented race, preserve package dependencies, and are supported by repeated clone testing.
0 open findings
What changed in this PR
Fixes intermittent Kali clone initialization failures by making cloud-init startup independent of its generator and suppressing the failing sslh generator.
Changes:
- Statically enables
cloud-init.targetand masks the sslh generator. - Updates the analyst workstation recovery guidance.
- Records the failure, fix, and validation results.
| File | Description |
|---|---|
packer/kali.pkr.hcl |
Applies the boot fix to both Kali templates. |
docs/runbooks/build-the-analyst-workstation.md |
Updates first-boot troubleshooting guidance. |
docs/changelog.md |
Adds a dated incident and validation record. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #1127. This replaces PR 1157, whose history carried a stray close keyword in a commit message.
What went wrong
On a clone's first boot, cloud-init's generator could be cut off before it enabled
cloud-init.target. The guest then came up with no user, no SSH key, and the template's hostname. This happened on 2 of 7 first boots of template 910:garuda, and one of four disposable reproduction clones. Ongaruda's first boot, sslh's generator (sslh is pulled in bykali-linux-headless) aborted beside it, with no/etc/sslh. On its second boot it did not.The fix
In
packer/kali.pkr.hcl's shared provisioner, so both 910 and 902 get it:cloud-init.targetintomulti-user.target. cloud-init no longer depends on its generator finishing. As a result ds-identify can no longer switch cloud-init off. Nothing here needs that: every clone gets a NoCloud drive./dev/nulllink in/etc/systemd/system-generators. The package stays installed, so the Kali metapackages keep their dependency and nothing is autoremoved.Garuda's runbook §4 now says a 910 built after this should not need the reboot workaround. The changelog has the counts.
Proof
-forcefrom this branch, in 26m31s.packer validateandfmt -checkpass.cloud-init status: done, and the generator completed. Before the fix, cloud-init failed on 2 of 7 first boots.qemu-gawrites to the journal. So the baseline's sslh figures are void. Its cloud-init figures stand, because those come from the hostname andcloud-init status.#1127 is closed by hand with this evidence, since the rebuilt template is already live on
Saruman.🤖 Generated with Claude Code