Ah ... just saw that you are using 18.04. None of this applies, since they decided to switch to netplan. You'll need to figure that out. Sorry.
But for 16.04 and earlier, this will work:
I've been using KVM + virt-manager for 8+ yrs, but have never used the built-in bridges. I always setup a manual bridge for each VM on the hostOS first. All those years ago, this was required to avoid really poor performance. I've never changed. Sometimes, for play VMs, I'll use the built-in NAT interface.
With a hostOS bridge, the host also uses it unless you have multiple physical NICs.
For example, on the hostOS
Code:
$ ifconfig
br0 Link encap:Ethernet HWaddr 80:ee:73:yy:xx:b6
inet addr:172.22.22.6 Bcast:172.22.22.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:74130438 errors:0 dropped:0 overruns:0 frame:0
TX packets:43693399 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:267586003268 (267.5 GB) TX bytes:169028542669 (169.0 GB)
And some of the /etc/network/interfaces:
Code:
# ####################################
auto eth0
iface eth0 inet manual
auto br0
iface br0 inet static
address 172.22.22.6
gateway 172.22.22.1
netmask 255.255.255.0
dns-nameservers 1.1.1.1 208.67.220.220
bridge_ports eth0
bridge_fd 9
bridge_hello 2
bridge_maxage 12
bridge_stp off
Then inside virt-manager, the VMs use br0. They can get DHCP IPs from the network DHCP server or have static IPs following the normal static IP rules for all networks.
There's a manpage which describes the different options: man bridge-utils-interfaces
If you choose to go this direction, be certain to disable the bridge you setup inside libvirt.
Bookmarks