admin 发表于 2023-9-9 15:00:01

ubuntu 经常出现创建kvm虚机时报错ERROR Cannot get interface MTU on 'br0': No such device

root@compute01:/usr/src# virt-install --name=Windows2019_x86--ram 8192 --vcpus=4 --disk path=/usr/src/Windows2019-x86.qcow2,format=qcow2,size=15,bus=virtio --accelerate --cdrom /usr/src/cn_windows_server_2019_x64_dvd_2d80e042.iso --vnc --vncport=5906 --vnclisten=0.0.0.0 --network bridge=br0,model=virtio --noautoconsole

Starting install...
ERROR    Cannot get interface MTU on 'br0': No such device
Domain installation does not appear to have been successful.
If it was, you can restart your domain by running:
virsh --connect qemu:///system start Windows2019_x86
otherwise, please restart your installation.

创建失败:有问题,检查网卡:

root@compute01:/usr/src# ip addr
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: enp8s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 00:e0:4c:68:10:89 brd ff:ff:ff:ff:ff:ff
3: enp9s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether d8:50:e6:4a:41:b2 brd ff:ff:ff:ff:ff:ff
    inet 198.192.168.66/24 brd 198.192.168.255 scope global enp9s0
       valid_lft forever preferred_lft forever
    inet6 fe80::da50:e6ff:fe4a:41b2/64 scope link
       valid_lft forever preferred_lft forever
4: enp2s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 04:25:c5:2a:57:13 brd ff:ff:ff:ff:ff:ff
    inet 192.168.8.66/24 brd 192.168.8.255 scope global enp2s0f0
       valid_lft forever preferred_lft forever
    inet6 fe80::625:c5ff:fe2a:5713/64 scope link
       valid_lft forever preferred_lft forever
5: enp2s0f1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 04:25:c5:2a:57:14 brd ff:ff:ff:ff:ff:ff
11: vnet2: <BROADCAST,MULTICAST> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
    link/ether fe:54:00:90:65:d2 brd ff:ff:ff:ff:ff:ff

重新配置网络:

root@compute01:/usr/src# netplan apply

** (generate:6407): WARNING **: 13:00:50.842: `gateway4` has been deprecated, use default routes instead.
See the 'Default routes' section of the documentation for more details.

** (process:6405): WARNING **: 13:00:51.287: `gateway4` has been deprecated, use default routes instead.
See the 'Default routes' section of the documentation for more details.

** (process:6405): WARNING **: 13:00:51.298: `gateway4` has been deprecated, use default routes instead.
See the 'Default routes' section of the documentation for more details.

** (process:6405): WARNING **: 13:00:51.684: `gateway4` has been deprecated, use default routes instead.
See the 'Default routes' section of the documentation for more details.

** (process:6405): WARNING **: 13:00:51.685: `gateway4` has been deprecated, use default routes instead.
See the 'Default routes' section of the documentation for more details.


再重试,问题解决。
root@compute01:/usr/src# virt-install --name=Windows2019_x86--ram 8192 --vcpus=4 --disk path=/usr/src/Windows2019-x86.qcow2,format=qcow2,size=15,bus=virtio --accelerate --cdrom /usr/src/cn_windows_server_2019_x64_dvd_2d80e042.iso --vnc --vncport=5906 --vnclisten=0.0.0.0 --network bridge=br0,model=virtio --noautoconsole

Starting install...
Creating domain...                                                                                                                                       |    0 B00:00:00   

Domain is still running. Installation may be in progress.
You can reconnect to the console to complete the installation process.


admin 发表于 2023-9-9 15:00:02

ubuntu server 版本经常出现这样的问题。

# lsb_release -a
No LSB modules are available.
Distributor ID:        Ubuntu
Description:        Ubuntu 22.04.2 LTS
Release:        22.04
Codename:        jammy

不太成熟的版本。
页: [1]
查看完整版本: ubuntu 经常出现创建kvm虚机时报错ERROR Cannot get interface MTU on 'br0': No such device