官网下载Ubuntu镜像安装,交互模式需要手动配置很多东西,为了快速安装,特制作自动安装镜像,方便安装系统。
https://www.debian.org/releases/stable/i386/apb.html
https://www.debian.org/releases/stretch/example-preseed.txt
https://www.debian.org/releases/stable/i386/apbs04.html.zh-cn#preseed-partman
制作方法:
下载官网镜像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 0timeout 100menu title Custom Live CDmenu background splash.pngmenu color title 1;37;44 #c0ffffff #00000000 std label autoinstallmenu label autoinstall - auto install ubuntukernel /install/vmlinuzappend 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 trued-i debian-installer/language string end-i debian-installer/country string usd-i localechooser/supported-locales multiselect en_US.UTF-8, zh_CN.UTF-8
#keyboardd-i console-setup/ask_detect boolean falsed-i console-configuration/layoutcode string usd-i keyboard-configuration/modelcode string SKIP #clockd-i clock-setup/utc boolean falsed-i time/zone string Asia/Shanghai #networkd-i netcfg/choose_interface select autod-i netcfg/dhcp_failed noted-i netcfg/dhcp_options select Do not configure the network at this timed-i netcfg/get_hostname string ccd-i netcfg/get_domain string cc-domaind-i netcfg/wireless_wep string # Mirrord-i pkgsel/language-pack-patterns string
d-i pkgsel/install-language-support boolean falsed-i apt-setup/partner boolean trued-i debian-installer/splash boolean falsed-i oem-config-udeb/frontend string debconfd-i mirror/http/proxy string # clockd-i clock-setup/ntp boolean true ## set root passwordd-i passwd/root-login boolean rootd-i passwd/root-password password rootd-i passwd/root-password-again password rootd-i user-setup/allow-password-weak boolean true #userd-i passwd/root-login boolean false#d-i passwd/root-password password 123#d-i passwd/root-password-again password 123d-i passwd/make-user boolean trued-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 123d-i user-setup/allow-password-weak boolean trued-i user-setup/encrypt-home boolean false ## Disk usaged-i partman-auto/disk string /dev/sda#d-i partman-auto/method string lvm#d-i partman-auto-lvm/guided_size string maxd-i partman-auto/method string regulard-i partman-lvm/device_remove_lvm boolean trued-i partman-md/device_remove_md boolean trued-i partman-lvm/confirm boolean trued-i partman-lvm/confirm_nooverwrite boolean trued-i partman-auto/choose_recipe select atomicd-i partman-partitioning/confirm_write_new_label boolean trued-i partman/choose_partition select finishd-i partman/confirm boolean trued-i partman/confirm_nooverwrite boolean true#basic system#d-i base-installer/kernel/linux/initramfs-generators string yaird #packagetasksel tasksel/first multiselect ubuntu-desktopd-i pkgsel/include string openssh-server build-essential vim landscape-commond-i pkgsel/update-policy select none #grubd-i grub-installer/only_debian boolean trued-i grub-installer/with_other_os boolean true # Finishd-i finish-install/reboot_in_progress noteoem-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
https://blog.csdn.net/Frank_Abagnale/article/details/78963876
https://blog.csdn.net/jinyuxiaoqiang/article/details/80827497
https://www.linuxidc.com/Linux/2015-08/121662.htm
https://blog.csdn.net/ak47mig/article/details/7068568
http://blog.51cto.com/yangzhiming/2052396
完毕。
补充,实践发现,在vmware 的Esxi 上安装ubuntu16.04 使用该镜像可以正常安装启动。
但是在dell服务器上安装 开机后,正常到选择启动项后,找到硬盘后直接黑屏,不显示启动时的那些信息。好像系统没有正确安装一样。
解决方法是 : Ctrl +Alt +F1 进如tty1 。进如系统后 把/etc/default/grub 里面的GRUB_CMDLINE_LINUX_DEFAULT="quiet" 里面的quiet删掉即可。
-----------------------------isolinux.cfg -----------------
default autoinstall
prompt 0timeout 100menu title Custom Live CDmenu background splash.pngmenu color title 1;37;44label autoinstallmenu label autoinstall - auto install ubuntukernel /install/vmlinuzappend 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 --------------------------ubuntu-server.seed--
#locate
d-i debian-installer/locale string en_USd-i console-tools/archs select trued-i debian-installer/language string end-i debian-installer/country string usd-i localechooser/supported-locales multiselect en_US.UTF-8, zh_CN.UTF-8#keyboardd-i console-setup/ask_detect boolean falsed-i console-configuration/layoutcode string usd-i keyboard-configuration/modelcode string SKIP#clockd-i clock-setup/utc boolean falsed-i time/zone string Asia/Shanghai#networkd-i netcfg/choose_interface select autod-i netcfg/dhcp_failed noted-i netcfg/dhcp_options select Do not configure the network at this timed-i netcfg/get_hostname string kankand-i netcfg/get_domain string kankan-domaind-i netcfg/wireless_wep string#d-i netcfg/disable_autoconfig boolean true#d-i netcfg/dhcp_failed note#d-i netcfg/dhcp_options select Configure network manually#d-i netcfg/get_nameservers string 192.168.1.1#d-i netcfg/get_ipaddress string 192.168.1.42#d-i netcfg/get_netmask string 255.255.255.0#d-i netcfg/get_gateway string 192.168.1.1#d-i netcfg/confirm_static boolean true# Mirrord-i pkgsel/language-pack-patterns stringd-i pkgsel/install-language-support boolean falsed-i apt-setup/partner boolean trued-i debian-installer/splash boolean falsed-i oem-config-udeb/frontend string debconfd-i mirror/http/proxy string# clockd-i clock-setup/ntp boolean true## set root passwordd-i passwd/root-login boolean rootd-i passwd/root-password password rootd-i passwd/root-password-again password rootd-i user-setup/allow-password-weak boolean true#userd-i passwd/root-login boolean falsed-i passwd/make-user boolean trued-i passwd/user-fullname string ubuntud-i passwd/username string ubuntud-i passwd/user-password password ubuntud-i passwd/user-password-again password ubuntud-i user-setup/allow-password-weak boolean trued-i user-setup/encrypt-home boolean false## Disk usaged-i partman-auto/disk string /dev/sda#d-i partman-auto/method string lvm#d-i partman-auto-lvm/guided_size string maxd-i partman-auto/method string regulard-i partman-lvm/device_remove_lvm boolean trued-i partman-md/device_remove_md boolean trued-i partman-lvm/confirm boolean trued-i partman-lvm/confirm_nooverwrite boolean trued-i partman-auto/choose_recipe select atomicd-i partman-partitioning/confirm_write_new_label boolean trued-i partman/choose_partition select finishd-i partman/confirm boolean trued-i partman/confirm_nooverwrite boolean true#basic system#d-i base-installer/kernel/linux/initramfs-generators string yaird#package#tasksel tasksel/first multiselecttasksel tasksel/first multiselect ubuntu-desktopd-i pkgsel/include string openssh-server build-essential vim landscape-common ubuntu-desktop#d-i pkgsel/include string gnome-shell ubuntu-gnome-desktopd-i pkgsel/update-policy select none#grubd-i grub-installer/only_debian boolean trued-i grub-installer/with_other_os boolean true# Finishd-i finish-install/reboot_in_progress noteoem-config oem-config/steps multiselect language, timezone, keyboard, user, network, tasksroot