I've just built a new home server running Ubuntu 19.10 Server. I want to set up several VMs on this server (using KVM) to run various services on my network on their own IP address. I'm fairly inexpert at this, so forgive me if I'm not providing the right information. The server is headless so everything is being done from the command line.
Here's what I've done so far (patched together from various how-tos on various websites);
Set up my netplan configuration like so
#/etc/netplan/50-cloud-init.yaml
network:
version: 2
renderer: networkd
ethernets:
enp8s0:
dhcp4: no
bridges:
br0:
interfaces: [enp8s0]
dhcp4: yes
parameters:
stp: false
forward-delay: 0
then run sudo netplan generate && sudo netplan --debug apply
I then create the following file host-bridge.xml
;
<network>
<name>host-bridge</name>
<forward mode="bridge"/>
<bridge name="br0"/>
</network>
then run the following commands;
virsh net-define host-bridge.xml
virsh net-start host-bridge
virsh net-autostart host-bridge
At this point, running virsh net-list --all
gives the following output;
Name State Autostart Persistent
------------------------------------------------
default active yes yes
host-bridge active yes yes
I then try to create a new VM using the host-bridge network. My understanding is that it should be able to get its own IP address from the DHCP server on my router and I should be able to SSH into it from that. This is not the case though. The VM installation stops with the message;
Network autoconfiguration failed
Your network is probably not using the DHCP protocol. Alternatively, the DHCP server may be slow or some network hardware is not working properly.
This is the command I used to create the VM;
virt-install --name=test-vm --vcpus=1 --memory=2048 --os-type linux --os-variant ubuntu19.04 --network network:host-bridge --graphics none --location 'http://archive.ubuntu.com/ubuntu/dists/eoan/main/installer-amd64/' --extra-args 'console=ttyS0,115200n8 serial'