View previous topic :: View next topic |
Author |
Message |
kukibl Apprentice
Joined: 10 Jun 2008 Posts: 237
|
Posted: Mon Aug 01, 2022 8:52 pm Post subject: Fedora VM guest picks hostname from another VM - how?! |
|
|
Hi guys.
I have the main (= non-throwaway) VM guest (Arch) with the host name - mojito. My Gentoo install is the host. I use simple script to run the VMs using Qemu:
Code: |
#!/bin/bash
qemu-system-x86_64 \
-enable-kvm \
-M q35 \
-smp 4 \
-m 6G \
-cpu host \
-bios /usr/share/edk2-ovmf/OVMF_CODE.fd \
-net nic,model=virtio-net-pci,netdev=net0 \
-netdev bridge,br=virbr0,id=net0 \
-cdrom $2 \
-hda $1 \
-device virtio-vga-gl \
-vga none \
-display gtk,gl=on,show-cursor=on \
-usb -device usb-tablet \
-audiodev pa,id=audio0 \
-device intel-hda -device hda-duplex,audiodev=audio0 \
-device virtio-rng-pci,rng=rng0 \
-object rng-random,id=rng0,filename=/dev/urandom
|
I also have virt-manager/libvirt (virt-manager I do not use, but libvirt service is enabled). This evening I launched a clean Fedora VM: made the new qcow2 image with qemu-img, used "Everyhing netinstall" ISO and picked Workstation. What surprised me is that after the first boot, the new machine had set "mojito" host-name... already.
I did not do it obviously (you do not set a hostname during install process). The other VM was not running at all... How is this possible?
My first assumption was that it is related to libvirt and shared virbr0 bridge interface, but I am not sure what and where to look for. |
|
Back to top |
|
|
alamahant Advocate
Joined: 23 Mar 2019 Posts: 3879
|
Posted: Mon Aug 01, 2022 10:21 pm Post subject: |
|
|
Ok
plz do this
Code: |
grep -ir domain /etc/libvirt/qemu/networks
|
If you see in one of the xml files something like
Code: |
<domain name="mojito"/>
|
you will know the culprit.
Similarly in virt-manager interface
Code: |
Edit-> Connection Details -> Virtual Networks ->XML
|
you can see the above clause.
Stop the network if running,edit the xml to remove the clause,apply and done.
Or simpler edit directly the file. _________________
|
|
Back to top |
|
|
kukibl Apprentice
Joined: 10 Jun 2008 Posts: 237
|
Posted: Tue Aug 02, 2022 10:03 am Post subject: |
|
|
alamahant,
Thank you very much. That is it. There was mojito.xml, I assume it was set through virt-manager, because the VM was originally made with it. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|