TLDR: Plug in a usb drive to install Ubuntu Server automagical.
- Ubuntu Server 18.04 or later (Tested with 20.04)
- Ventoy 1.0.42 or later
- Autoinstall configuration (
user-data
) as cloud-init config (yaml formatted)
A good start is the autoinstall file that the server installer created at /var/log/installer/autoinstall-user-data
. For more information see Resources.
Create an image file to hold the configuration:
truncate --size 2M ubuntu-server-cloud-init.img
mkfs.vfat -n cidata ubuntu-server-cloud-init.img
Create empty meta-data
file:
touch meta-data
I'm not in the know what content
meta-data
should include. For me an empty file worked; your mileage may vary.
Copy the configuration to the seed image:
mcopy -oi ubuntu-server-cloud-init.img user-data meta-data ::
The seed image is completed.
Please see the official documentation for how to create a Ventoy USB drive.
The created drive will be have (at least) 2 partitions. One partition with the boot loader (VTOYEFI
) and one partition was formatted per default with exFAT to hold iso images ("iso partition").
Create the folder /iso
on the iso partition and place the ubuntu iso image(s) inside it.
Create the folder /persistence
on the iso partition and copy the ubuntu-server-cloud-init.img
to /persistence/ubuntu-server-cloud-init.img
Create the folder /ventoy
on the iso partition and have a /ventoy/ventoy.json
file.
This is the main config for Ventoy.
Take care to have valid JSON, use an online validation tool if unsure.
Configure Ventoy to search only in /iso
for iso images so it doesn't clutter the menu with additional files.
(See documentation for more options.)
"control": [
{ "VTOY_DEFAULT_SEARCH_ROOT": "/iso" }
]
To pass along the seed image to the ubuntu server image, use Persistence Plugin of Ventoy and at the following to the Ventoy configuration: (Feel free to adjust as needed and pay attention to the nesting!)
"persistence": [
{
"image": "/iso/ubuntu-**.**-live-server-amd64.iso",
"backend": "/persistence/ubuntu-server-cloud-init.img"
},
{
"image": "/iso/ubuntu-**.**.*-live-server-amd64.iso",
"backend": "/persistence/ubuntu-server-cloud-init.img"
}
]
Boot the ubuntu server image with Ventoy and select boot with persistence image in the prompt.
Should the installer interface pop up, don't interact with it and just let it do it's thing. Wait until the the storage configuration. That will have to be done manually if no storage:
is defined. For every section listed in interactive-sections:
the graphical interface will also be used.
WARNING: Total data loss possible! Use with care!
The installer will not be asking for confirmation to format the disk!
To use fully noninteractive autoinstall:
- provide a
storage:
object in theuser-data
config - set
autoinstall
in the kernel command line
Ventoy provides a Boot Conf Replace Plugin that makes it possible to provide a custom configuration with autoinstall
already set. (Take also a look at the original /boot/grub/grub.cfg
within the iso.)
Create a /ventoy/ubuntu-server-autoinstall-grub.cfg
with the following content:
# ubuntu defaults
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
# boot second menu entry after timout
set default=1
set timeout=5
menuentry "Install Ubuntu Server" {
set gfxpayload=keep
linux /casper/vmlinuz ---
initrd /casper/initrd
}
menuentry "Install Ubuntu Server (Autoinstall)" {
set gfxpayload=keep
linux /casper/vmlinuz autoinstall ---
initrd /casper/initrd
}
# commonly available beginning with the second point release for the lts series
menuentry "Install Ubuntu Server with the HWE kernel" {
set gfxpayload=keep
linux /casper/hwe-vmlinuz ---
initrd /casper/hwe-initrd
}
menuentry "Install Ubuntu Server with the HWE kernel (Autoinstall)" {
set gfxpayload=keep
linux /casper/hwe-vmlinuz autoinstall ---
initrd /casper/hwe-initrd
}
Add to the ventoy configuration:
"conf_replace": [
{
"iso": "/iso/ubuntu-**.**-live-server-amd64.iso",
"org": "/boot/grub/grub.cfg",
"new": "/ventoy/ubuntu-server-autoinstall-grub.cfg"
},
{
"iso": "/iso/ubuntu-**.**.*-live-server-amd64.iso",
"org": "/boot/grub/grub.cfg",
"new": "/ventoy/ubuntu-server-autoinstall-grub.cfg"
}
]
Boot ubuntu server image with Ventoy.
- Automated Server Installs Introduction
- Automated Server Installs Config File Reference
- JSON Schema for autoinstall config (Documentation)
- autoinstall-schema.json (Source code)
- Understanding the Ubuntu 20.04 LTS Server Autoinstaller
- cloud-init "nocloud" networking setup
- Please test autoinstalls for 20.04!