Files
Shiju 465324a831 fix(vm): populate an empty guest /etc/hosts with loopback names (#4182)
OCI images commonly ship an empty /etc/hosts and rely on the container runtime to bind-mount a generated one. The VM driver does not, and guest init wrote /etc/hostname and /etc/resolv.conf but never /etc/hosts, so localhost did not resolve: the guest resolver is the loopback relay, which has no record for it.

Add configure_hosts to guest init, called after configure_hostname. It writes IPv4 and IPv6 localhost entries when the file is missing or empty, keeps a non-empty file and leaves a symlink alone, because an absolute link target would resolve against init's own root. A write failure logs a warning and boot continues.

Cover the file states and the boot-path call site with tests that run the shipped init function under bash.

Closes #3934

Signed-off-by: Shiju <shiju@nvidia.com>
2026-10-20 22:46:00 +00:00
..