Setting up a ‘PXE Network Boot Server’ for Multiple Linux Distribution Installations in RHEL/CentOS 7

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Get your own self-hosted blog with a Free Domain at ($3.95/month).
  4. Become a Supporter - Make a contribution via PayPal
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Matei Cezar

I'am a computer addicted guy, a fan of open source and linux based system software, have about 4 years experience with Linux distributions desktop, servers and bash scripting.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

51 Responses

  1. kiran says:

    Hi I reached until step 17 after that I am getting PXE-E78: Could not locate boot server, PXE-M)F: Exiting Intel PXE ROM, Operating system not found.

  2. e.8 says:

    If you guys are getting squashfs not mounted errors, please note a RHEL/CentOS-7 network install requires at least 1.5-2G of RAM or else it won’t be able to load the ram disk.

    Refer to:
    https://access.redhat.com/solutions/2968881
    https://bugzilla.redhat.com/show_bug.cgi?id=1314092

  3. Frédney Ramllo Moronari says:

    Hi,

    I read your article and its very easy for function. thank you, but my PC client on the boot process show me message:

    “Failed to start Switch Root.”

    And stops with options for repair installation, but I am installing nothing.

    Help-me please.

  4. Jess says:

    Hi,

    Followed all of the steps to a T but it’s not working. It’s most probably the network. I’m not a network expert so I’m at a wit’s end on why my PXE setup is not working. I might have setup the wrong gateway as well. I’m confused what should the default gateway be on this VM.

    I have a PXE server (Centos 7) on a VirtualBox VM (guest VM) provisioned via Vagrant. Its adapter 1 is NAT, adapter 2 is Host-only adapter (vboxnet0). I have configured it with a static IP of 172.31.0.205.

    $ ip route show
    default via 10.0.2.2 dev eth0 proto static metric 100
    10.0.2.0/24 dev eth0 proto kernel scope link src 10.0.2.15 metric 100
    169.254.0.0/16 dev eth1 scope link metric 1003
    172.31.0.0/24 dev eth1 proto kernel scope link src 172.31.0.205

    $ ip addr
    1: lo: mtu 65536 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
    valid_lft forever preferred_lft forever
    2: eth0: mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 52:54:00:9f:bd:fd brd ff:ff:ff:ff:ff:ff
    inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic eth0
    valid_lft 69737sec preferred_lft 69737sec
    inet6 fe80::5054:ff:fe9f:bdfd/64 scope link
    valid_lft forever preferred_lft forever
    3: eth1: mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 08:00:27:67:ee:68 brd ff:ff:ff:ff:ff:ff
    inet 172.31.0.205/24 brd 172.31.0.255 scope global eth1
    valid_lft forever preferred_lft forever
    inet6 fe80::a00:27ff:fe67:ee68/64 scope link
    valid_lft forever preferred_lft forever

    $ sudo cat /etc/dnsmasq.conf
    interface=eth1,lo
    #bind-interfaces
    domain=home
    #dchp range-leases
    dhcp-range=eth0,172.31.0.210,172.31.0.215,255.255.255.0,1h
    #PXE
    dhcp-boot=pxelinux.0,pxeserver,172.31.0.205
    #gateway
    dhcp-option=3,172.31.0.1
    #DNS
    dhcp-option=6,172.31.0.1
    dhcp-option=6,8.8.8.8
    server=8.8.4.4
    #broadcast address
    dhcp-option=28,10.0.0.255
    #ntp server
    dhcp-option=42,0.0.0.0
    pxe-prompt=”Press F8 for menu.”, 60
    pxe-service=x86PC, “Install CentOS 7 from network server 172.31.0.205”, pxelinux
    enable-tftp
    tftp-root=/var/lib/tftpboot

    $ sudo cat /var/lib/tftpboot/pxelinux.cfg/default
    default menu.c32
    prompt 0
    timeout 300
    ONTIMEOUT local
    menu title ########## PXE Boot Menu ##########
    label 1
    menu label ^1) Install CentOS 7 x64 with Local Repo
    kernel centos7/vmlinuz
    append initrd=centos7/initrd.img method=ftp://172.31.0.205/pub devfs=nomount
    label 2
    menu label ^2) Install CentOS 7 x64 with http://mirror.centos.org Repo
    kernel centos7/vmlinuz
    append initrd=centos7/initrd.img method=http://mirror.centos.org/centos/7/os/x86_64/ devfs=nomount ip=dhcp
    label 3
    menu label ^3) Install CentOS 7 x64 with Local Repo using VNC
    kernel centos7/vmlinuz
    append initrd=centos7/initrd.img method=ftp://172.31.0.205/pub devfs=nomount inst.vnc inst.vncpassword=password
    label 4
    menu label ^4) Install Centos 7 x64 with http://172.31.0.205 Repo
    kernel centos7/vmlinuz
    append initrd=centos7/initrd.img method=http://172.31.0.205/centos7 devfs=nomount
    label 5
    menu label ^5) Boot from local drive

    From my host machine, I can access the following (PXE options) successfully: ftp://172.31.0.205/pub and http://172.31.0.205/centos7

    When I’m trying to boot a VM to install Centos 7 via PXE boot with its network adapter 1 set on Host-based adapter (vboxnet0), I am able to see that this new guest VM is able to get an IP (172.31.0.213) from the DHCP server (172.31.0.205). I’m able to see the PXE boot menu and able to choose from the options, but it’s failing to download and complete the PXE install. However, if this VM’s network setting is set to other than Host-based adapter, this VM doesn’t see the DHCP server (172.31.0.205) so I have it set to Host-based (vboxnet0). The installation eventually fails and goes to “/dev/root does not exist”.

    Appreciate any help.

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *