fix: set the hostname on the kernel command line #4

Open
Job79 wants to merge 1 commits from hostname-from-cmdline into main
pull from: hostname-from-cmdline
Owner

The first boot gets another hostname than every later boot, with the same machine ID. /etc/hostname only exists once tmpfiles links it from the factory, after PID 1 has already set the hostname. Remote Control shows the hostname (--name %H), so the VM changed name in claude.ai after its first reboot.

systemd.hostname=agentos-???? on the kernel command line replaces Hostname=, and the /etc/hostname link goes. PID 1 has the command line from the start and fills in the ?s from the machine ID.

Found and fixed the same way in runneros (Job79/runneros#3). Tested here: a build with this change booted twice as agentos-20da.

🤖 Generated with Claude Code

The first boot gets another hostname than every later boot, with the same machine ID. `/etc/hostname` only exists once tmpfiles links it from the factory, after PID 1 has already set the hostname. Remote Control shows the hostname (`--name %H`), so the VM changed name in claude.ai after its first reboot. `systemd.hostname=agentos-????` on the kernel command line replaces `Hostname=`, and the `/etc/hostname` link goes. PID 1 has the command line from the start and fills in the `?`s from the machine ID. Found and fixed the same way in runneros (Job79/runneros#3). Tested here: a build with this change booted twice as `agentos-20da`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Job79 added 1 commit 2026-11-23 20:01:52 +00:00
The first boot had another hostname than later boots, because
/etc/hostname only exists once tmpfiles links it, after PID 1 has set the
hostname. Remote Control shows the hostname, so the VM changed name in
claude.ai after its first reboot. PID 1 has the command line from the
start.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
You are not authorized to merge this pull request.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin hostname-from-cmdline:hostname-from-cmdline
git checkout hostname-from-cmdline
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Job79/agentos#4