On 1/20/22 19:17, Thomas Cameron wrote:
On 1/17/22 15:30, Petr Menšík wrote:
I think it might make more sense to correctly detect hostname during
installation. If you define hostname on installation from network, it
should be kept. I expect it should keep the same hostname during
reboots. I think only diskless terminals may want always obtaining
hostname on every boot. Anything storing state on local disk should want
to keep its name.

That's fine if you're creating relatively bespoke VMs. But if I want to spin up a dozen disposable systems, I kinda want them to just take on the hostname that I've already set up in DNS, execute the install routines based on their hostname, and then go away when I'm done with them.

I think more tight integration with libvirt names would be useful. I
admit I know little of that. I usually define name AFTER installation
for my VMs, which would not work with what I propose. I would like easy
way to set hostname from libvirt during installation. I don't need
always fixed IP, but I want fixed DNS name for given VM. I expect that
is common requirement.

Why would we reinvent the naming wheel? We have had a method for assigning hostnames for decades using gethostbyaddr(). Why has this changed with F35 all of a sudden?

OK, so this is weird. I just kickstarted a F35 VM. When it booted up, its hostname was host156.tc.camerontech.com, as I expected it to be.

The /etc/hostname file is blank - it just has a single empty line.

After I rebooted that VM, its hostname is set to fedora:

[root@fedora ~]# hostnamectl
   Static hostname: n/a
Transient hostname: fedora
         Icon name: computer-vm
           Chassis: vm
        Machine ID: f3c5fe2142c5461eafea7dc985903a1f
           Boot ID: 64e3a58e839744d8b5fad1f189e739a9
    Virtualization: kvm
  Operating System: Fedora Linux 35 (Thirty Five)
       CPE OS Name: cpe:/o:fedoraproject:fedora:35
            Kernel: Linux 5.15.15-200.fc35.x86_64
      Architecture: x86-64
   Hardware Vendor: QEMU
    Hardware Model: Standard PC _Q35 + ICH9, 2009_

[root@fedora ~]# hostname
fedora

So it seems that the expected behavior happens after installation, but then it is somehow changed when the first user logs in.

This is bizarre.

Thomas
_______________________________________________
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure

Reply via email to