Score:1

Ubuntu 22.04 autoinstall pxe not getting user-data

gy flag

testing on VirtualBox an automated install of ubuntu desktop, i have a router, dhcp, tftp, http server.

This is my pxelinux.cfg/default:

UI menu.c32
LABEL Ubuntu
  MENU LABEL Ubuntu
  KERNEL ubuntu/casper/vmlinuz
  INITRD ubuntu/casper/initrd
  APPEND root=/dev/ram0 ramdisk_size=1500000 ip=dhcp cloud-config-url=/dev/null url=http://192.168.1.1/ubuntu-22.04.1-desktop-amd64.iso autoinstall ds='nocloud-net\;s=http://192.168.1.1/' ---

But the automated install doesn't work. I still get to the install form...

I use a minimal autoinstall user-data and empty meta-data on my http server:

#cloud-config
autoinstall:
  version: 1
  identity:
    hostname: test
    password: $6$TgOD2MaHJ5/yy6s4$J7QZMZe/lUqOboU6M3B/MqXEnovVil2n4N1OkfDgP7.RcBXUPGxehSPF6Vy8fPt9yHf61LAGkIL8zLjFVN88i.
    username: test

on the /var/log/apache2/access.log only the ubuntu ISO is requested by the pxe boot. But on live environment I can download the user-data and meta-data files with wget.

with journalctl | grep autoinstall I get

Jan 12 11:08:49 ubuntu kernel: Command line: BOOT_IMAGE=ubuntu/casper/vmlinuz root=/dev/ram0 ramdisk_size=1500000 ip=dhcp url=http://192.168.1.1/ubuntu-22.04.1-desktop-amd64.iso autoinstall ds=nocloud-net;s=http://192.168.1.1/ cloud-config-url=/dev/null --- initrd=ubuntu/casper/initrd
Jan 12 11:08:49 ubuntu kernel: Kernel command line: BOOT_IMAGE=ubuntu/casper/vmlinuz root=/dev/ram0 ramdisk_size=1500000 ip=dhcp url=http://192.168.1.1/ubuntu-22.04.1-desktop-amd64.iso autoinstall ds=nocloud-net;s=http://192.168.1.1/ cloud-config-url=/dev/null --- initrd=ubuntu/casper/initrd
Jan 12 11:08:49 ubuntu kernel: Unknown kernel command line parameters "autoinstall --- BOOT_IMAGE=ubuntu/casper/vmlinuz ramdisk_size=1500000 ip=dhcp url=http://192.168.1.1/ubuntu-22.04.1-desktop-amd64.iso ds=nocloud-net;s=http://192.168.1.1/ cloud-config-url=/dev/null", will be passed to user space.
Jan 12 11:08:49 ubuntu kernel:     autoinstall
Jan 12 11:09:06 ubuntu /usr/libexec/gdm-x-session[1506]: Kernel command line: BOOT_IMAGE=ubuntu/casper/vmlinuz root=/dev/ram0 ramdisk_size=1500000 ip=dhcp url=http://192.168.1.1/ubuntu-22.04.1-desktop-amd64.iso autoinstall ds=nocloud-net;s=http://192.168.1.1/ cloud-config-url=/dev/null --- initrd=ubuntu/casper/initrd

I have tested with ubuntu server 22.04, UEFI and BIOS, with quotes and backslash for ds parameter but none of them seems to work

Andrew Lowther avatar
jp flag
The standard 22.04 desktop installer does not use autoinstall. The server installer does. PXELinux does not require quoting or escaping in the kernel parameters. See a full example at https://askubuntu.com/a/1240068/376778
Eryoka Cozart avatar
gy flag
yes! I replaced the ubuntu-22.04.1-desktop-amd64.iso with ubuntu-22.04.1-live-server-amd64.iso and the auto install is now working, thanks :)
Score:0
uy flag

Welcome, the server does not find your user-data file. You need to change the APPEND line slightly

APPEND root=/dev/ram0 ramdisk_size=1500000 ip=dhcp cloud-config-url=<URL TO user-data> url=http://192.168.1.1/ubuntu-22.04.1-desktop-amd64.iso autoinstall ds=nocloud-net s=<URL TO DIRECTORY CONTAINING user-data>

please replace <URL TO user-data> and <URL TO DIRECTORY CONTAINING user-data> with your values.

Eryoka Cozart avatar
gy flag
thank you, but it is still not working... same issue the user-data file is not requested
dummyuser avatar
uy flag
it works in my environment since years. did you check the log of the web-Server?
Score:0
gy flag

I've made two errors:

  • the iso must be the live-server one not the desktop as well as the initrd and the vmlinuz file served by tftp
  • in my pxe config :
    • cloud-config-url should be <URL TO user-data> not /dev/null
    • ds=nocloud-net s=<URL TO DIRECTORY CONTAINING user-data> works, no quotes or escape sequence required

thanks to dummyuser and Andrew Lowther, both of your answer were necessary

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.