In this article, I describe how to take advantage of a server that supports PXE (most do) to do a network install of Red Hat Enterprise Linux (RHEL) or CentOS from a computer running Windows, without any install media, or even an optical disc drive.
Why a Network Install From Windows?
If you operate a data center, or even a decent sized server room, you’re probably familiar with doing network installs and have your own operating system (OS) image servers already configured. However, what if you’re at home and one of your friends drops off a 1U rack server and asks you to install and configure a Linux OS for him. What do you do?
Do you have an extra SATA DVD drive sitting around the house? How about a SATA power connector splitter, because the optimally designed server has no extras? Do you have any DVD media with the current version of the installation OS on it? If not, do you really want to waste some DVDs and burn it? These are all questions that you don’t even need to answer if you do a network installation. Instead, all you need is a server that supports Preboot Execution Environment (PXE).
PXE extends a computer’s firmware to support booting an operating system from a network interface without the need for any other media storage and retrieval devices such as hard disk drives, CD drives, DVD drives, or USB flash drives. Note that the PXE server has to be on the same broadcast network as the PXE client, because the protocol uses an amalgamation of DHCP and TFTP.
Setting Up the FTP Server
- Create a directory at C:\tftp
- Download and install the open source FileZilla FTP server.
- In FileZilla, click on Edit -> Users and add a user
- Specify a Password, click on Shared folders,Â Add C:\tftp, and click on OK
- Download the OS from the OS repository copying everything from os/arch to directory C:\tftp\os\. The easiest way to do the downloading is to download the OS .iso file and mounting it using an iso virtual drive tool like Virtual CloneDrive.
Setting Up the TFTP and DHCP Server
- Download the zip archive of Philippe Jounin’s open source Tftpd32 program and unzip the contents into the C:\tftp directory
- Run tftpd32.exe, and click on Settings
- On the TFTP tab, check PXE Compatibility and browse to C:\tftp for the Base Directory
- On the DHCP tab, uncheck Ping address before assignation and Persistant leases
- Enter pxelinux.0 for Boot File, configure your DHCP pool and network information, and click on OK
- Download the syslinux RPM from your OS repository
- Use Igor Pavlov’s 7-zip to extract the following RPM files from /usr/lib/syslinux into C:\tftp
- Create a text file at C:\tftp\pxelinux.cfg\default containing the following text:
ONTIMEOUT localMENU TITLE PXE Menu
LABEL CentOS 5 x86 NO KS eth0
MENU LABEL CentOS 5 x86 NO KS eth0
APPEND ks initrd=images/initrd.img ramdisk_size=100000 ksdevice=eth0
- Copy these files from the /images/pxeboot directory of the OS install media from step 5 of setting up the FTP server:
Note that the pxelinux.cfg file above assumes that you have eth0 set to PXE boot. If you are using a different interface, change the file, otherwise, ensure that the proper interface is set to use PXE by going into the server’s BIOS settings.
Boot the server, and follow the prompts. I recommend doing a server install sans GUI for a server. If you have problems, make sure that your Windows AV/firewall isn’t getting in the way and blocking your TFTP, DHCP, or FTP traffic/service.
I wrote this from memory almost a month after the last time I did this, so if you find mistakes, please let me know and I’m sorry.