virt-install
기본 설치를 생성하는 데 어떻게 사용할 수 있습니까 ?
$ cat kvm/install_example
virt-install \
--name AsteriskNOW \
--ram=2048 \
--vcpus=2 \
--disk pool=default,size=30,bus=virtio,format=qcow2 \
--cdrom /home/thufir/Downloads/AsteriskNow-1013-current-64.iso \
--network bridge=kvmbr0,model=virtio \
--graphics vnc,listen=0.0.0.0,password=Qwerty1234 \
--boot cdrom,hd,menu=on
$ ./kvm/install_example
WARNING No operating system detected, VM performance may suffer. Specify an OS with --os-variant for optimal results.
Starting install...
Allocating 'AsteriskNOW.qcow2' | 30 GB 00:00:00
ERROR Cannot get interface MTU on 'kvmbr0': No such device
Removing disk 'AsteriskNOW.qcow2' | 0 B 00:00:00
Domain installation does not appear to have been successful.
If it was, you can restart your domain by running:
virsh --connect qemu:///system start AsteriskNOW
otherwise, please restart your installation.
$ virsh --connect qemu:///system start AsteriskNOW
error: failed to get domain 'AsteriskNOW'
error: Domain not found: no domain with matching name 'AsteriskNOW'
브리지를 설치해야 합니까?
$ virsh net-list --all
Name State Autostart Persistent
----------------------------------------------------------
default active yes yes
$ brctl show
bridge name bridge id STP enabled interfaces
docker0 8000.02429143faf6 no
virbr0 8000.52540020bae1 yes virbr0-nic
$ brctl show virbr0
bridge name bridge id STP enabled interfaces
virbr0 8000.52540020bae1 yes virbr0-nic
$ ifconfig
docker0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 172.17.0.1 netmask 255.255.0.0 broadcast 0.0.0.0
ether 02:42:91:43:fa:f6 txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eno1: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether c8:9c:dc:28:86:ca txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 20 memory 0xfe700000-fe720000
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 11162 bytes 994283 (994.2 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 11162 bytes 994283 (994.2 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
ether 52:54:00:20:ba:e1 txqueuelen 1000 (Ethernet)
RX packets 32 bytes 2988 (2.9 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 68 bytes 6154 (6.1 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlx74da3889c88b: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.5 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::cde:e1f7:5175:b3c0 prefixlen 64 scopeid 0x20<link>
ether 74:da:38:89:c8:8b txqueuelen 1000 (Ethernet)
RX packets 1188126 bytes 1537049311 (1.5 GB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 744516 bytes 72479274 (72.4 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
가이드만 내가 그것을 사용하고 있다고 가정하는 것 같습니다 . eth0
실제로 wi-fi
는 이것이 어떻게 변할까요 /etc/network/interfaces
?
$ cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
답변1
ERROR Cannot get interface MTU on 'kvmbr0': No such device
libvirt 데몬을 다시 시작하여 문제를 해결했습니다.
sudo systemctl restart libvirtd
최신 배포판의 경우 libvirt를 사용하세요.
답변2
변화
--network bridge=kvmbr0,model=virtio \
도착하다:
--network bridge=virbr0,model=virtio \
ifconfig
명령 출력에서 볼 수 있듯이 . 브리지는 기존 가상 인터페이스를 가리켜야 합니다.