Setting up a PXE server
You will need to install and configure the following components:
- TFTP server. This is a machine that allows your servers to boot and install Virtuozzo Hybrid Infrastructure over the network. Any machine that can run Linux and is accessible over network can be a TFTP server.
- DHCP server. This is a standard DHCP machine serving TCP/IP settings to computers on your network.
-
HTTP server. This is a machine serving Virtuozzo Hybrid Infrastructure installation files over a network.
You can also share Virtuozzo Hybrid Infrastructure distribution over a network via FTP (for example, with
vsftpd
) or NFS.
To install PXE components
Run the following command:
# yum install tftp-server syslinux httpd dhcp
You can also use servers that already exist in your infrastructure. For example, skip httpd
and dhcp
if you already have the HTTP and DHCP servers.
To set up the TFTP server
-
On the server, open the /etc/xinetd.d/tftp file, and edit it as follows:
service tftp
{
disable = no
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -v -s /tftpboot
per_source = 11
cps = 100 2
flags = IPv4
}Once you are done, save the file.
-
Create the /tftpboot directory and copy the following files to it: vmlinuz, initrd.img, menu.c32, pxelinux.0.
These files are necessary to start installation. You can find the first two in the /images/pxeboot directory of the Virtuozzo Hybrid Infrastructure distribution. The last two files are located in the syslinux directory (usually /usr/share/syslinux or /usr/lib/syslinux).
-
Create the /tftpboot/pxelinux.cfg directory and make the default file in it.
# mkdir /tftpboot/pxelinux.cfg # touch /tftpboot/pxelinux.cfg/default
-
Add the following lines to default:
default menu.c32 prompt 0
timeout 100
ontimeout INSTALL
menu title Boot Menu
label INSTALL
menu label Install
kernel vmlinuz
append initrd=initrd.img ip=dhcpFor detailed information on parameters you can specify in this file, refer to the documentation for
syslinux
. -
Restart the
xinetd
service:# /etc/init.d/xinetd restart
-
If necessary, configure the firewall to allow access to the TFTP server (on port 69 by default).
When running the TFTP server, you might get the “Permission denied” error. In this case, you may try to fix the problem by running the following command:
# restorecon -Rv /tftboot/
.
To set up the DHCP server
Add the following strings to the dhcpd.conf file, which is usually located in the /etc or /etc/dhcp directory:
next-server <PXE_server_IP_address>;
filename "/pxelinux.0";
To configure a DHCP server for installation on EFI-based systems, specify filename "/bootx64.efi"
instead of filename "/pxelinux.0"
in the dhcpd.conf file, where /bootx64.efi is the directory to which you copied the EFI boot images when setting up the TFTP server.
To make the distribution files available on the HTTP server
- Set up an HTTP server (or configure the one you already have).
- Copy the contents of the distribution image to a directory on the HTTP server (for example, /var/www/html/distrib).
-
On the PXE server, specify the path to the installation files in the
append
line of the /tftpboot/pxelinux.cfg/default file.For EFI-based systems, the file you need to edit has the name of /tftpboot/pxelinux.cfg/efidefault or /tftpboot/pxelinux.cfg/<PXE_server_IP_address>.
Assuming that the HTTP server is at 198.123.123.198, the installation files are in /var/www/html/distrib/, and DocumentRoot is set to /var/www/html, the default file may look like this:
default menu.c32
prompt 0
timeout 100
ontimeout INSTALL
menu title Boot Menu
label INSTALL
menu label Install
kernel vmlinuz
append initrd=initrd.img ip=dhcp inst.repo=http://198.123.123.198/distrib