我正在尝试使用 PXE 服务器自动安装 Kubuntu 20.04。首先使用 ubuntu20.04-live-server 映像并添加 de kubuntu-desktop 包。问题是我在某个时候迷路了,因为自动安装程序不会执行我的用户数据文件中显示的任何操作。也许有人可以帮助我。这将是我的 PXE 菜单:
default menu.c32
prompt 0
timeout 300
menu title PXE Menu
LABEL Install Kubuntu 20.04 with Autoinstall
MENU LABEL Install Kubuntu 20.04 with Autoinstall
KERNEL initundkernel/vmlinuz
INITRD initundkernel/initrd
APPEND root=/dev/ram0 ramdisk_size=150000i ip=dhcp url=http://myip/ubuntu-20.04.2-live-server-amd64.iso autoinstall ds=nocloud-net;s=http://myip/preseed/cloud-init/ cloud-config-url=/dev/null
菜单可以正常工作,它正确安装了平面 ubuntu-server 映像,但仅此而已。它只是假装读取我的用户数据文件:
autoinstall:
version: 1
apt:
geoip: true
preserve_sources_list: false
primary:
- arches: [amd64, i386]
uri: http://archive.ubuntu.com/ubuntu
- arches: [default]
uri: http://ports.ubuntu.com/ubuntu-ports
identity: {hostname: laptop17, password: $6$BCcme3szGenL3OjI$mj8X5xU97tQmqLkJyrTi3Aroi4Zx1D9a8kMAv08FmX15pK1FLcX5cBCLhYkwxCH1M9iRA2azSqmKMnKpkLAmw1,
realname: localadmin, username: localadmin}
keyboard: {layout: de, variant: nodeadkeys}
locale: de
network:
ethernets: {}
version: 2
ssh:
allow-pw: true
authorized-keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDQJj+FCD7xQKz0gDin7pLnqT15wBfeCbnKLWiAPuNBKTqjQT8TO7QaK6TskNVW2rg32ixcT4FGG8d047nMrNzVz61lIsVNiwCGZZQun6Vp6kqdUGP9upXS3ewhsmHNQNAXdZ+XUpUv+++1QU2RX4UEDJelrpIt i@mylaptop
install-server: true
storage:
config:
- {ptable: gpt, serial: BIWIN_SSD_1832008401056, path: /dev/sda, wipe: superblock,
preserve: false, name: '', grub_device: true, type: disk, id: disk-sda}
- {device: disk-sda, size: 1048576, flag: bios_grub, number: 1, preserve: false,
grub_device: false, type: partition, id: partition-0}
- {device: disk-sda, size: 1073741824, 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-0}
- {device: disk-sda, size: 238979907584, wipe: superblock, flag: '', number: 3,
preserve: false, grub_device: false, type: partition, id: partition-2}
- {volume: partition-2, keyfile: /tmp/luks-key-td2i_kos, preserve: false, type: dm_crypt,
id: dm_crypt-0}
- name: ubuntu-vg
devices: [dm_crypt-0]
preserve: false
type: lvm_volgroup
id: lvm_volgroup-0
- {name: ubuntu-lv, volgroup: lvm_volgroup-0, size: 119481040896B, preserve: false,
type: lvm_partition, id: lvm_partition-0}
- {fstype: ext4, volume: lvm_partition-0, preserve: false, type: format, id: format-1}
- {device: format-1, path: /, type: mount, id: mount-1}
- {device: format-0, path: /boot, type: mount, id: mount-0}
version: 1
packages:
- build-essential
- kubuntu-desktop
late-commands:
- sed -i 's/^#PermitRootLogin yes/PermitRootLogin yes/' /etc/ssh/sshd_config
- service sshd restart
- dhclient
我遵循了一些文档,例如下一个 https://louwrentius.com/understanding-the-ubuntu-2004-lts-server-autoinstaller.html#fnref:file但它不起作用。我使用 /var/log/installer/autoinstall-user-data 文件作为示例,然后我只需要添加一些东西,比如 kubuntu-desktop 包,然后用我的 ssh-key 打开 sh-server 并允许以 root 身份登录。
欢迎任何帮助