Ventoy+ks实现无人值守安装ubuntu

#cloud-config
autoinstall:
  apt:
    disable_components: []
    fallback: abort
    geoip: true
    mirror-selection:
      primary:
      - country-mirror
      - arches: &id001
        - amd64
        - i386
        uri: http://archive.ubuntu.com/ubuntu/
      - arches: &id002
        - s390x
        - arm64
        - armhf
        - powerpc
        - ppc64el
        - riscv64
        uri: http://ports.ubuntu.com/ubuntu-ports
    preserve_sources_list: false
    security:
    - arches: *id001
      uri: http://security.ubuntu.com/ubuntu/
    - arches: *id002
      uri: http://ports.ubuntu.com/ubuntu-ports
  codecs:
    install: false
  drivers:
    install: false
  identity:
    hostname: master
    password: $6$fFXS9w0xJQcF.8vA$AMmo3u9JT9fYcjnd1owKc8IIZK8wUDWg1HF477L8U9ucGyql8qvnF0X7F7y8J5ZvWK3UmR5D4D2OT/kLsrSTF.
    realname: gengzi
    username: gengzi
  kernel:
    package: linux-generic
  keyboard:
    layout: us
    toggle: null
    variant: ''
  locale: en_US.UTF-8
  network:
    ethernets:
      enp6s0:
        dhcp4: true
    version: 2
    wifis: {}
  oem:
    install: auto
  source:
    id: ubuntu-server
    search_drivers: false
  ssh:
    allow-pw: true
    authorized-keys: []
    install-server: true
  shutdown: reboot
  storage:
    config:
    - ptable: gpt
      serial: WDS500G1X0E-00AFY0_21063T460810_1
      wwn: eui.e8238fa6bf530001001b444a46727aec
      path: /dev/nvme0n1
      wipe: superblock-recursive
      preserve: false
      name: ''
      grub_device: false
      id: disk-nvme0n1
      type: disk
    - device: disk-nvme0n1
      size: 629145600
      wipe: superblock
      flag: boot
      number: 1
      preserve: false
      grub_device: true
      offset: 1048576
      resize: true
      path: /dev/nvme0n1p1
      id: partition-0
      type: partition
    - device: disk-nvme0n1
      size: 1073741824
      wipe: superblock
      number: 2
      preserve: false
      grub_device: false
      offset: 630194176
      resize: true
      path: /dev/nvme0n1p2
      id: partition-1
      type: partition
    - device: disk-nvme0n1
      size: -1
      wipe: superblock
      number: 3
      preserve: false
      grub_device: false
      offset: 1703936000
      path: /dev/nvme0n1p3
      id: partition-2
      type: partition
    - name: cl
      devices:
      - partition-2
      preserve: false
      id: lvm_volgroup-0
      type: lvm_volgroup
    - name: root
      volgroup: lvm_volgroup-0
      size: 322122547200B
      wipe: superblock
      preserve: false
      path: /dev/cl/root
      id: lvm_partition-0
      type: lvm_partition
    - fstype: fat32
      volume: partition-0
      preserve: false
      id: format-3
      type: format
    - fstype: ext4
      volume: partition-1
      preserve: false
      id: format-4
      type: format
    - fstype: ext4
      volume: lvm_partition-0
      preserve: false
      id: format-5
      type: format
    - path: /
      device: format-5
      id: mount-5
      type: mount
    - name: home
      volgroup: lvm_volgroup-0
      size: -1
      wipe: superblock
      preserve: false
      path: /dev/cl/home
      id: lvm_partition-1
      type: lvm_partition
    - fstype: ext4
      volume: lvm_partition-1
      preserve: false
      id: format-7
      type: format
    - path: /home
      device: format-7
      id: mount-7
      type: mount
    - path: /boot
      device: format-4
      id: mount-4
      type: mount
    - path: /boot/efi
      device: format-3
      id: mount-3
      type: mount
  updates: security
  apt:
    disable_suites: [security]
  version: 1

参考链接如下:
https://www.ventoy.net/cn/plugin_autoinstall.html
https://linuxconfig.org/how-to-write-and-perform-ubuntu-unattended-installations-with-autoinstall


转载请注明来源,欢迎对文章中的引用来源进行考证,欢迎指出任何有错误或不够清晰的表达。