我正在嘗試使用 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:文件但它不起作用。我使用/var/log/installer/autoinstall-user-data 檔案作為範例,然後我只需要添加一些東西,例如kubuntu-desktop 包,然後使用我的ssh-key 來打開openssh-server 並允許以root 身份登錄。
歡迎任何幫助