如何执行 Ubuntu Desktop 的无人值守安装?

Tim*_*imo 5 automation desktop-environments headless system-installation

我知道有很多关于 Ubuntu 服务器的无头和无人值守安装的信息。但我需要在很多机器上安装 Trusty 的桌面版本,并且我想将其自动化。使用 Kickstart 和 Preseed 手册,我无法启动 Ubuntu 14.04 的无人值守安装。桌面 64 位。

是否有我找不到的手册?如果能得到一些帮助那就太好了。我已经在这上面花了几个小时了。

我的 txt.cfg 在 /isolinux/ 中:

default autoinstall
label autoinstall
     menu label ^Autoinstall Ubuntu POS-Server
     kernel /install/vmlinuz
     append preseed/file=/cdrom/preseed/pos.seed debian-installer/locale=de_DE console-setup/layoutcode=de initrd=/install/initrd.gz ramdisk_size=16384 ks=cdrom:/ks.cfg  root=/dev/ram rw --
Run Code Online (Sandbox Code Playgroud)

我的 pos.seed 在 /preseed/ 中:

d-i partman/confirm_write_new_label boolean true
d-i partman/choose_partition \
select Finish partitioning and write changes to disk
d-i partman/confirm boolean true

d-i debian-installer/locale string en_US.UTF-8
d-i debian-installer/splash boolean false
d-i console-setup/ask_detect boolean false
d-i console-setup/layoutcode string de
d-i console-setup/variantcode string

### Network
d-i netcfg/choose_interface select auto

## Keyboard configuration
d-i keyboard-configuration  keyboard-configuration/layoutcode       string  de
d-i keyboard-configuration  keyboard-configuration/layout   select  German
d-i keyboard-configuration  keyboard-configuration/variant  select  German
d-i keyboard-configuration  keyboard-configuration/xkb-keymap       select  de

#### Advanced options
### Running custom commands during the installation
# This first command is run as early as possible, just after
# preseeding is read.
# if old filesystem present installer asks for unmount
d-i preseed/early_command string umount /media

### Package selection
# Individual additional packages to install
# Install the Ubuntu desktop.
tasksel tasksel/first multiselect ubuntu-desktop
d-i pkgsel/include string openssh-server build-essential
# Policy for applying updates. May be "none" (no automatic updates),
# "unattended-upgrades" (install security updates automatically), or
# "landscape" (manage system with Landscape).
d-i pkgsel/update-policy select none
# Enable extras.ubuntu.com.
d-i apt-setup/extras    boolean true
Run Code Online (Sandbox Code Playgroud)

我的 ks.cfg 在 /:

#Generated by Kickstart Configurator
#platform=AMD64 or Intel EM64T

#System language
lang en_US
#Language modules to install
langsupport en_US
#System keyboard
keyboard de
#System mouse
mouse
#System timezone
timezone Europe/Berlin
#Root password
rootpw --disabled
#Initial user
user ****** --fullname "******" --iscrypted --password ******************
#Reboot after installation
reboot
#Use text mode install
text
#Install OS instead of upgrade
install
#Use CDROM installation media
cdrom
#System bootloader configuration
bootloader --location=mbr locale=de_DE console-setup/ask_detect=false keyboard-configuration/layoutcode=de
#Clear the Master Boot Record
zerombr yes
#Partition clearing information
clearpart --all --initlabel 
#Partitioning
part / --fstype ext4 --size 1 --grow --asprimary
part swap --recommended
part /boot --fstype ext4 --size 256 --asprimary
#System authorization infomation
auth  --useshadow  --enablemd5 
#Network configuration
network --bootproto=dhcp --device=eth0
#Firewall configuration
#firewall --disabled 
#Do not configure the X Window System
skipx
#custom packages for installation
%packages
openssh-server
ubuntu-desktop
Run Code Online (Sandbox Code Playgroud)

Chr*_*ian 1

尽管安装了软件包集,服务器版本和桌面版本之间没有真正的区别。

有一个名为“ubuntu-desktop”的元软件包,包含随 Ubuntu Desktop 安装的所有软件包。默认存储库中还提供了 Kubuntu、Edubuntu、Lubuntu 和 Xubuntu 的元包。

只需使用 Ubuntu 服务器教程,并将此软件包添加到您的 kickstart 文件中,而不是与服务器相关的软件包(根据安装过程中选择的服务,还会安装其他元软件包,例如“openssh-server”)。如果没有选择(或在 kickstart 文件中列出),您将获得一个没有任何内容的最小 Ubuntu 系统。

Preseed 文件中相关部分的示例:

### Package selection
tasksel tasksel/first multiselect ubuntu-desktop
#tasksel tasksel/first multiselect lamp-server, print-server
#tasksel tasksel/first multiselect kubuntu-desktop
Run Code Online (Sandbox Code Playgroud)

示例文件在这里找到

Kickstart 文件相同:

%packages
ubuntu-desktop
Run Code Online (Sandbox Code Playgroud)

不要使用@ubuntu-desktop,这意味着安装包组,但在 deb-world 中,包组是一个元包,它将其他包作为依赖项拉取。