Restart networking by entering this:
Click here to view code image
matthew@seymour:~$ sudo /etc/init.d/networking restart
Finally, you need to create guest VMs that use this bridged network.
Manually define your guest OS to use the new br0 interface, as you
usually would in that operating system.
There are several ways to create VMs for use with KVM. One way is to use
vmbuilder. This is a Python script that is best for servers on which you
intend to run a specialized, very light Ubuntu server variant that includes a
tuned kernel with only the base elements necessary to run as a virtual server,
especially under KVM and VMware. Install python-vm-builder to get
the package. You run vmbuilder from the command line with two
necessary parameters: the virtualization software and the distribution you will
run. However, there are tons of useful options and customizations available.
Here is an example that builds a VM for KVM from the 18.04 (Bionic
Beaver) release of Ubuntu, using the virtual flavor in an amd64 architecture
while overwriting any previous edition of the VM, instructing libvirt to
inform the local virtualization environment to add the resulting VM to the list
of available virtual machines, give the new VM a specific IP address and the
hostname lovelace, and use the br0 bridge interface (Phew! That’s a lot
in one command!):
Click here to view code image
matthew@seymour:~$ sudo vmbuilder kvm ubuntu --suite bionic --flavour
virtual -–arch
amd64 -o --libvirt qemu:///system --ip 192.168.0.100 --hostname
lovelace
--bridge br0
You can learn more from the help file:
Click here to view code image
matthew@seymour:~$ vmbuilder kvm ubuntu --help
Because vmbuilder is so specialized, here we focus on using the tools from
virtinst as they are more likely to appeal to a general audience. However,
if you are looking to create server VMs to run on a KVM or VMware
installation, you definitely want to explore vmbuilder more fully.
However, you might not need to do so. A set of official prebuilt and Ubuntu-
supported VM images are available for download at http://cloud-
images.ubuntu.com. These are the exact images that Ubuntu uses in EC2.
virtinst consists of several tools. Here we focus on two: virt-