目的
我想要完全无人值守地安装Ubuntu Desktop 16.04.1 LTS。只需将ISO光盘放入并离开即可。
问题
- 引导参数不正确
- 仍然需要回答问题和点击鼠标
- 使用kickstart/preseed的答案复杂
- 文档示例不按照说明工作,特别是来自partman和ubunutu的部分
我在这个帖子这里中找到了一个接近我所需的解决方案,但并没有完全达到我所需的目标,因为它是针对Ubuntu Server的。该帖子建议使用“非图形化”安装,但我找不到适用于Ubuntu Desktop的非图形化安装,这是合理的。我尝试调整步骤,并使其适用于Ubuntu Desktop 16.04.1 LTS。
使用的文档
我使用了以下所有资源...
显然我不能包含所有的资源,因为askubuntu不允许超过2个链接。这真的不太有帮助 - 所以这里只是一个列表:
- AskUbuntu
- Ubuntu install.en.pdf
- Preseed示例
- Ubiquity安装程序文档
- Partman文档和示例
- 分区配方解释三个数字及其权重
- 更复杂的Preseed示例
当前解决方案
我目前已经创建了一个无人值守安装,但不确定是否正确 - 这意味着我应该编辑isolinux/isolinux.cfg文件。
我链接的帖子和Ubuntu桌面镜像之间有很多差异。这是我的解决方案:
步骤1
挂载Ubuntu ISO,以便将内容复制到另一个目录,然后编辑相关文件。
mkdir -p /mnt/iso
mount -o loop ubuntu.iso /mnt/iso
第二步
然后,我将ISO文件复制到另一个目录进行编辑。
mkdir -p /opt/ubuntuiso
cp -rT /mnt/iso /opt/ubuntuiso
第三步
我编辑了`isolinux/isolinux.cfg`文件,并用以下内容替换了其中的所有内容:
default live-install
label live-install
menu label ^Install Ubuntu
kernel /casper/vmlinuz.efi
append file=/cdrom/ks.preseed auto=true priority=critical debian-installer/locale=en_US keyboard-configuration/layoutcode=us ubiquity/reboot=true languagechooser/language-name=English countrychooser/shortlist=US localechooser/supported-locales=en_US.UTF-8 boot=casper automatic-ubiquity initrd=/casper/initrd.lz quiet splash noprompt noshell ---
附加行非常长,为了方便阅读,这里列出了我使用的所有选项:
file=/cdrom/ks.preseed
auto=true
priority=critical
debian-installer/locale=en_US
keyboard-configuration/layoutcode=us
ubiquity/reboot=true
languagechooser/language-name=English
countrychooser/shortlist=US
localechooser/supported-locales=en_US.UTF-8
boot=casper
automatic-ubiquity
initrd=/casper/initrd.lz
quiet
splash
noprompt
noshell
我发现所有这些引导参数都是为了实现完全无人值守安装所必需的。对于Ubuntu服务器,可能会有所不同。
第4步
我尝试使用和创建许多预配置文件,但我发现越复杂,出错的机会就越大。目前这是与上述
isolinux.cfg
文件配合使用的简单预配置文件。### Partitioning
d-i partman-auto/disk string /dev/sda
d-i partman-auto/method string regular
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-md/device_remove_md boolean true
d-i partman-auto/choose_recipe select atomic
# This makes partman automatically partition without confirmation
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
# Locale
d-i debian-installer/locale string en_US
d-i console-setup/ask_detect boolean false
d-i console-setup/layoutcode string us
# Network
d-i netcfg/get_hostname string unassigned-hostname
d-i netcfg/get_domain string unassigned-domain
d-i netcfg/choose_interface select auto
# Clock
d-i clock-setup/utc-auto boolean true
d-i clock-setup/utc boolean true
d-i time/zone string US/Pacific
d-i clock-setup/ntp boolean true
# Packages, Mirrors, Image
d-i base-installer/kernel/override-image string linux-server
d-i base-installer/kernel/override-image string linux-image-amd64
d-i mirror/country string US
d-i mirror/http/proxy string
d-i apt-setup/restricted boolean true
d-i apt-setup/universe boolean true
d-i pkgsel/install-language-support boolean false
tasksel tasksel/first multiselect ubuntu-desktop
# Users
d-i passwd/user-fullname string Liason
d-i passwd/username string liason
d-i passwd/user-password-crypted password [crpyt 3]
d-i passwd/root-login boolean true
d-i passwd/root-password-crypted password [crypt 3]
d-i user-setup/allow-password-weak boolean true
# Grub
d-i grub-installer/grub2_instead_of_grub_legacy boolean true
d-i grub-installer/only_debian boolean true
d-i finish-install/reboot_in_progress note
# Custom Commands
我没有包含我的加密密码,所以如果你尝试使用这个预置文件,请将它们更改为加密密码。这里有三种方法来创建密码。
第五步
我从
/opt/ubuntuiso/
目录创建了新的ISO文件。mkisofs -D -r -V ATTENDLESS_UBUNTU -cache-inodes -J -l -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o /opt/autoinstall.iso /opt/ubuntuiso
第6步
我最终在Virtualbox上进行了测试,它创建了一个完全无人值守的安装。
问题
我是否需要编辑`isolinux/isolinux.cfg`文件?
在另一篇帖子中,他们似乎能够编辑`isolinux/txt.cfg`文件并使其工作。我尝试了大约一个小时使用`isolinux/txt.cfg`,但它没有起作用。
有没有人有一个更复杂的partman配方,可以直接指定分区?或者一个可行的LVM设置? 我尝试使用一个简单的LVM设置,但是重新启动后它无法启动,只会停留在黑屏上。此外,我列在文档中的任何一个预设示例都没有起作用。
感谢任何帮助。
dd if=/tmp/ubuntu16-desktop-unattended-install.iso of=/dev/sdc bs=4M && sync
。不幸的是,这个USB键(只有当它包含这个自定义iso时才会出现问题:原始的iso可以正常工作)在引导选项中没有显示,所以似乎它不是“可启动”的。也许你对发生的情况有什么想法吗? - Hadrien TOMAmkusb
将ISO放入USB中。 - dragon788mkusb
将我的USB键盘设置为可启动。谢谢你们两位! - Hadrien TOMA