Hi, I would like to set the hostname when installing a guest, with the below command the hostname is not set to 'try06' in the guest: virt-install --name=try06 --graphic none --pxe --network bridge=virbr0 How can I set the hostname of the guest during installation time? I realy appriciate the support I'm getting in here, I'm fairly new to libvirt. -- John Doe
On 27. 3. 2020 14:57, john doe wrote:> Hi, > > I would like to set the hostname when installing a guest, with the below > command the hostname is not set to 'try06' in the guest: > > virt-install --name=try06 --graphic none --pxe --network bridge=virbr0This is the name of the guest registered in libvirt. I don't think that virt-install has wired up setting hostname, but it looks like it can do it. I mean, use --name for both libvirt name and guest hostname. Michal
On 27. 3. 2020 16:48, Michal Prívozník wrote:> On 27. 3. 2020 14:57, john doe wrote: >> Hi, >> >> I would like to set the hostname when installing a guest, with the below >> command the hostname is not set to 'try06' in the guest: >> >> virt-install --name=try06 --graphic none --pxe --network bridge=virbr0 > > This is the name of the guest registered in libvirt. I don't think that > virt-install has wired up setting hostname, but it looks like it can do > it. I mean, use --name for both libvirt name and guest hostname.On the other hand, users might want to set it to something else. So we really should have a separate argument for that. Anyway, I've reported it to virt-install developers: https://github.com/virt-manager/virt-manager/issues/94 Michal
On Fri, 2020-03-27 at 16:48 +0100, Michal Prívozník wrote:> On 27. 3. 2020 14:57, john doe wrote: > > Hi, > > > > I would like to set the hostname when installing a guest, with the below > > command the hostname is not set to 'try06' in the guest: > > > > virt-install --name=try06 --graphic none --pxe --network bridge=virbr0 > > This is the name of the guest registered in libvirt. I don't think that > virt-install has wired up setting hostname, but it looks like it can do > it. I mean, use --name for both libvirt name and guest hostname.Note that, while virt-install might be modified to automatically set the hostname in cases where it has full control of the installation process (--unattended), in the general case the user is performing the installation steps themselves in the context of the guest and virt-install has no way of knowing, or influencing, what happens there. -- Andrea Bolognani / Red Hat / Virtualization