Build­ing an iPXE En­vi­ron­ment: An Al­ter­na­tive iVen­toy Guide

Cover_iVentoy.jpeg
Cover_iVentoy.jpeg

Introduction

iVentoy is an­other con­ve­nient tool de­vel­oped by the au­thor ( longpanda) of the fa­mous ISO boot tool Ventoy. The goal of this tool is to en­able boot­ing and startup through the PXE server with­out even prepar­ing a flash drive, and the sys­tem is also very con­ve­nient to use.

iventoy.png
iventoy.png

Deploy

SCENARIO01 (step-by-step)
Download iVentoy

Please use the root priv­i­lege to run be­low com­mands

wget https://github.com/ventoy/PXE/releases/download/v1.0.20/iventoy-1.0.20-linux-free.tar.gz -O /tmp/iventoy.tar.gz
Extract the Package
tar -xvzf /tmp/iventoy.tar.gz -C /opt
Rename Directory
mv /opt/iventoy-1.0.20 /opt/iventoy
Remove the Downloaded Archive
rm /tmp/iventoy.tar.gz
Create systemd Service File
cat << EOF > /etc/systemd/system/iventoy.service
[Unit]
Description=iVentoy iPXE Server
Requires=network-online.target
After=network-online.target
Wants=network-online.target

[Service]
Type=forking
User=root
Group=root
WorkingDirectory=/opt/iventoy
ExecStart=/opt/iventoy/iventoy.sh -R start
ExecStop=/opt/iventoy/iventoy.sh stop

[Install]
WantedBy=multi-user.target
EOF
Reload systemd to Recognize the New Service
systemctl daemon-reload
Enable the Service to Start on Boot
systemctl enable iventoy
Start the Service
systemctl start iventoy

Execute all steps using a script (Option)

bash -c "$(wget -qLO - https://kingtam.win/usr/uploads/script/iventoy-deploy.sh)"
SCENARIO02 (iVentoy LXC On PVE)

2025-03-06_154315.png
2025-03-06_154315.png

iVentoy is an en­hanced ver­sion of the PXE server.

To cre­ate a new Prox­mox VE iVen­toy LXC, run the com­mand be­low in the Proxmox VE Shell.

bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/iventoy.sh)"

⚡ De­fault Set­tings: 512MiB RAM - 2GB Stor­age - 1vCPU - Priv­i­leged
⚡iVen­toy In­ter­face: IP:26000/

2025-03-06_160828.png
2025-03-06_160828.png

/etc/systemd/system/iventoy.service

[Unit]
Description=iVentoy PXE Booter
Documentation=https://www.iventoy.com
Wants=network-online.target
[Service]
Type=forking
Environment=IVENTOY_API_ALL=1
Environment=IVENTOY_AUTO_RUN=1
Environment=LIBRARY_PATH=/opt/iventoy/lib/lin64
Environment=LD_LIBRARY_PATH=/opt/iventoy/lib/lin64
ExecStart=sh ./iventoy.sh -R start
WorkingDirectory=/opt/iventoy
Restart=on-failure
[Install]
WantedBy=multi-user.target
SCENARIO03 (Docker)

A Docker im­age run­ning iVentoy⁠ 1.0.20.

It is nec­es­sary to cre­ate the fol­low­ing di­rec­to­ries be­fore run­ning the Docker con­tainer.

mkdir -p iventoy/{data,iso,log,user}
DirectoryMount pointDescription
data/opt/iventoy/dataFor License file, config files.
iso/opt/iventoy/isoFor ISO files.
log/opt/iventoy/logFor log files.
user/opt/iventoy/userFor user files, third-part software, auto install scritps ...

Docker Compose

cat << EOF > docker-compose.yml
version: '3.9'
services:
  iventoy:
    image: szabis/iventoy:latest
    network_mode: "host"
    container_name: iventoy
    restart: always
    privileged: true #must be true
    environment:
      - AUTO_START_PXE=true
#    ports:
#      - "67:67/udp" # DHCP Server
#      - "69:69/udp" # TFTP Server
#      - "10809:10809" # NBD Server (NBD)
#      - "16000:16000" # PXE Service HTTP Server (iVentoy PXE Service)
#      - "26000:26000" # PXE GUI HTTP Server (iVentoy GUI)
    volumes:
      - ./data:/opt/iventoy/data
      - ./iso:/opt/iventoy/iso
      - ./log:/opt/iventoy/log
      - ./user:/opt/iventoy/user

