HassOS QCOW2 don't get IP on Ubuntu Server 20.04 KVM

I installed VM and start image hassos_ova-5.9.qcow2 via this manual.

virt-install --import --name ha \
--memory 4096 --vcpus 4 --cpu host \
--disk hassos_ova-5.9.qcow2,format=qcow2,bus=virtio \
--network bridge=br0,model=virtio \
--os-variant=rhel8.1 \
--graphics none \
--noautoconsole \
--boot uefi

But after start nothing happened. No new DHCP-request on my Mikrotik and I don’t understand what to check.
Something is going on.

root@7th-server:/# virsh list
 Id   Name   State
----------------------
 2    ha     running

New interface vnet0 is appeared.

root@7th-server:/# brctl show
bridge name     bridge id               STP enabled     interfaces
br0             8000.309c2302eb56       yes             enp2s0
                                                        vnet0
docker0         8000.0242a749cc3c       no              veth2fa776d
virbr0          8000.525400d65b5c       yes             virbr0-nic
root@7th-server:/# virsh net-list --all
 Name      State    Autostart   Persistent
--------------------------------------------
 default   active   yes         yes
root@7th-server:/# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br0 state UP group default qlen 1000
    link/ether 30:9c:23:02:eb:56 brd ff:ff:ff:ff:ff:ff
3: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 30:9c:23:02:eb:56 brd ff:ff:ff:ff:ff:ff
    inet 192.168.7.2/24 brd 192.168.7.255 scope global dynamic br0
       valid_lft 246507sec preferred_lft 246507sec
    inet6 fe80::329c:23ff:fe02:eb56/64 scope link
       valid_lft forever preferred_lft forever
4: docker0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
    link/ether 02:42:a7:49:cc:3c brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
       valid_lft forever preferred_lft forever
    inet6 fe80::42:a7ff:fe49:cc3c/64 scope link
       valid_lft forever preferred_lft forever
6: veth2fa776d@if5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master docker0 state UP group default
    link/ether 9e:36:6c:22:9b:2c brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet6 fe80::9c36:6cff:fe22:9b2c/64 scope link
       valid_lft forever preferred_lft forever
7: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether 52:54:00:d6:5b:5c brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
       valid_lft forever preferred_lft forever
8: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc fq_codel master virbr0 state DOWN group default qlen 1000
    link/ether 52:54:00:d6:5b:5c brd ff:ff:ff:ff:ff:ff
10: vnet0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br0 state UNKNOWN group default qlen 1000
    link/ether fe:54:00:84:4d:da brd ff:ff:ff:ff:ff:ff
    inet6 fe80::fc54:ff:fe84:4dda/64 scope link
       valid_lft forever preferred_lft forever

Console to VM not working

~$ virsh console hassos
Connected to domain hassos
Escape character is ^]

What can I check?

Perhaps add Spice support to the VM, then use virt-viewer to connect to the console to see what is happening.

https://people.freedesktop.org/~teuf/spice-doc/html/ch02s03.html

Enter the following…what does the following show? $virsh net-list --all

root@7th-server:/# virsh net-list --all
 Name      State    Autostart   Persistent
--------------------------------------------
 default   active   yes         yes

I use virt-manager in my setup, so a little different, but for your output from $virsh net-list --all it appears that only the default bridge is known.
In my setup I had the same thing but I added br0 to this.

Try the following:

  1. Edit file /tmp/br0.xml with the following content:
      <network>
        <name>br0</name>
        <forward mode="bridge"/>
        <bridge name="br0" />
      </network>
  1. Then do:
    $sudo virsh net-define /tmp/br0.xml

Hopefully will return something like: Network br0 defined from /tmp/br0.xml

This creates/puts the file in /etc/libvirt/qemu/networks/br0.xml

  1. Now do:
    $sudo virsh net-list --all

Hopefully will show something like:

     virsh net-list --all
     Name      State      Autostart   Persistent
    ----------------------------------------------
     br0       inactive   no          yes
     default   active     yes         yes
  1. Now activate br0:
    $ sudo virsh net-start br0

