Ubuntu/Debianpxe/isopreseed
Ubuntu/Debian pxe/iso preseed
以ubuntu-server-14.04.1为例:
提示:官方建议以一台己装好的ubuntu主机生成模板preseed,/var/log/installer/cdebconf记录了整个过程
效验preseed文件的合法性,debconf-set-selections -c preseed.cfg
详见官方iso doc中的附录,以下是少许摘录
preseed也有一些限制,如,当磁盘已经存在分区时,会弹出确认框
B.1.2. Limitations
Although most questions used by debian-installer can be
preseeded using this method, there are some notable exceptions. You
must (re)partition an entire disk or use available free space on a
disk; it is not possible to use existing partitions.
### Localization
# Preseeding only locale sets language, country and locale.
#d-i debian-installer/language string en_US
# The values can also be preseeded individually for greater flexibility.
d-i debian-installer/language string en
d-i debian-installer/country string HK
d-i debian-installer/locale string en_US.UTF-8
#d-i debian-installer/locale string en_GB.UTF-8
# Optionally specify additional locales to be generated.
# d-i localechooser/supported-locales en_US.UTF-8, zh_CN.UTF-8
d-i
localechooser/supported-locales en_US.UTF-8
# Keyboard selection.
# Disable automatic (interactive) keymap detection.
d-i console-setup/ask_detect boolean false
#d-i keyboard-configuration/modelcode string pc105
d-i keyboard-configuration/layoutcode string us
# To select a variant of the selected layout (if you leave this out, the
# basic form of the layout will be used):
#d-i keyboard-configuration/variantcode string dvorak
### Network configuration
# Disable network configuration entirely. This is useful for cdrom
# installations on non-networked devices where the network questions,
# warning and long timeouts are a nuisance.
#d-i netcfg/enable boolean false
# netcfg will choose an interface that has link if possible. This makes it
# skip displaying a list if there is more than one interface.
d-i netcfg/choose_interface select auto
# To pick a particular interface instead:
#d-i netcfg/choose_interface select eth1
# If you have a slow dhcp server and the installer times out waiting for
# it, this might be useful.
#d-i netcfg/dhcp_timeout string 60
# If you prefer to configure the network manually, uncomment this line and
# the static network configuration below.
#d-i netcfg/disable_autoconfig boolean true
# If you want the preconfiguration file to work on systems both with and
# without a dhcp server, uncomment these lines and the static network
# configuration below.
#d-i netcfg/dhcp_failed note
#d-i netcfg/dhcp_options select Configure network manually
# Static network configuration.
#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
# Any hostname and domain names assigned from dhcp take precedence over
# values set here. However, setting the values still prevents the questions
# from being shown, even if values come from dhcp.
#d-i netcfg/get_hostname string localhost
#d-i netcfg/get_domain string localhost.localdomain
#不管有没有指定,preseed文件中的hostname不生效,只能通过syslinux传递对应内核参数
# Disable that annoying WEP key dialog.
d-i netcfg/wireless_wep string
# The wacky dhcp hostname that some ISPs use as a password of sorts.
#d-i netcfg/dhcp_hostname string radish
# If non-free firmware is needed for the network or other hardware, you can
# configure the installer to always try to load it, without prompting. Or
# change to false to disable asking.
#d-i hw-detect/load_firmware boolean true
### Network console
# Use the following settings if you wish to make use of the network-console
# component for remote installation over SSH. This only makes sense if you
# intend to perform the remainder of the installation manually.
#d-i anna/choose_modules string network-console
#d-i network-console/password password r00tme
#d-i network-console/password-again password r00tme
# Use this instead if you prefer to use key-based authentication
#d-i network-console/authorized_keys_url http://host/authorized_keys
### Mirror settings
# If you select ftp, the mirror/country string does not need to be set.
#d-i mirror/protocol string ftp
d-i mirror/country string manual
d-i mirror/protocol string http
d-i mirror/http/hostname string 192.168.8.254
d-i mirror/http/directory string /ftp/ubuntu14.04
d-i mirror/http/proxy string
####################################
#Ubuntu12.10 or later(10.04,12.04, etc need to be comment out)
d-i live-installer/net-image string http://192.168.8.254/ftp/ubuntu14.04/install/filesystem.squashfs
####################################
# Alternatively: by default, the installer uses CC.archive.ubuntu.com where
# CC is the ISO-3166-2 code for the selected country. You can preseed this
# so that it does so without asking.
d-i mirror/http/mirror select 192.168.8.254
# Suite to install.
d-i mirror/suite string trusty
# Suite to use for loading installer components (optional).
d-i mirror/udeb/suite string trusty
# Components to use for loading installer components (optional).
d-i mirror/udeb/components multiselect main, restricted
### Clock and time zone setup
# Controls whether or not the hardware clock is set to UTC.
d-i clock-setup/utc boolean true
# You may set this to any valid setting for $TZ; see the contents of
# /usr/share/zoneinfo/ for valid values.
d-i time/zone string Asia/Shanghai
# Controls whether to use NTP to set the clock during the install
#d-i clock-setup/ntp boolean true
d-i clock-setup/ntp boolean false
# NTP server to use. The default is almost always fine here.
#d-i clock-setup/ntp-server string 192.168.8.254
### Partitioning
## Partitioning example
# If the system has free space you can choose to only partition that space.
# This is only honoured if partman-auto/method (below) is not set.
# Alternatives: custom, some_device, some_device_crypto, some_device_lvm.
#d-i partman-auto/init_automatically_partition select biggest_free
d-i partman-auto/init_automatically_partition select custom
# Alternatively, you may specify a disk to partition. If the system has only
# one disk the installer will default to using that, but otherwise the device
# name must be given in traditional, non-devfs format (so e.g. /dev/hda or
# /dev/vda, and not e.g. /dev/discs/disc0/disc).
# For example, to use the first SCSI/SATA hard disk:
d-i partman-auto/disk string /dev/vda
# In addition, you'll need to specify the method to use.
# The presently available methods are:
# - regular: use the usual partition types for your architecture
# - lvm:
use LVM to partition the disk
# - crypto: use LVM within an encrypted
partition
#d-i partman-auto/method string regular
##############################################################
d-i partman-auto/method string lvm
# If one of the disks that are going to be automatically partitioned
# contains an old LVM configuration, the user will normally receive a
# warning. This can be preseeded away...
d-i partman-lvm/device_remove_lvm boolean true
# The same applies to pre-existing software RAID array:
d-i partman-md/device_remove_md boolean true
# And the same goes for the confirmation to write the lvm partitions.
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
#上面标红的一行一定要加上,否则对于没有任何分区的裸盘初次安装时会提示Write the changes to disks and configure LVM?
##############################################################
# For LVM partitioning, you can select how much of the volume group to use
# for logical volumes.
d-i partman-auto-lvm/guided_size string max
#d-i partman-auto-lvm/guided_size string 10GB
#d-i partman-auto-lvm/guided_size string 50%
# You can choose one of the three predefined partitioning recipes:
# - atomic: all files in one partition
# - home: separate /home
partition
# - multi: separate /home, /usr, /var, and /tmp
partitions
#d-i partman-auto/choose_recipe select atomic
##############################################################
#boot
d-i partman-auto/atomic_scheme ::
\
40 50 200
ext4
\
$primary{
}
\
$bootable{
}
\
method{ format
}
\
format{
}
\
use_filesystem{
}
\
filesystem{ ext4
}
\
# Keyboard selection.
# Disable automatic (interactive) keymap detection.
d-i console-setup/ask_detect boolean false
#d-i keyboard-configuration/modelcode string pc105
d-i keyboard-configuration/layoutcode string us
# To select a variant of the selected layout (if you leave this out, the
# basic form of the layout will be used):
#d-i keyboard-configuration/variantcode string dvorak
### Network configuration
# Disable network configuration entirely. This is useful for cdrom
# installations on non-networked devices where the network questions,
# warning and long timeouts are a nuisance.
#d-i netcfg/enable boolean false
# netcfg will choose an interface that has link if possible. This makes it
# skip displaying a list if there is more than one interface.
d-i netcfg/choose_interface select auto
# To pick a particular interface instead:
#d-i netcfg/choose_interface select eth1
# If you have a slow dhcp server and the installer times out waiting for
# it, this might be useful.
#d-i netcfg/dhcp_timeout string 60
# If you prefer to configure the network manually, uncomment this line and
# the static network configuration below.
#d-i netcfg/disable_autoconfig boolean true
# If you want the preconfiguration file to work on systems both with and
# without a dhcp server, uncomment these lines and the static network
# configuration below.
#d-i netcfg/dhcp_failed note
#d-i netcfg/dhcp_options select Configure network manually
# Static network configuration.
#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
# Any hostname and domain names assigned from dhcp take precedence over
# values set here. However, setting the values still prevents the questions
# from being shown, even if values come from dhcp.
#d-i netcfg/get_hostname string localhost
#d-i netcfg/get_domain string localhost.localdomain
#不管有没有指定,preseed文件中的hostname不生效,只能通过syslinux传递对应内核参数
# Disable that annoying WEP key dialog.
d-i netcfg/wireless_wep string
# The wacky dhcp hostname that some ISPs use as a password of sorts.
#d-i netcfg/dhcp_hostname string radish
# If non-free firmware is needed for the network or other hardware, you can
# configure the installer to always try to load it, without prompting. Or
# change to false to disable asking.
#d-i hw-detect/load_firmware boolean true
### Network console
# Use the following settings if you wish to make use of the network-console
# component for remote installation over SSH. This only makes sense if you
# intend to perform the remainder of the installation manually.
#d-i anna/choose_modules string network-console
#d-i network-console/password password r00tme
#d-i network-console/password-again password r00tme
# Use this instead if you prefer to use key-based authentication
#d-i network-console/authorized_keys_url http://host/authorized_keys
### Mirror settings
# If you select ftp, the mirror/country string does not need to be set.
#d-i mirror/protocol string ftp
d-i mirror/country string manual
d-i mirror/protocol string http
d-i mirror/http/hostname string 192.168.8.254
d-i mirror/http/directory string /ftp/ubuntu14.04
d-i mirror/http/proxy string
####################################
#Ubuntu12.10 or later(10.04,12.04, etc need to be comment out)
d-i live-installer/net-image string http://192.168.8.254/ftp/ubuntu14.04/install/filesystem.squashfs
####################################
# Alternatively: by default, the installer uses CC.archive.ubuntu.com where
# CC is the ISO-3166-2 code for the selected country. You can preseed this
# so that it does so without asking.
d-i mirror/http/mirror select 192.168.8.254
# Suite to install.
d-i mirror/suite string trusty
# Suite to use for loading installer components (optional).
d-i mirror/udeb/suite string trusty
# Components to use for loading installer components (optional).
d-i mirror/udeb/components multiselect main, restricted
### Clock and time zone setup
# Controls whether or not the hardware clock is set to UTC.
d-i clock-setup/utc boolean true
# You may set this to any valid setting for $TZ; see the contents of
# /usr/share/zoneinfo/ for valid values.
d-i time/zone string Asia/Shanghai
# Controls whether to use NTP to set the clock during the install
#d-i clock-setup/ntp boolean true
d-i clock-setup/ntp boolean false
# NTP server to use. The default is almost always fine here.
#d-i clock-setup/ntp-server string 192.168.8.254
### Partitioning
## Partitioning example
# If the system has free space you can choose to only partition that space.
# This is only honoured if partman-auto/method (below) is not set.
# Alternatives: custom, some_device, some_device_crypto, some_device_lvm.
#d-i partman-auto/init_automatically_partition select biggest_free
d-i partman-auto/init_automatically_partition select custom
# Alternatively, you may specify a disk to partition. If the system has only
# one disk the installer will default to using that, but otherwise the device
# name must be given in traditional, non-devfs format (so e.g. /dev/hda or
# /dev/vda, and not e.g. /dev/discs/disc0/disc).
# For example, to use the first SCSI/SATA hard disk:
d-i partman-auto/disk string /dev/vda
# In addition, you'll need to specify the method to use.
# The presently available methods are:
# - regular: use the usual partition types for your architecture
# - lvm:
# - crypto:
#d-i partman-auto/method string regular
##############################################################
d-i partman-auto/method string lvm
# If one of the disks that are going to be automatically partitioned
# contains an old LVM configuration, the user will normally receive a
# warning. This can be preseeded away...
d-i partman-lvm/device_remove_lvm boolean true
# The same applies to pre-existing software RAID array:
d-i partman-md/device_remove_md boolean true
# And the same goes for the confirmation to write the lvm partitions.
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
#上面标红的一行一定要加上,否则对于没有任何分区的裸盘初次安装时会提示Write the changes to disks and configure LVM?
##############################################################
# For LVM partitioning, you can select how much of the volume group to use
# for logical volumes.
d-i partman-auto-lvm/guided_size string max
#d-i partman-auto-lvm/guided_size string 10GB
#d-i partman-auto-lvm/guided_size string 50%
# You can choose one of the three predefined partitioning recipes:
# - atomic: all files in one partition
# - home:
# - multi:
#d-i partman-auto/choose_recipe select atomic
##############################################################
#boot
d-i partman-auto/atomic_scheme ::