EOF

Startup the Docker con­tainer

docker compose up -d

Use iVentoy via GUI

iVen­toy GUI is based on WEB, we could open browser and visit http://x.x.x.x:26000 af­ter you run iVen­toy.

(x.x.x.x is the IP ad­dress of the com­puter that run iVen­toy)

2025-01-28_103427.png
2025-01-28_103427.png

Before start

For the di­rec­to­ries:

DirectoryDescription
dataFor License file, config files.
docFor document
isoFor ISO files.
libFor library files that needed by iVentoy. Don't put other files here.
logFor log files.
userFor user files, third-part software, auto install scritps ...

Copy all your ISO files to the iso di­rec­tory. You can cre­ate sub­di­rec­to­ries ar­bi­trar­ily un­der this di­rec­tory to clas­sify and store ISO files.

2025-01-28_105601.png
2025-01-28_105601.png

Note: En­sure that there are no Uni­code char­ac­ters or spaces in the di­rec­tory name or ISO file name.
Start PXE Service

Se­lect server IP and set the IP pool, then click the green but­ton to start PXE ser­vice.

2025-01-28_103444.png
2025-01-28_103444.png


Third-part DHCP Server (Option)

iVentoy can also work to­gether with ex­ter­nal DHCP Server. such as ROS, Open­Wrt or Win­dows DHCP Server , mak­ing sys­tem in­stal­la­tion less trou­ble­some and sim­pli­fy­ing user trou­bles!

External Mode

In my case, I use the Ex­ter­nal Mode since the DHCP server is lo­cated in the same sub­net.

2025-01-28_103521.png
2025-01-28_103521.png

MikroTik RouterOS (Sam­ple)

2025-01-28_103702.png
2025-01-28_103702.png

Win­dows DHCP Server (Sam­ple)

2025-01-28_103941.png
2025-01-28_103941.png

For External mode, set bootfile op­tion value to iventoy_loader_16000

Note that the suf­fix 16000 is the iVen­toy http server port, if you change it on the page then the boot­file should match it. (For ex­am­ple: iventoy_loader_17000).

2025-01-28_104026.png
2025-01-28_104026.png

ExternalNet Mode

The us­age sce­nario of ExternalNet mode is that iVen­toy and the third-party DHCP Server are lo­cated in dif­fer­ent LANs/​VLANs.

2025-03-06_153210.png
2025-03-06_153210.png

2025-03-06_153255.png
2025-03-06_153255.png

2025-03-06_152516.png
2025-03-06_152516.png


iVentoy Auto Installation (Option)

To cre­ate an un­at­tended de­ploy­ment, we need to recre­ate a new ISO file based on the orig­i­nal ISO file and add the script or tem­plate into the new ISO file.

For Win­dows un­at­tended de­ploy­ment, use the Windows Answer File Generator. It is very sim­ple and al­lows you to cus­tomize it as you want.

Configuration

In my case, I put the script in the path of the scripts di­rec­tory: /opt/iventoy/user/scripts.

Se­lect the cor­re­spond­ing ISO file on the iVen­toy WEB GUI, and set the auto in­stal­la­tion script path.

2025-01-28_105913.png
2025-01-28_105913.png

"More than one script for an ISO file is ac­cept­able.

Start to deploy a system via iventoy

2025-01-28_110406.png
2025-01-28_110406.png

2025-01-28_110422.png
2025-01-28_110422.png

2025-01-28_110608.png
2025-01-28_110608.png

2025-01-28_110827.jpg
2025-01-28_110827.jpg


Conclusion:

Cur­rently, most PCs and lap­tops have a built-in PXE boot func­tion, of­ten re­ferred to as Network Stack. It is highly rec­om­mended for those who have a lot of sys­tem re­fill­ing re­quire­ments to give this func­tion a try.

Us­ing iVentoy's ap­proach can sig­nif­i­cantly re­duce the has­sle when in­stalling the sys­tem.


Related:

iPXE 網絡引導安裝


Reference:

iVentoy

How to run in a systemd service

iVentoy LXC

Docker Hub

Windows Answer File Generator