Hopefull will return something like: Network br0 started

So now should see:

    $ virsh net-list --all
      Name      State    Autostart   Persistent
     --------------------------------------------
      br0       active   no          yes
      default   active   yes         yes
  1. Set br0 to auto-restart
$ virsh net-autostart br0
      Network br0 marked as autostarted

Should now see:

    $ virsh net-list --all
      Name      State    Autostart   Persistent
     --------------------------------------------
      br0       active   yes         yes
      default   active   yes         yes

From here I’m a less certain about how to use virt-install (as I use virt-manager).
I don’t know if virtio will work as the network model. You can try it out. In my setup it uses a NIC e1000. so maybe can also try:
--network bridge=br0,model=e1000 \

Thank you for your help!

root@7th-server:/home/seventh# virsh net-define /tmp/br0.xml
Network br0 defined from /tmp/br0.xml

root@7th-server:/home/seventh# cat /tmp/br0.xml
      <network>
        <name>br0</name>
        <forward mode="bridge"/>
        <bridge name="br0" />
      </network>

root@7th-server:/home/seventh# cat /etc/libvirt/qemu/networks/br0.xml
<!--
WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
OVERWRITTEN AND LOST. Changes to this xml configuration should be made using:
  virsh net-edit br0
or other application using the libvirt API.
-->

<network>
  <name>br0</name>
  <uuid>72ca6a22-e06d-4e27-beb3-66efaeeafccb</uuid>
  <forward mode='bridge'/>
  <bridge name='br0'/>
</network>

root@7th-server:/home/seventh# virsh net-list --all
 Name      State      Autostart   Persistent
----------------------------------------------
 br0       inactive   no          yes
 default   active     yes         yes

root@7th-server:/home/seventh# virsh net-start br0
Network br0 started

root@7th-server:/home/seventh# virsh net-list --all
 Name      State    Autostart   Persistent
--------------------------------------------
 br0       active   no          yes
 default   active   yes         yes

root@7th-server:/home/seventh#  virsh net-autostart br0
Network br0 marked as autostarted

root@7th-server:/home/seventh# virsh shutdown
error: command 'shutdown' requires <domain> option
root@7th-server:/home/seventh# virsh shutdown ha
Domain ha is being shutdown

root@7th-server:/home/seventh# virsh shutdown --domain ha
error: Failed to shutdown domain ha
error: Requested operation is not valid: domain is not running

root@7th-server:/home/seventh# virsh destroy ha
error: Failed to destroy domain ha
error: Requested operation is not valid: domain is not running

root@7th-server:/home/seventh# virsh destroy --domain ha
error: Failed to destroy domain ha
error: Requested operation is not valid: domain is not running

root@7th-server:/home/seventh# virsh undefine --nvram "ha"
Domain ha has been undefined

root@7th-server:/home/seventh# virsh undefine --domain ha
error: failed to get domain 'ha'

root@7th-server:/home/seventh# cd /var/lib/libvirt/images/hassos-vm
root@7th-server:/var/lib/libvirt/images/hassos-vm# ls -l
итого 1840956
-rw-r--r-- 1 root root 2803367936 дек 21 20:55 hassos_ova-5.9.qcow2
root@7th-server:/var/lib/libvirt/images/hassos-vm# virt-install --import --name ha \
> --memory 4096 --vcpus 4 --cpu host \
> --disk hassos_ova-5.9.qcow2,format=qcow2,bus=virtio \
> --network bridge=br0,model=e1000  \
> --os-variant=rhel8.1 \
> --graphics none \
> --noautoconsole \
> --boot uefi

Starting install...
Domain creation completed.
root@7th-server:/var/lib/libvirt/images/hassos-vm# virsh net-list --all
 Name      State    Autostart   Persistent
--------------------------------------------
 br0       active   yes         yes
 default   active   yes         yes


