Skip to content

About

Describes how to create an ISO image, that auto installs Ubuntu with pre-selected packages & config.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

Repository files navigation

Ubuntu Auto-Install Documentation

If you are in need to auto-install Ubuntu to a device/VM with pre-defined config & packages - this repo explains, how to do that.

How to use repo

Bash script create_autoinstall_image.sh is downloading Ubuntu server 24 and do all necessary steps, to create a new autoinstall ISO image. Main configuration of your image is done via file user-data and env.sh will hold config for machine like username and password.

After creation script ran, an ISO file is sitting in folder autoinstall_image. This you can then put on an USB stick and autoinstall with that any computer.

If you want to test ISO with a virtual machine, you can use KVM/Qemu to do so. Please note, that you need to copy ISO to the configured storage pools in your configuration.

virsh pool-list

The following command shows how to start a VM and using created ISO to auto-install Ubuntu:

virt-install -n auto-install-test \
--description "VM to test Ubuntu auto install" \
--os-type=Linux --os-variant=ubuntu24.04 \
--ram=2048 --vcpus=2 \
--disk path=/path/to/diskfolder/autoinstall-test.img,bus=virtio,size=15 \
--graphics spice \
--cdrom /path/to/imagefolder/ubuntu-24.04-server-autoinstall.iso 

How it works

Boot image creation is done by the following steps:

  1. Install xorriso with sudo apt update && sudo apt install xorriso

  2. Download base image (e.g. Ubuntu server)

  3. Extract ISO file to a folder on your disk

    # extract original ISO
    xorriso -osirrox on -indev ~/Downloads/ISO/ubuntu-24.04.2-live-server-amd64.iso --extract_boot_images source-files/bootpart -extract / source-files
  4. Add auto install configuration to folder nocloud into extracted ISO

  5. Copy file user-data to folder nocloud

  6. Create empty file meta-data in folder nocloud

  7. Add option to grub.cfg (boot/grub/grub.cfg) like so:

    menuentry "Start Ubuntu Autoinstall" {
        set gfxpayload=keep
        linux /casper/vmlinuz quiet autoinstall ds=nocloud\;s=/cdrom/nocloud/ --- 
        initrd /casper/initrd
    }
  8. Create new ISO image

    xorriso -as mkisofs -r -V "ubuntu-autoinstall" -J -boot-load-size 4 -boot-info-table -input-charset utf-8 -eltorito-alt-boot -b bootpart/eltorito_img1_bios.img -no-emul-boot -o ../pod_autoinstall.iso .
  9. Test with VM

About

Describes how to create an ISO image, that auto installs Ubuntu with pre-selected packages & config.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages