1

I have a functional DHCP, ftp and tftp server with a tftpboot directory in which the machines configured in PXEboot come to load syslinux without problems, from the network.

I am trying to install ubuntu 22.04 in PXE via SYSLINUX.

I have followed this post to achieve this.

In this post it says, that you have to extract the vmlinuz and initrd kernel files in the ubuntu 22.04 server installer ISO, put it in the tftpboot directory. Then load the ISO from the config file called default located in the pxelinux.cfg directory. Below is a non-exhaustive schematic representation of the tftpboot directory related to jammy (omitting the rest of the files traditionally used by syslinux)

└── tftpboot    
    ├── pxelinux.0
    ├── jammy
    │   ├── initrd
    │   └── vmlinuz
    ├── pxelinux.cfg
    │   └── default
    └── syslinux (All the Syslinux boot files)
        └── bios
            ├── ldlinux.c32
            ├── libutil.c32
            └── menu.c32

Here is the ftp directory that I have

└── ftp   
    └── Ubuntu-22.04
        ├── ubuntu-22.04.1-live-server-amd64.iso
        └── Kickstart
            ├── user-data
            └── meta-data

Here is the user-data file that I took to try a minimal install first. Meta data can be empty:

#cloud-config
autoinstall:
  identity:
    hostname: jammy-minimal
    password: $6$gnqbMUzHhQzpDEw.$.cCNVVDsDfj5Feebh.5O4VbOmib7tyjmeI2ZsFP7VK2kWwgJFbfjvXo3chpeAqCgXWVIW9oNQ/Ag85PR0IsKD/
    username: ubuntu
  version: 1

Here is the default config file I have set up.

default menu.c32
menu title Ubuntu installer

LABEL ubuntu
    MENU LABEL Install Ubuntu Jammy Server
    MENU DEFAULT
    KERNEL jammy/vmlinuz
    IPAPPEND 1
    APPEND initrd=jammy/initrd ip=dhcp url=ftp://172.16.0.4/Ubuntu-22.04/ubuntu-22.04.1-live-server-amd64.iso autoinstall ds=nocloud-net;s=ftp://172.16.0.4/Ubuntu-22.04/Kickstart

Finally, to add the user-data (cloud-config) and meta-data files, in the ftp that the default file will be able to use to download its config to start an automatic installation, user-data having all the steps that we will have chosen manually before, in order to make an installation without manual intervention (language, formatting, etc.)

The kernel and ISO are loaded correctly and start the installation process up to the install menu, but the problem comes when it needs to load the cloud-config (user-data) file to start an automatic installation. It can't find it even though I specified it in the default file. Here is what is happening in the image below.

Loading the ISO

Loading the ISO

Waiting forever cloud-init

Waiting forever cloud-init

Then launch the menu ultimately

Then launch the menu ultimately

Apparently the user-data file is ignored if I load it from default syslinux file. How is this possible? Do I have to load it from somewhere other than the default file? I've already thought of trying to load it from a modified ISO. Would this be a good alternative? Thanks

1 Answer 1

2

Waiting forever cloud-init

Did you check cloud-init's log files? What did you see?

I suspect that the reason that cloud-init is waiting forever is because you aren't providing a valid NoCloudNet string. Cloud-init's NoCloud datasource doesn't support support ftp. From the docs:

With ds=nocloud, the seedfrom value must start with / or file://. With ds=nocloud-net, the seedfrom value must start with http:// or https:// and end with a trailing /.

If you check your cloud-init logs I bet you'll see this warning.

Update: In the 24.2 release, FTP will be added to cloud-init's NoCloud datasource.

1
  • hi thanks for your answer. I will give updates soon to this thread. I think of modifying the ubuntu_server_install_ISO to give the cloud-init file directly there in the ISO. Best regards
    – Andy McRae
    Commented Feb 22, 2023 at 15:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .