My VMs don't get IP with libvirt and dnsmasq

Computers Issues computerslover123 at gmail.com
Fri Apr 17 07:58:57 UTC 2020


Hi!

First, thanks for answering.

Yes, the network is already started, and I think I have installed the tools
needed (as I previously installed qemu, qemu-kvm, libvirt-bin, bridge
utils, virt-manager and stuff), so I think I get them. About the bridge,
yeah! The vribr2 exists and is created once I use the virsh commands I said
in the previous message, And, if I use the brctl show commands, I see that
my VM's interface is already attached to the bridge, so that's why I do not
understand what can be happening.

Thanks!

<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Libre
de virus. www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

El vie., 17 abr. 2020 a las 3:05, Daniel Romero (<romero.cl at gmail.com>)
escribió:

> Hi,
>
> I've seen this before.
>
> First,  the simple steps:
>
> have you started that network? (virsh start network-name)
> do you have installed the tools to work with bridges in your OS?
> can you check if the bridge exist in your OS and if the vm's interface is
> attached to it? In rhel you use the command brctl to do that, don't know
> about ubuntu...
>
>
> Best Regards,
> DR
>
>
> On Thu, Apr 16, 2020 at 7:32 PM Computers Issues <
> computerslover123 at gmail.com> wrote:
>
>> Hello there,
>>
>> I wanted to share a problem I'm having with libvirt, for the case someone
>> here could know how to solve it.
>>
>> I'm using an Ubuntu 18.04 LTS, I have libvirtd already installed and I
>> think I got all the dependencies installed. So, I'm using virsh net-create
>> to create this network:
>>
>> <network>
>>     <name>pepito</name>
>>     <forward mode='nat'/>
>>     <bridge name='virbr2' stp='on' delay='0'/>
>>     <ip address='192.168.150.1' netmask='255.255.255.0'>
>>         <dhcp>
>>             <range start='192.168.150.2' end='192.168.150.254'/>
>>         </dhcp>
>>     </ip>
>> </network>
>>
>> And then I create a domain with this xml:
>>
>> <domain type='qemu' xmlns:qemu='
>> http://libvirt.org/schemas/domain/qemu/1.0'>
>>   <name>ARM</name>
>>   <memory unit='KiB'>262144</memory>
>>   <currentMemory unit='KiB'>262144</currentMemory>
>>   <os>
>>     <type arch='armv7l' machine='virt-2.9'>hvm</type>
>>     <kernel>~/zImage</kernel>
>>     <cmdline>console=ttyAMA0 root=/dev/vda</cmdline>
>>     <boot dev='hd'/>
>>   </os>
>>
>>   <on_poweroff>destroy</on_poweroff>
>>   <on_reboot>restart</on_reboot>
>>   <on_crash>destroy</on_crash>
>>   <devices>
>>     <emulator>/usr/bin/qemu-system-aarch64</emulator>
>>       <disk type='file' device='disk'>
>>       <driver name='qemu' type='qcow2'/>
>>       <source file=' ~/rootfs.qcow2'/>
>>       <target dev='hda' bus='virtio'/>
>>       </disk>
>>     <controller type='virtio-serial' index='0'>
>>       <address type='virtio-mmio'/>
>>     </controller>
>>     <interface type='network'>
>>       <mac address='52:54:00:09:a4:37'/>
>>       <model type='virtio'/>
>>       <source network='pepito'/>
>>       <address type='virtio-mmio'/>
>>     </interface>
>>  </devices>
>> <qemu:commandline>
>>   <qemu:arg value='-device'/>
>>         <qemu:arg value='virtio-net-pci'/>
>>         <qemu:arg value='-netdev'/>
>>         <qemu:arg value='user,id=net1'/>
>>   </qemu:commandline>
>> </domain>
>>
>> They both work as I created them in a different computer and everything
>> works. But I'm trying it on my other Ubuntu machine, and once virsh creates
>> the network and the domain, my VM never get an IP from that DHCP range.
>> This is libvirtd log:
>>
>> abr 17 00:48:11 usuario-System-Product-Name dnsmasq-dhcp[13741]: DHCP, IP
>> range 192.168.150.2 -- 192.168.150.254, lease time 1h
>> abr 17 00:48:11 usuario-System-Product-Name dnsmasq-dhcp[13741]: DHCP,
>> sockets bound exclusively to interface virbr2
>> abr 17 00:48:11 usuario-System-Product-Name dnsmasq[13741]: reading
>> /etc/resolv.conf
>> abr 17 00:48:11 usuario-System-Product-Name dnsmasq[13741]: using
>> nameserver 127.0.0.53#53
>> abr 17 00:48:11 usuario-System-Product-Name dnsmasq[13741]: read
>> /etc/hosts - 7 addresses
>> abr 17 00:48:11 usuario-System-Product-Name dnsmasq[13741]: read
>> /var/lib/libvirt/dnsmasq/pepito.addnhosts - 0 addresses
>> abr 17 00:48:11 usuario-System-Product-Name dnsmasq-dhcp[13741]: read
>> /var/lib/libvirt/dnsmasq/pepito.hostsfile
>>
>>
>> Does anybody know why it could be that the VM never gets an IP from the
>> range I defined? As I said, exactly the same configuration worked in a
>> different machine, I don't know why it does not work here.
>>
>> Thank you so much!!
>>
>>
>> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> Libre
>> de virus. www.avast.com
>> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
>> <#m_1529389328306967443_m_-9208904238504833900_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20200417/0b742bee/attachment.htm>


More information about the libvirt-users mailing list