root@7th-server:/var/lib/libvirt/images/hassos-vm# ps aux | grep qemu
libvirt+  124645 25.6 12.6 6982524 1014360 ?     Sl   20:57   0:41 /usr/bin/qemu-system-x86_64 -name guest=ha,debug-threads=on -S -object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain-4-ha/master-key.aes -blockdev {"driver":"file","filename":"/usr/share/OVMF/OVMF_CODE.fd","node-name":"libvirt-pflash0-storage","auto-read-only":true,"discard":"unmap"} -blockdev {"node-name":"libvirt-pflash0-format","read-only":true,"driver":"raw","file":"libvirt-pflash0-storage"} -blockdev {"driver":"file","filename":"/var/lib/libvirt/qemu/nvram/ha_VARS.fd","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"} -blockdev {"node-name":"libvirt-pflash1-format","read-only":false,"driver":"raw","file":"libvirt-pflash1-storage"} -machine pc-q35-4.2,accel=kvm,usb=off,dump-guest-core=off,pflash0=libvirt-pflash0-format,pflash1=libvirt-pflash1-format -cpu Skylake-Client-IBRS,ss=on,vmx=on,hypervisor=on,tsc-adjust=on,clflushopt=on,umip=on,md-clear=on,stibp=on,arch-capabilities=on,ssbd=on,xsaves=on,pdpe1gb=on,ibpb=on,amd-stibp=on,amd-ssbd=on,skip-l1dfl-vmentry=on,pschange-mc-no=on,hle=off,rtm=off -m 4096 -overcommit mem-lock=off -smp 4,sockets=4,cores=1,threads=1 -uuid e942166e-82ba-4b3b-84f8-df6376ba880b -display none -no-user-config -nodefaults -chardev socket,id=charmonitor,fd=31,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc,driftfix=slew -global kvm-pit.lost_tick_policy=delay -no-hpet -no-shutdown -global ICH9-LPC.disable_s3=1 -global ICH9-LPC.disable_s4=1 -boot strict=on -device pcie-root-port,port=0x8,chassis=1,id=pci.1,bus=pcie.0,multifunction=on,addr=0x1 -device pcie-pci-bridge,id=pci.2,bus=pci.1,addr=0x0 -device pcie-root-port,port=0x9,chassis=3,id=pci.3,bus=pcie.0,addr=0x1.0x1 -device pcie-root-port,port=0xa,chassis=4,id=pci.4,bus=pcie.0,addr=0x1.0x2 -device pcie-root-port,port=0xb,chassis=5,id=pci.5,bus=pcie.0,addr=0x1.0x3 -device pcie-root-port,port=0xc,chassis=6,id=pci.6,bus=pcie.0,addr=0x1.0x4 -device pcie-root-port,port=0xd,chassis=7,id=pci.7,bus=pcie.0,addr=0x1.0x5 -device pcie-root-port,port=0xe,chassis=8,id=pci.8,bus=pcie.0,addr=0x1.0x6 -device qemu-xhci,p2=15,p3=15,id=usb,bus=pci.3,addr=0x0 -device virtio-serial-pci,id=virtio-serial0,bus=pci.4,addr=0x0 -blockdev {"driver":"file","filename":"/var/lib/libvirt/images/hassos-vm/hassos_ova-5.9.qcow2","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"} -blockdev {"node-name":"libvirt-1-format","read-only":false,"driver":"qcow2","file":"libvirt-1-storage","backing":null} -device virtio-blk-pci,scsi=off,bus=pci.5,addr=0x0,drive=libvirt-1-format,id=virtio-disk0,bootindex=1 -netdev tap,fd=33,id=hostnet0 -device e1000,netdev=hostnet0,id=net0,mac=52:54:00:48:17:9d,bus=pci.2,addr=0x1 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -chardev socket,id=charchannel0,fd=34,server,nowait -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 -device virtio-balloon-pci,id=balloon0,bus=pci.6,addr=0x0 -object rng-random,id=objrng0,filename=/dev/urandom -device virtio-rng-pci,rng=objrng0,id=rng0,bus=pci.7,addr=0x0 -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny -msg timestamp=on

Nothing new. Silence in mikrotik logs, no new DHCP leases :frowning:

I used too many manuals, maybe some error deeper in the OS :frowning: