Installation guide

Chapter 15. Network booting with libvirt
Guest virtual machines can be booted with PXE enabled. PXE allows guest virtual machines to boot
and load their configuration off the network itself. This section demonstrates some basic
configuration steps to configure PXE guests with libvirt.
This section does not cover the creation of boot images or PXE servers. It is used to explain how to
configure libvirt, in a private or bridged network, to boot a guest virtual machine with PXE booting
enabled.
Warning
These procedures are provided only as an example. Ensure that you have sufficient backups
before proceeding.
15.1. Preparing t he boot server
To perform the steps in this chapter you will need:
A PXE Server (DHCP and TFTP) - This can be a libvirt internal server, manually-configured dhcpd
and tftpd, dnsmasq, a server configured by Cobbler, or some other server.
Boot images - for example, PXELINUX configured manually or by Cobbler.
15.1.1. Set t ing up a PXE boot server on a privat e libvirt net work
This example uses the default network. Perform the following steps:
Pro ced u re 15.1. Co n f ig u ring t h e PXE b o o t server
1. Place the PXE boot images and configuration in /var/l i b/tftp.
2. Run the following commands:
# virsh net-destroy default
# virsh net-edit default
3. Edit the <i p> element in the configuration file for the default network to include the
appropriate address, network mask, DHCP address range, and boot file, where
BOOT_FILENAME represents the file name you are using to boot the guest virtual machine.
<ip address='192.168.122.1' netmask='255.255.255.0'>
<tftp root='/var/lib/tftp' />
<dhcp>
<range start='192.168.122.2' end='192.168.122.254' />
<bootp file='BOOT_FILENAME' />
</dhcp>
</ip>
4. Boot the guest using PXE (refer to Section 15.2, “ Booting a guest using PXE ).
15.2. Boot ing a guest using PXE
Red Hat Ent erp rise Linux 6 Virt ualiz at ion Host Configurat ion and G uest Inst allat ion G uide
118