Creating a Custom Boot Menu with iPXE and PXE Server: Take Your Network Installations to the Next Level

0 0
Read Time:5 Minute, 38 Second

Are you tired of manually installing different operating systems on multiple computers? Look no further than iPXE and PXE server to make your life easier! With a PXE server and iPXE, you can deploy Windows, Linux, or any other operating system to multiple computers over the network. In this tutorial, we’ll show you how to create a custom boot menu that lets you choose between different operating systems or configurations when booting from the PXE server with iPXE.

Before we begin, make sure you’ve completed our previous tutorial, “Creating a PXE Server with iPXE for Windows 10 Network Installation.” This tutorial assumes you already have the necessary components installed, such as a DHCP server, TFTP server, and HTTP server.

Here’s a breakdown of what we’ll cover in this tutorial:

Introduction
Chapter 1: Review the Basics of PXE and iPXE
Chapter 2: Modify the iPXE Script to Create a Custom Boot Menu
Chapter 3: Configure the Boot Menu
Chapter 4: Test the Custom Boot Menu
Conclusion

Let’s get started!

Introduction

In today’s fast-paced work environment, you need to find ways to save time and effort. Manually installing operating systems on multiple computers can be time-consuming and error-prone. Fortunately, iPXE and PXE server provide a way to automate the installation process and deploy operating systems over the network. In this tutorial, we’ll take it a step further and show you how to create a custom boot menu that lets you easily choose between different operating systems or configurations.

Chapter 1: Review the Basics of PXE and iPXE

Before we dive into creating a custom boot menu, let’s review the basics of PXE and iPXE. PXE (Preboot eXecution Environment) is a standard that allows client computers to boot from the network. iPXE is a free and open-source implementation of the PXE protocol that adds support for more advanced features, such as HTTPS booting and booting from iSCSI targets.

To create a PXE server with iPXE, you need the following components:

  • A computer or server to act as the PXE server
  • A DHCP server to assign IP addresses to client computers
  • A TFTP server to serve boot files and installation files to client computers
  • An HTTP server to serve installation files to client computers
  • The iPXE binary, which is used to boot client computers over the network

Chapter 2: Modify the iPXE Script to Create a Custom Boot Menu

Now that we’ve reviewed the basics of PXE and iPXE, let’s modify the iPXE script to create a custom boot menu. By creating a custom boot menu, you can easily choose between different operating systems or configurations when booting from the PXE server with iPXE.

Open the iPXE script you created in the previous tutorial and modify it to create a custom boot menu. Add the following lines to the beginning of the script:

#!ipxe

menu Custom Boot Menu

This creates a new menu called “Custom Boot Menu.” Next, add some menu items to the menu. For each menu item, you’ll need to specify a label, a description, and a command to execute when the item is selected.

Here’s an example:

item win10 Install Windows 10

This creates a menu item called “Install Windows 10” with the label “win10.” When the user selects this item, iPXE will execute the command associated with the label “win10.”

Chapter 3: Configure the Boot Menu

Now that we’ve created the custom boot menu, let’s configure it to display the available options and add new options.

Open the iPXE script again and add the following lines after the “menu” command:

item --gap -- ------------------------- Operating Systems -------------------------

item --key w win10 Install Windows 10

The first line adds a separator line between the menu title and the menu items. The second line adds a new menu item with the label “win10” and the description “Install Windows 10.” The “–key w” option sets the hotkey for this menu item to “w.” You can change the hotkey to any letter or number you like.

To add more menu items, simply copy the “item” line and modify the label, description, and command as needed.

Now, let’s add the commands for each menu item. Add the following lines after the “menu” command:

:win10
set boot-url http://${next-server}
set win10-amd64-url ${boot-url}/win10-amd64
set win10-amd64-installer ${win10-amd64-url}/setup.exe
kernel ${boot-url}/wimboot
initrd ${boot-url}/bootmgr.exe bootmgr.exe
initrd ${boot-url}/boot/bcd BCD
initrd ${boot-url}/boot/boot.sdi boot.sdi
initrd ${win10-amd64-url}/boot.wim boot.wim
boot

This is the same iPXE script we used in the previous tutorial to install Windows 10 over the network. We’re just assigning the Windows 10 installation files to a variable based on the menu item selected.

To add commands for other menu items, simply copy the commands from the previous iPXE script and modify the URLs and paths as needed.

Chapter 4: Test the Custom Boot Menu

Now that we’ve modified the iPXE script and configured the boot menu, let’s test it out.

Boot up a client computer that is connected to the same network as the PXE server and configure its BIOS to boot from the network. The client computer should boot into iPXE and display the custom boot menu.

Use the arrow keys to navigate the menu and select an option. If you set a hotkey for an option, you can also select it by pressing the hotkey. iPXE will execute the command associated with the selected menu item and load the corresponding operating system or configuration.

Conclusion

Creating a custom boot menu with iPXE and PXE server is a simple yet powerful way to simplify your network installations.

It allows you to easily choose between different operating systems or configurations when booting from the PXE server. This can save you time and effort in the long run, especially if you need to install different operating systems on multiple computers.

In this tutorial, we’ve shown you how to modify the iPXE script to create a custom boot menu, configure the boot menu to display the available options, and test the custom boot menu on a client computer.

You can take this further by customizing the boot menu even more. For example, you can add more advanced options such as network booting, hardware diagnostics, or backup and restore options. The possibilities are endless!

Further Reading;

  1. iPXE website: https://ipxe.org/
  2. PXE booting on Wikipedia: https://en.wikipedia.org/wiki/Preboot_Execution_Environment
  3. Configuring iPXE menus: https://ipxe.org/cmd/menu
  4. iPXE scripting: https://ipxe.org/scripting
  5. Building an iPXE menu: https://github.com/AdrianKoshka/ipxe-scripts

We hope this tutorial has been helpful in simplifying your network installations. If you have any questions or comments, feel free to leave them below. Happy networking!

Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %

Average Rating

5 Star
0%
4 Star
0%
3 Star
0%
2 Star
0%
1 Star
0%

Leave a comment