Install PXE Server On CentOS 7

A PXE server allows your client computers to boot and install a Linux distribution over the network, without the need of burning Linux iso images, or human interaction.

For this test, I use vmware worksation (Bridged IP).

  • My IP = (Required STATIC IP).
  • Selinux Disabled.
  • FirewallCMD disabled.

To install a PXE server, you will need the following components:

  • DHCP Server
  • TFTP Server
  • NFS/FTP/HTTPD server (to store installing files)


  • DHCP Server will listen only on eno16777736  (old name  etho).

In this tutorial, I will use vsftpd server.

1. Install required packages

yum install dhcp tftp tftp-server syslinux wget vsftpd

2. Configure DHCP Server

vim /etc/dhcp/dhcpd.conf
 # DHCP Server Configuration file.
 #   see /usr/share/doc/dhcp*/dhcpd.conf.example
 #   see dhcpd.conf(5) man page
 # option definitions common to all supported networks...
 ddns-update-style interim;
 ignore client-updates;
 allow booting;
 allow bootp;
 allow unknown-clients;
 # A slightly different configuration for an internal subnet.
 subnet netmask {
 option domain-name-servers;
 option domain-name "";
 option routers;
 option broadcast-address; #not important
 default-lease-time 600;
 max-lease-time 7200;
 next-server; #  DHCP server ip
 filename "pxelinux.0";

3. Configure TFTP Server. Set disable from yes to no, and change the root directory on startup to /tftpboot

Please note,  that  the  standard TFTP  directory  is /var/lib/tftpboot

vim /etc/xinetd.d/tftp
service tftp
 socket_type             = dgram
 protocol                = udp
 wait                    = yes
 user                    = root
 server                  = /usr/sbin/in.tftpd
 server_args             = -s /tftpboot
 disable                 = no
 per_source              = 11
 cps                     = 100 2
 flags                   = IPv4

4. Setup TFTP Server network boot files

mkdir -p /tftpboot
chmod 777 /tftpboot
 cp -v /usr/share/syslinux/pxelinux.0 /tftpboot
 cp -v /usr/share/syslinux/menu.c32 /tftpboot
 cp -v /usr/share/syslinux/memdisk /tftpboot
 cp -v /usr/share/syslinux/mboot.c32 /tftpboot
 cp -v /usr/share/syslinux/chain.c32 /tftpboot
mkdir /tftpboot/pxelinux.cfg
mkdir -p /tftpboot/netboot/

5. Mount Cenots ISO to FTP folder /var/ftp/pub.

mount Centos7_xx.iso /var/ftp/pub

6. Copy initrd.img  and vmlinuz from FTP folder to /tftpboot/netboot/.

cp /var/ftp/pub/images/pxeboot/vmlinuz /tftpboot/netboot/
cp /var/ftp/pub/images/pxeboot/initrd.img /tftpboot/netboot/

7. Encode root password used for clients

Example: 000000

 openssl passwd -1 "000000"

8. Create a new kickstart file (you can change it for your needs)

 vim /var/ftp/pub/ks.cfg
 #platform=x86, AMD64, or Intel EM64T
 # Firewall configuration
 firewall --disabled
 # Install OS instead of upgrade
 # Use NFS installation media
 url --url=""
 # Root password [i used here 000000]
 rootpw --iscrypted $1$xYUugTf4$4aDhjs0XfqZ3xUqAg7fH3.
 # System authorization information
 auth  useshadow  passalgo=sha512
 # Use graphical install
 firstboot disable
 # System keyboard
 keyboard us
 # System language
 lang en_US
 # SELinux configuration
 selinux disabled
 # Installation logging level
 logging level=info
# System timezone
 timezone Europe/Amsterdam
 # System bootloader configuration
 bootloader location=mbr
 clearpart --all --initlabel
 part swap --asprimary --fstype="swap" --size=1024
 part /boot --fstype xfs --size=200
 part pv.01 --size=1 --grow
 volgroup rootvg01 pv.01
 logvol / --fstype xfs --name=lv01 --vgname=rootvg01 --size=1 --grow


9. Create PXE menu file

vim /tftpboot/pxelinux.cfg/default
 default menu.c32
 prompt 0
 timeout 30

 LABEL centos7_x64
 KERNEL /netboot/vmlinuz
 APPEND  initrd=/netboot/initrd.img  inst.repo=  ks=

10. Final service setup

 chkconfig dhcpd on
 chkconfig xinetd on
 chkconfig vsftpd on

11. Restart the services

 Service vsftpd  restart
 service dhcpd restart
 service xinetd   restart

12. Now create new virtual machine and start from network and enjoy.





  • Rob R

    By the way, we just tried this on CentOS 7 and we needed to modify the file: /etc/vsftpd/vsftpd.conf and set anonymous_enable=YES otherwise you get errors like these on the PXE Client: curl: (67) Access denied: 530

  • Rob R

    An easy way to test if this needs to be done is to go into a web browser and point it to your PXE Server’s FTP address. In this case If you get a login prompt, you need to either modify the file above, or pass the username and password in your kickstart file and your PXE menu file

  • Johan Vermeulen


    I have the same problem. Were you ever able to resolve this?

  • Patrick Fiset

    ok, thanks, but how ? Can you give what should be replaced in the steps ?

  • Patrick Fiset

    Same problem here.