Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Ubuntu 20.04 server autoinstallation HowTo
#1
Ventoy has a plugin to work with the debian autoinstaller. Unfortunately, Ubuntu 20 comes with a new auto install method (cloud-init), which works differently. At first, I wasn't able to get it to work with Ventoy, so I made an account to ask for help; in the time it took the account to get activated, I solved the problem however. So here's how to do it in case anyone else has the same problem.

A working auto installer needs two files, one `meta-data` and one `user-data`. These need to be on a partition that has `cidata` as the partition label.

These files can not be put into the same partition that has the iso files, because that partition is locked while the booted software is running.

So, to get it to work:

  • When running Ventoy for the first time to install it on the USB drive, leave some space for a 3rd partition. On linux, that's `-r 16` to leave 16 MB at the end of the medium.
    Code:
    ventoy-1.0.36/Ventoy2Disk.sh -I /dev/sdX -r 16
  • Create a new partition on the medium
    Code:
    fdisk /dev/sdX
    n (new)
    p (partition)
    3 (partition number)
    press return twice to confirm the sector numbers
    t (type)
    3 (partition number)
    7 (vfat partition type)
    w
  • format it to vfat, and name it `cidata`.

    Code:
    mkfs.vfat -n cidata /dev/sdX3
  • copy the ubuntu installer iso to the first partition, and your user-data and meta-data to the third partition
More information about user-data is at https://ubuntu.com/server/docs/install/autoinstall. meta-data can be left empty unless you know what you're doing and want to have some version control for different configs.
Reply
#2
Under "Create a new partition on the medium"
The part that says "7 (vfat partition type)".
I guess you mean ExFAT here not vfat, because "7" is ExFAT in my fdisk version.
or do you mean the partition type "W95 FAT32 (LBA)" ?

I tried this with Ubuntu Server 21.10, but no luck.

Can you provide a working example user-data file?
Reply
#3
Use /var/log/installer/autoinstall-user-data according to https://ubuntu.com/server/docs/install/autoinstall. Please remove the following two lines
Code:
  kernel:
    kernel: {package: linux-generic}
Reply
#4
Give a example

Code:
#cloud-config (the real generated user-data config)
autoinstall:
  apt:
    geoip: true
    preserve_sources_list: false
    primary:
    - arches: [amd64, i386]
      uri: http://mirrors.ustc.edu.cn/ubuntu
    - arches: [default]
      uri: http://ports.ubuntu.com/ubuntu-ports
  identity: {hostname: optiplex-3080, password: $6$Y6L.IeTT5Q2I5GyK$12vthGNN5n37COpgr.M6gnfa71VjbngbJixmfLqxm05l1SIM5j1s3UwK0QeJE4UdLcAO83DQMze.lZLThYUFk0,
    realname: vagrant, username: vagrant}
  interactive-sections:
    - network
    - storage
  kernel:
    kernel: {package: linux-generic}
  keyboard: {layout: us, toggle: null, variant: ''}
  locale: en_US.UTF-8
  network:
    ethernets:
      enp2s0:
        dhcp4: true
    version: 2
    wifis: {}
  ssh:
    allow-pw: true
    authorized-keys: []
    install-server: true
  storage:
    config:
    - {ptable: gpt, serial: SAMSUNG MZVLW256HEHP-000L7_S35ENA1J872082, wwn: eui.002538b87103b701,
      path: /dev/nvme0n1, wipe: superblock-recursive, preserve: false, name: '', grub_device: false,
      type: disk, id: disk-nvme0n1}
    - {device: disk-nvme0n1, size: 536870912, wipe: superblock, flag: boot, number: 1,
      preserve: false, grub_device: true, type: partition, id: partition-0}
    - {fstype: fat32, volume: partition-0, preserve: false, type: format, id: format-0}
    - {device: disk-nvme0n1, size: 255521193984, wipe: superblock, flag: '', number: 2,
      preserve: false, grub_device: false, type: partition, id: partition-1}
    - {fstype: ext4, volume: partition-1, preserve: false, type: format, id: format-1}
    - {path: /, device: format-1, type: mount, id: mount-1}
    - {path: /boot/efi, device: format-0, type: mount, id: mount-0}
  updates: security
  version: 1
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)