修改ubuntu24.04.iso
新建autoinstall文件夹
创建meta-data user-data文件
#cloud-config
# See the autoinstall documentation at:
# https://canonical-subiquity.readthedocs-hosted.com/en/latest/reference/autoinstall-reference.html
autoinstall:
apt:
disable_components: []
fallback: offline-install
geoip: true
mirror-selection:
primary:
- uri: http://mirrors.tuna.tsinghua.edu.cn/ubuntu/
- 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: ubuntu
password: $6$DiNYjxCn8EeigJ9g$7hZry0ZdJoDUupllFhsvka4ny5F5wQ02SLfne78dsiZj45gWHqflA42u5Ejmj90x2.ebr7B516JZR86EAnUAo1
realname: noz
username: noz
kernel:
package: linux-generic
keyboard:
layout: us
toggle: null
variant: ''
locale: en_US.UTF-8
network:
ethernets:
ens33:
dhcp4: true
version: 2
oem:
install: auto
source:
id: ubuntu-server
search_drivers: false
ssh:
allow-pw: true
authorized-keys: []
install-server: true
storage:
layout:
name: lvm
updates: security
version: 1
修改/boot/grub/grub.cfg
if loadfont /boot/grub/font.pf2 ; then
set gfxmode=auto
insmod efi_gop
insmod efi_uga
insmod gfxterm
terminal_output gfxterm
fi
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
set timeout=5
menuentry "Install Ubuntu Server" {
set gfxpayload=keep
linux /casper/vmlinuz autoinstall "ds=nocloud;s=/cdrom/autoinstall/"
initrd /casper/initrd
}
grub_platform
if [ "$grub_platform" = "efi" ]; then
menuentry 'Boot from next volume' {
exit 1
}
menuentry 'UEFI Firmware Settings' {
fwsetup
}
fi
submenu 'Boot and Install with the HWE kernel' {
menuentry "Install Ubuntu Server" {
set gfxpayload=keep
linux /casper/hwe-vmlinuz autoinstall "ds=nocloud;s=/cdrom/autoinstall/"
initrd /casper/hwe-initrd
}
}