Skip to main content

PXE boot install

VKB-1052How-to
📦 Applies to
XCP-ng
🗓️ Created
2024-03-13
🔄 Updated
2024-03-13

Environment​

To get XCP-ng installed from PXE, you need:

  • DHCP and TFTP configured servers
  • Any NFS, FTP or HTTP server (your choice) to host XCP-ng installation files
  • A PXE-boot compatible network card on your host
tip

PXE boot doesn't support tagged VLAN networks! Be sure to boot on an untagged network!

Procedure​

TFTP server configuration (BIOS boot)​

  1. In your TFTP root directory (eg /tftp), create a folder named xcp-ng.
  2. Copy the mboot.c32 and pxelinux.0 files from the installation media to the TFTP root directory.
  3. From the XCP-ng installation media, copy the files install.img (from the root directory), vmlinuz, and xen.gz (from the /boot directory) to the new xcp-ng directory on the TFTP server.
  4. In the TFTP root directory, create a folder called pxelinux.cfg.
  5. In the pxelinux.cfg directory, create your configuration file called default.

The file itself will contain the way to install XCP-ng: manually (with answers to provide on the host console/screen) or fully automated (see Automated install).

Here is an example of a manual installation:

default xcp-ng
label xcp-ng
kernel mboot.c32
append xcp-ng/xen.gz dom0_max_vcpus=2 dom0_mem=2048M,max:2048M com1=115200,8n1 console=com1,vga --- xcp-ng/vmlinuz xencons=hvc console=hvc0 console=tty0 --- xcp-ng/install.img

How the TFTP folder looks like when configured:

root@dom0
# tree -L 1 /srv/tftp/
srv/tftp
├── mboot.c32
├── pxelinux.0
├── pxelinux.cfg
│   └── default
└── xcp-ng
  ├── install.img
  ├── vmlinuz
  └── xen.gz

TFTP server configuration (UEFI boot)​

If you want to make an installation in UEFI mode, you need to have a slightly different TFTP server configuration:

  1. In your TFTP root folder, create a directory called EFI/xcp-ng.

  2. Configure your DHCP server to provide /EFI/xcp-ng/grubx64.efi as the boot file.

  3. Create a grub.cfg as follows:

    menuentry "XCP-ng Install (serial)" {
    multiboot2 /EFI/xcp-ng/xen.gz dom0_mem=2048M,max:2048M watchdog \
    dom0_max_vcpus=4 com1=115200,8n1 console=com1,vga
    module2 /EFI/xcp-ng/vmlinuz console=hvc0 console=tty0 install
    module2 /EFI/xcp-ng/install.img
    }
  4. Copy this grub.cfg file to the EFI/xenserver folder on the TFTP server.

  5. Get the following files from the XCP-ng ISO: grubx64.efi, install.img (from the root directory), vmlinuz, and xen.gz (from the /boot directory) to the new EFI/xcp-ng directory on the TFTP server.

How the TFTP folder looks like when configured:

root@dom0
# tree -L 1 /srv/tftp/
srv/tftp
└── EFI
  ├── xcp-ng
  │   ├── grubx64.efi
  │   ├── install.img
  │   ├── vmlinuz
  │   └── xen.gz
  └── xenserver
      └── grub.cfg

Installation files​

On the FTP, NFS or HTTP server, put all the installation media content in there.

For a layout example, check the official repository.

tip

When you do copy the installation files, DO NOT FORGET the .treeinfo file. Double check your webserver isn't blocking it (like Microsoft IIS does).

On the host​

  1. Start your host.
  2. Enter the boot menu (usually F12).
  3. Select boot from the Ethernet card.

Verification​

After selecting boot from the Ethernet card, you should see the PXE menu you created before, and the XCP-ng installation starts from the network.