2014-05-30

PXE Server, stands for preboot execution environment, is used to enable a network computer to boot only from a network interface card. This method will be very helpful, if a System Administrator wants to install many systems which doesn’t have a CD/DVD device on the network. PXE environment needs a DHCP server that distributes the IP addresses to the client systems, and a TFTP server that downloads the installation files to the PXE clients. You don’t need any CD/DVD or USB bootable drives to install client systems. Just, copy the ISO images on the PXE server and start installing your Linux clients via network using PXE server.

Scenario

My test box(pxe server) details are given below:

OS: CentOS 6.5 Minimal Installation.

IP Address: 192.168.1.150/24.

SELinux disabled on PXE server.

IP tables stopped on PXE server.

In this tutorial, we are going to setup PXE server On CentOS 6.5 server, and install CentOS 6.5 32bit edition on our client system using the PXE server.

Installation

First, you should Install and configure DHCP server on your PXE server. To install and configure DHCP server, refer the following link:

Install DHCP Server On CentOS 6.5

Now, install the following packages for setting up PXE environment:

Configure PXE Server

Copy the following TFTP configuration files to the /var/lib/tftpboot/ directory.

Edit file /etc/xinetd.d/tftp

Enable TFTP server. To d this, change “disable=yes” to “no”.

Next, create a directory to store CentOS installation ISO image. and mount the image to that directory as shown below. I have CentOS 6.5 32bit ISO image on my /root directory.

Note: If you want to install CentOS 64bit edition, make a relevant directory called centos6_x86_64 (/var/lib/tftpboot/centos6_x86_64).

Create a apache configuration file for PXE server under /etc/httpd/conf.d/ directory:

Add the following lines:

Save and close the file.

Then, create a configuration directory for PXE server:

Now, create PXE server configuration file under the pxelinux.cfg:

Add the following lines:

Save and close the file.

Configure DHCP Server

Now, we have to configure the DHCP server to work with PXE server.

Edit file /etc/dhcp/dhcpd.conf,

Add the following lines at the end:

Save and close the file.

Now, We have come to the end of PXE server configuration. Restart all the services to complete the configuration.

Congratulations! We have completed the PXE server configuration.

PXE Client Configuration

The client may be any system that has network boot enabled option (PXE boot). You can enable this option in your Bios settings.

Due to lack of resources, I have created a Virtual Machine client on my Oracle VirtualBox.

Open up the Oracle VirtualBox. Click on the New button in the menu bar.



Enter the Virtual machine name.



Enter the RAM size to the Virtual machine.



Select “Create a virtual hard drive now” option and click Create.

Select the Virtual hard drive file type. If you don’t know to what to select, leave the default option and click Next.

Select whether the new virtual hard drive file should grow as it is used or if it should be created as fixed size.

Enter the Virtual hard drive size.

That’s it. Our Virtual Client machine has been created. Now, we should make the client to boot from the network. To do that, go to the Vitual machine Settings option.

Select the System tab on the left, and Choose Network from the boot order option on the right side.

Then, go to the Network tab and select “Bridged Adapter” from the “Attached to” drop down box.

Once you done all the above steps, click OK to save the changes. That’s it. Now power on the Virtual client system. You should see the following screen.

That’s it. Now you know what to know next. Start installing CentOS on your client using the PXE server.

Good luck!

Reference: CentOS Wiki

---------------------------------------------------------------------
Install And Configure PXE Server And Client On CentOS 6.5

Show more