0

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'

1 Answer 1

1

I never use kvm network features.

Always build my bridge like you did, and virt-install with --network=bridge:br0 option.

And it works fine.

2
  • Thank you for looking at this. I've tried using your bridge:br0 option and I get exactly the same error. Any other ideas?
    – brad
    Dec 30, 2019 at 11:56
  • 1
    OK. I've managed to make this work. I did as you describe and skipped all the host-bridge stuff. What I did that really made it work though, is completely reinstalled my host OS from scratch. Presumably, some earlier system fiddling had left something misconfigured that was preventing my bridge network from functioning correctly.
    – brad
    Jan 1, 2020 at 11:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .