If you have a notebook and you want to quickly deploy new virtual machines for testing, PXE boot is your friend.
On notebooks people are usally not using a bridged network but NAT instead. The DHCP server on the host that is managed by Libvirt needs to configured with the TFTP server and the boot file.
On my “mobile lab”, I’ve installed a virtual machine with a Redhat Satellite 5 where the other VMs get its content from. PXE boot files are managed by the bundled Cobbler Server.
To do so, edit the XML file of the default network (or any other NAT network):
notebook-hv:~# virsh net-edit default
Add the red marked line to the file. Replace 192.168.122.122 with the actual IP address of your PXE/TFTP server.
<network> <name>default</name> <uuid>d54b7049-254b-46b0-b434-db2a1481cbd3</uuid> <forward mode='nat'/> <bridge name='virbr0' stp='on' delay='0'/> <mac address='52:54:00:96:21:b5'/> <ip address='192.168.122.1' netmask='255.255.255.0'> <dhcp> <range start='192.168.122.2' end='192.168.122.254'/> <bootp file='pxelinux.0' server='192.168.122.122'/> </dhcp> </ip> </network>
And save it. The changes are with immediate effect, happy PXE-booting đŸ™‚
Hello,
I try this but doesn’t work.
I have 2 vm on kvm one is the pxe-server configured like this:
https://www.linuxtechi.com/configure-pxe-installation-server-centos-7/
the other machine is the pxe-client I have both machines on Virtual Network ‘default’ NAT
The PXE menu it’s showed on the screen but don’t boot the installation, count 3 to 1 and start again.
What could be it?
Hi,
If the PXE menu appears, that means that DHCP, PXE and TFTP is working correctly. You should look at the PXE configuration files in /var/lib/tftpboot/pxelinux.cfg/
Hope that helps…