微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

制作ubuntu16.04 12.04自动安装iso镜像只需要手动分区,其他自动

背景:

官网下载Ubuntu镜像安装,交互模式需要手动配置很多东西,为了快速安装,特制作自动安装镜像,方便安装系统。

以下方法是参照已经做好的12.04自动安装镜像修改16.04的镜像,最终成功,此配置方法应该是普适的。

制作方法

下载官网镜像iso文件:ubuntu-16.04.4-server-amd64.iso (http://mirrors.zju.edu.cn/ubuntu-releases/16.04/ubuntu-16.04.4-server-amd64.iso)

cd /root/
wget http://mirrors.zju.edu.cn/ubuntu-releases/16.04/ubuntu-16.04.4-server-amd64.iso
mkdir mnt
mount ubuntu-16.04.4-server-amd64.iso  mnt/
cp -rf ./mnt/* ./mnt/.disk/ ./ubuntu/  #将挂载的镜像目录copy到ubuntu目录中

将镜像文件拷贝出来后,根据以下链接修改相关配置文件

http://www.linuxdiyf.com/linux/16044.html

1.用以下内容替换isolinux.cfg文件内容(相关说明见上面链接

cp ubuntu/isolinux/isolinux.cfg{,.bak}

default autoinstall
prompt 0
timeout 100

menu title Custom Live CD
menu background splash.png
menu color title 1;37;44 #c0ffffff #00000000 std

label autoinstall
menu label autoinstall - auto install ubuntu
kernel /install/vmlinuz
append initrd=/install/initrd.gz file=/cdrom/preseed/ubuntu-server.seed boot=install debian-installer/locale=en_US console-setup/ask_detect=false keyboard-configuration/layoutcode=us automatic-ubiquity quiet splash --

2.用以下内容替换ubuntu-server.seed文件内容(相关说明见上面链接

cp ubuntu/preseed/ubuntu-server.seed{,.bak}

#locate
d-i debian-installer/locale string en_US
d-i console-tools/archs select true
d-i debian-installer/language string en
d-i debian-installer/country string us
d-i localechooser/supported-locales multiselect en_US.UTF-8,zh_CN.UTF-8

#keyboard
d-i console-setup/ask_detect boolean false
d-i console-configuration/layoutcode string us
d-i keyboard-configuration/modelcode string SKIP

#clock
d-i clock-setup/utc boolean false
d-i time/zone string Asia/Shanghai

#network
d-i netcfg/choose_interface select auto
d-i netcfg/dhcp_Failed note
d-i netcfg/dhcp_options select Do not configure the network at this time
d-i netcfg/get_hostname string cc
d-i netcfg/get_domain string cc-domain
d-i netcfg/wireless_wep string

# Mirror

d-i pkgsel/language-pack-patterns	string
d-i pkgsel/install-language-support	boolean false
d-i apt-setup/partner boolean true
d-i debian-installer/splash	boolean false
d-i oem-config-udeb/frontend	string debconf
d-i mirror/http/proxy string

# clock
d-i clock-setup/ntp boolean true

#user
d-i passwd/root-login boolean false
#d-i passwd/root-password password 123
#d-i passwd/root-password-again password 123
d-i passwd/make-user boolean true
d-i passwd/user-fullname string leo    ##用户名
d-i passwd/username string leo   ##用户名
d-i passwd/user-password password 123    ##密码
d-i passwd/user-password-again password 123
d-i user-setup/allow-password-weak boolean true
d-i user-setup/encrypt-home boolean false

#basic system
#d-i base-installer/kernel/linux/initramfs-generators string yaird

#package
tasksel tasksel/first multiselect ubuntu-desktop
d-i pkgsel/include string openssh-server	build-essential vim landscape-common
d-i pkgsel/update-policy select none

#grub
d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean true

# Finish
d-i finish-install/reboot_in_progress note
oem-config	oem-config/steps	multiselect language,timezone,keyboard,user,network,tasksroot

修改完毕后,将ubuntu目录重新打包成iso镜像

mkisofs 命令使用参考这里(http://man.linuxde.net/mkisofs)

mkisofs -R -J -T -v -no-emul-boot -boot-load-size 4 -boot-info-table -b isolinux/isolinux.bin -c isolinux/boot.cat -o auto-ubuntu-16.04.4-server-amd64.iso  ubuntu/

生成的可以自动安装的iso镜像为:auto-ubuntu-16.04.4-server-amd64.iso


完毕。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