Ubuntu – Xen Vm install error could not find bridge device xenbr0

Ubuntuxen

I am using Xen on Ubuntu, and I want to install Ubuntu on Xen as a domU. I followed these instructions: https://help.ubuntu.com/community/Xen, Manually installing an HVM Guest VM

However I had this error parsing config from ubuntu-hvm.cfg:

libxl: error: libxl_exec.c:118:libxl_report_child_exitstatus: /etc/xen/scripts/vif-bridge online [-1] exited with error status 1
libxl: error: libxl_device.c:1116:device_hotplug_child_death_cb: script: Could not find bridge device xenbr0
libxl: error: libxl_create.c:1231:domcreate_attach_vtpms: unable to add nic devices
libxl: error: libxl_exec.c:118:libxl_report_child_exitstatus: /etc/xen/scripts/vif-bridge offline [-1] exited with error status 1
libxl: error: libxl_device.c:1116:device_hotplug_child_death_cb: script: Could not find bridge device xenbr0
libxl: error: libxl_exec.c:118:libxl_report_child_exitstatus: /etc/xen/scripts/vif-bridge remove [-1] exited with error status 1
libxl: error: libxl_device.c:1116:device_hotplug_child_death_cb: script: Could not find bridge device xenbr0

How should I modify the configurations to install ubuntu ?

Best Answer

Your error message states xen could not find a xenbr0 interface.

Make sure to create such bridge before starting your domUs.

If you have no bridges configured yet, there's a fair chance you'll need to install the following:

apt-get install bridge-utils

Then, edit your network configuration. Assuming you have some eth0 device, and want to have your virtual machines bridged on this device, we would have:

auto eth0
iface eth0 inet manual

auto xenbr0
iface xenbr0 inet static
    address your.ip.address
    bridge_fd 0
    bridge_stp off
    bridge_ports eth0
    dns-nameserver 8.8.8.8
    gateway your.gateway.address
    netmask your.netmask

Assuming you want to create this bridge on your loopback, make sure to load the dummy kernel module

modprobe dummy && echo dummy >>/etc/modules

Then, edit your network configuration:

auto dummy0
iface dummy0 inet manual
    pre-up ifconfig $IFACE up
    post-down ifconfig $IFACE down

auto xenbr0
iface xenbr0 inet static
    address ip.address.on.loopback
    bridge_ports dummy0
    bridge_fd 0
    bridge_stp off
    bridge_maxwait 0
    netmask netmask.on.loopback