Environment description:
host:
libvirtd (libvirt) 6.0.0
os version: 20.04.2 LTS (Focal Fossa)
guest:
os version: 20.04.2 LTS (Focal Fossa)
Problem description:
I tried to follow https://wiki.libvirt.org/page/Unable_to_connect_to_console_of_a_running_domain to enable virsh console IAS(my guest name), but failed with step 1.
When i use virsh edit to change the content in below, it will be restore back
<serial type='pty'>
<target type='isa-serial' port='0'>
<model name='isa-serial'/>
</target>
</serial>
<console type='pty'>
<target type='serial' port='0'/>
</console>
->
<serial type='pty'>
<target port='0'/>
</serial>
<console type='pty'>
<target type='serial' port='0'/>
</console>
And i am ok to do step 2 by:
guestmount -a /var/lib/libvirt/images/IAC.qcow2 -i --rw /mnt
and change below section to /boot/grub/grub.cfg
linux /vmlinuz-5.4.0-126-generic root=/dev/mapper/ubuntu--vg-ubuntu--lv rw
->
linux /vmlinuz-5.4.0-126-generic root=/dev/mapper/ubuntu--vg-ubuntu--lv rw console=ttyS0,115200
Then i tried to use virsh console, it shows like below:
root@robot:~# virsh console IAS
Connected to domain IAS
Escape character is ^]
More info
when i started the IAS, i see below log in /var/log/syslog
Jan 9 23:01:27 robot systemd[1]: Started Virtual Machine qemu-24-IAS.
Jan 9 23:01:28 robot avahi-daemon[1413]: Joining mDNS multicast group on interface vnet4.IPv6 with address fe80::fc54:ff:fe34:1154.
Jan 9 23:01:28 robot avahi-daemon[1413]: New relevant interface vnet4.IPv6 for mDNS.
Jan 9 23:01:28 robot avahi-daemon[1413]: Registering new address record for fe80::fc54:ff:fe34:1154 on vnet4.*.
Jan 9 23:01:28 robot kernel: [967891.891298] ICMPv6: RA: ndisc_router_discovery failed to add default route
Jan 9 23:01:29 robot avahi-daemon[1413]: Joining mDNS multicast group on interface vnet5.IPv6 with address fe80::fc54:ff:fe0e:2ae4.
Jan 9 23:01:29 robot avahi-daemon[1413]: New relevant interface vnet5.IPv6 for mDNS.
Jan 9 23:01:29 robot avahi-daemon[1413]: Registering new address record for fe80::fc54:ff:fe0e:2ae4 on vnet5.*.
Jan 9 23:01:29 robot kernel: [967892.856279] virbr0: port 4(vnet5) entered learning state
Jan 9 23:01:31 robot kernel: [967894.872205] virbr0: port 4(vnet5) entered forwarding state
Jan 9 23:01:31 robot kernel: [967894.872209] virbr0: topology change detected, propagating
Jan 9 23:01:35 robot kernel: [967898.303786] ICMPv6: RA: ndisc_router_discovery failed to add default route