sakaki- / raspbian-nspawn-64

Bootable RPi4 / RPi3 image with 64-bit kernel, 32-bit Raspbian Buster host OS, 64-bit Debian Buster guest OS in nspawn container
GNU General Public License v3.0
153 stars 24 forks source link

Can't change the hostname of the container via standard settings and/or commands #17

Closed 2072 closed 4 years ago

2072 commented 4 years ago

Hello,

Thanks for raspbian-nspawn-64. I'm using it on a headless server.

The default name debian-buster-64 doesn't suit my needs (it would have had if it had simply been named 'ORIGINALHOST-64')

I've renamed the machine via the machinectl command, I've also tried hostnamectl --set-hostname inside the container, but after a stop-start of the machine, it reverts back to 'debian-buster-64'. I've also tried setting the Hostname option in the /etc/systemd/nspawn/NEWNAME.nspawn file but it has, like the rest no effect... I even tried modifying the systemd service file and add a --hostname=%i still with no effect.

So where does this debian-buster-64 comes from??? (I'm currently running a rgrep on my whole file system to find it...)

ok my rgrep paid off just when I was about to submit this issue... I needed to edit the file /etc/given-hostname inside the container. This should be added somewhere in the documentation to save others some of their time. (it took me 2 hours to find this...)

sakaki- commented 4 years ago

@2072 - thanks, done. Best, sakaki