[ubuntu 12.04] u盘自动安装ubuntu desktop 12.04

1 格式化u盘

mkfs.vfat /dev/sdb4


2 制作启动文件

umount /dev/sdb4

syslinux /dev/sdb4


3 把镜像内所有文文件 copy 到 u 盘根目录

mount -o loop ubuntu-12.04-desktop-amd64.iso /mnt/ubu

cp -r /mnt/ubu/* /media/1307-AF06/


4 准备 autoinstall.seed

cp autoinstall.seed /media/1307-AF06/preseed/autoinstall.seed


5 更改文件目录

mv isolinux syslinux

cd syslinux

mv isolinux.cfg syslinux.cfg


6 修改syslinux.cfg 文件

vim syslinux.cfg

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 live
  menu label live - boot the Live System
  kernel /casper/vmlinuz
  append  file=/cdrom/preseed/custom.seed boot=casper initrd=/casper/initrd.gz quiet splash --

label xforcevesa
  menu label xforcevesa - boot Live in safe graphics mode
  kernel /casper/vmlinuz
  append  file=/cdrom/preseed/custom.seed boot=casper xforcevesa initrd=/casper/initrd.gz quiet splash --

label install
  menu label install - start the installer directly
  kernel /casper/vmlinuz
  append  file=/cdrom/preseed/custom.seed boot=casper only-ubiquity initrd=/casper/initrd.gz quiet splash --

label textonly
  menu label textonly - boot Live in textonly mode
  kernel /casper/vmlinuz
  append  file=/cdrom/preseed/custom.seed boot=casper textonly initrd=/casper/initrd.gz quiet --

label debug
  menu label debug - boot the Live System without splash and show boot info
  kernel /casper/vmlinuz
  append  file=/cdrom/preseed/custom.seed boot=casper initrd=/casper/initrd.gz nosplash --

label memtest
  menu label memtest - Run memtest
  kernel /isolinux/memtest
  append -

label hd
  menu label hd - boot the first hard disk
  localboot 0x80
  append -

label autoinstall
menu label autoinstall - auto install ubuntu
kernel /casper/vmlinuz
append initrd=/casper/initrd.gz file=/cdrom/preseed/autoinstall.seed boot=casper debian-installer/locale=zh_CN kdb-chooser/method=us console-setup/layoutcode=us automatic-ubiquity quiet splash --

7 附 autoinstall.peed 文件

d-i debian-installer/locale string en_US
d-i console-setup/ask_detect boolean false
d-i console-configuration/layoutcode string us
d-i keyboard-configuration/modelcode string SKIP 
d-i clock-setup/utc boolean false
d-i time/zone string Asia/Shanghai
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 cbpos
d-i netcfg/get_domain string cbpos-domain
d-i netcfg/wireless_wep string
d-i mirror/country string china
d-i mirror/http/hostname string xingwei
d-i mirror/http/directory string /ubuntu
d-i mirror/http/proxy string
d-i clock-setup/ntp boolean true
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 home
d-i partman/default_filesystem string ext4
d-i partman/confirm_write_new_label boolean true
d-i partman/choose_partition \
d-i partman/confirm boolean true
d-i passwd/user-fullname string xingwei password 123456
d-i passwd/username string xingwei
d-i passwd/user-password password 123456
d-i passwd/user-password-again password 123456
d-i lilo-installer/skip boolean true
d-i grub-installer/only_debian boolean true
d-i finish-install/reboot_in_progress note




你可能感兴趣的:([ubuntu 12.04] u盘自动安装ubuntu desktop 12.04)