特殊:Badtitle/NS100:Installation/UnattendedCD
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/Installation/UnattendedCD }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:Installation/UnattendedCD | UbuntuHelp:Installation/UnattendedCD | {{#if: | :}}Installation/UnattendedCD}}/af | • {{#if: UbuntuHelp:Installation/UnattendedCD|Afrikaans| [[::Installation/UnattendedCD/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/UnattendedCD | UbuntuHelp:Installation/UnattendedCD | {{#if: | :}}Installation/UnattendedCD}}/ar | • {{#if: UbuntuHelp:Installation/UnattendedCD|العربية| [[::Installation/UnattendedCD/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/UnattendedCD | UbuntuHelp:Installation/UnattendedCD | {{#if: | :}}Installation/UnattendedCD}}/az | • {{#if: UbuntuHelp:Installation/UnattendedCD|azərbaycanca| [[::Installation/UnattendedCD/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/UnattendedCD | UbuntuHelp:Installation/UnattendedCD | {{#if: | :}}Installation/UnattendedCD}}/bcc | • {{#if: UbuntuHelp:Installation/UnattendedCD|جهلسری بلوچی| [[::Installation/UnattendedCD/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/UnattendedCD | UbuntuHelp:Installation/UnattendedCD | {{#if: | :}}Installation/UnattendedCD}}/bg | • {{#if: UbuntuHelp:Installation/UnattendedCD|български| [[::Installation/UnattendedCD/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/UnattendedCD | UbuntuHelp:Installation/UnattendedCD | {{#if: | :}}Installation/UnattendedCD}}/br | • {{#if: UbuntuHelp:Installation/UnattendedCD|brezhoneg| [[::Installation/UnattendedCD/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/UnattendedCD | UbuntuHelp:Installation/UnattendedCD | {{#if: | :}}Installation/UnattendedCD}}/ca | • {{#if: UbuntuHelp:Installation/UnattendedCD|català| [[::Installation/UnattendedCD/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/UnattendedCD | UbuntuHelp:Installation/UnattendedCD | {{#if: | :}}Installation/UnattendedCD}}/cs | • {{#if: UbuntuHelp:Installation/UnattendedCD|čeština| [[::Installation/UnattendedCD/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/UnattendedCD | UbuntuHelp:Installation/UnattendedCD | {{#if: | :}}Installation/UnattendedCD}}/de | • {{#if: UbuntuHelp:Installation/UnattendedCD|Deutsch| [[::Installation/UnattendedCD/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/UnattendedCD | UbuntuHelp:Installation/UnattendedCD | {{#if: | :}}Installation/UnattendedCD}}/el | • {{#if: UbuntuHelp:Installation/UnattendedCD|Ελληνικά| [[::Installation/UnattendedCD/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/UnattendedCD | UbuntuHelp:Installation/UnattendedCD | {{#if: | :}}Installation/UnattendedCD}}/es | • {{#if: UbuntuHelp:Installation/UnattendedCD|español| [[::Installation/UnattendedCD/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/UnattendedCD | UbuntuHelp:Installation/UnattendedCD | {{#if: | :}}Installation/UnattendedCD}}/fa | • {{#if: UbuntuHelp:Installation/UnattendedCD|فارسی| [[::Installation/UnattendedCD/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/UnattendedCD | UbuntuHelp:Installation/UnattendedCD | {{#if: | :}}Installation/UnattendedCD}}/fi | • {{#if: UbuntuHelp:Installation/UnattendedCD|suomi| [[::Installation/UnattendedCD/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/UnattendedCD | UbuntuHelp:Installation/UnattendedCD | {{#if: | :}}Installation/UnattendedCD}}/fr | • {{#if: UbuntuHelp:Installation/UnattendedCD|français| [[::Installation/UnattendedCD/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/UnattendedCD | UbuntuHelp:Installation/UnattendedCD | {{#if: | :}}Installation/UnattendedCD}}/gu | • {{#if: UbuntuHelp:Installation/UnattendedCD|ગુજરાતી| [[::Installation/UnattendedCD/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/UnattendedCD | UbuntuHelp:Installation/UnattendedCD | {{#if: | :}}Installation/UnattendedCD}}/he | • {{#if: UbuntuHelp:Installation/UnattendedCD|עברית| [[::Installation/UnattendedCD/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/UnattendedCD | UbuntuHelp:Installation/UnattendedCD | {{#if: | :}}Installation/UnattendedCD}}/hu | • {{#if: UbuntuHelp:Installation/UnattendedCD|magyar| [[::Installation/UnattendedCD/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/UnattendedCD | UbuntuHelp:Installation/UnattendedCD | {{#if: | :}}Installation/UnattendedCD}}/id | • {{#if: UbuntuHelp:Installation/UnattendedCD|Bahasa Indonesia| [[::Installation/UnattendedCD/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/UnattendedCD | UbuntuHelp:Installation/UnattendedCD | {{#if: | :}}Installation/UnattendedCD}}/it | • {{#if: UbuntuHelp:Installation/UnattendedCD|italiano| [[::Installation/UnattendedCD/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/UnattendedCD | UbuntuHelp:Installation/UnattendedCD | {{#if: | :}}Installation/UnattendedCD}}/ja | • {{#if: UbuntuHelp:Installation/UnattendedCD|日本語| [[::Installation/UnattendedCD/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/UnattendedCD | UbuntuHelp:Installation/UnattendedCD | {{#if: | :}}Installation/UnattendedCD}}/ko | • {{#if: UbuntuHelp:Installation/UnattendedCD|한국어| [[::Installation/UnattendedCD/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/UnattendedCD | UbuntuHelp:Installation/UnattendedCD | {{#if: | :}}Installation/UnattendedCD}}/ksh | • {{#if: UbuntuHelp:Installation/UnattendedCD|Ripoarisch| [[::Installation/UnattendedCD/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/UnattendedCD | UbuntuHelp:Installation/UnattendedCD | {{#if: | :}}Installation/UnattendedCD}}/mr | • {{#if: UbuntuHelp:Installation/UnattendedCD|मराठी| [[::Installation/UnattendedCD/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/UnattendedCD | UbuntuHelp:Installation/UnattendedCD | {{#if: | :}}Installation/UnattendedCD}}/ms | • {{#if: UbuntuHelp:Installation/UnattendedCD|Bahasa Melayu| [[::Installation/UnattendedCD/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/UnattendedCD | UbuntuHelp:Installation/UnattendedCD | {{#if: | :}}Installation/UnattendedCD}}/nl | • {{#if: UbuntuHelp:Installation/UnattendedCD|Nederlands| [[::Installation/UnattendedCD/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/UnattendedCD | UbuntuHelp:Installation/UnattendedCD | {{#if: | :}}Installation/UnattendedCD}}/no | • {{#if: UbuntuHelp:Installation/UnattendedCD|norsk| [[::Installation/UnattendedCD/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/UnattendedCD | UbuntuHelp:Installation/UnattendedCD | {{#if: | :}}Installation/UnattendedCD}}/oc | • {{#if: UbuntuHelp:Installation/UnattendedCD|occitan| [[::Installation/UnattendedCD/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/UnattendedCD | UbuntuHelp:Installation/UnattendedCD | {{#if: | :}}Installation/UnattendedCD}}/pl | • {{#if: UbuntuHelp:Installation/UnattendedCD|polski| [[::Installation/UnattendedCD/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/UnattendedCD | UbuntuHelp:Installation/UnattendedCD | {{#if: | :}}Installation/UnattendedCD}}/pt | • {{#if: UbuntuHelp:Installation/UnattendedCD|português| [[::Installation/UnattendedCD/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/UnattendedCD | UbuntuHelp:Installation/UnattendedCD | {{#if: | :}}Installation/UnattendedCD}}/ro | • {{#if: UbuntuHelp:Installation/UnattendedCD|română| [[::Installation/UnattendedCD/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/UnattendedCD | UbuntuHelp:Installation/UnattendedCD | {{#if: | :}}Installation/UnattendedCD}}/ru | • {{#if: UbuntuHelp:Installation/UnattendedCD|русский| [[::Installation/UnattendedCD/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/UnattendedCD | UbuntuHelp:Installation/UnattendedCD | {{#if: | :}}Installation/UnattendedCD}}/si | • {{#if: UbuntuHelp:Installation/UnattendedCD|සිංහල| [[::Installation/UnattendedCD/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/UnattendedCD | UbuntuHelp:Installation/UnattendedCD | {{#if: | :}}Installation/UnattendedCD}}/sq | • {{#if: UbuntuHelp:Installation/UnattendedCD|shqip| [[::Installation/UnattendedCD/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/UnattendedCD | UbuntuHelp:Installation/UnattendedCD | {{#if: | :}}Installation/UnattendedCD}}/sr | • {{#if: UbuntuHelp:Installation/UnattendedCD|српски / srpski| [[::Installation/UnattendedCD/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/UnattendedCD | UbuntuHelp:Installation/UnattendedCD | {{#if: | :}}Installation/UnattendedCD}}/sv | • {{#if: UbuntuHelp:Installation/UnattendedCD|svenska| [[::Installation/UnattendedCD/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/UnattendedCD | UbuntuHelp:Installation/UnattendedCD | {{#if: | :}}Installation/UnattendedCD}}/th | • {{#if: UbuntuHelp:Installation/UnattendedCD|ไทย| [[::Installation/UnattendedCD/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/UnattendedCD | UbuntuHelp:Installation/UnattendedCD | {{#if: | :}}Installation/UnattendedCD}}/tr | • {{#if: UbuntuHelp:Installation/UnattendedCD|Türkçe| [[::Installation/UnattendedCD/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/UnattendedCD | UbuntuHelp:Installation/UnattendedCD | {{#if: | :}}Installation/UnattendedCD}}/vi | • {{#if: UbuntuHelp:Installation/UnattendedCD|Tiếng Việt| [[::Installation/UnattendedCD/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/UnattendedCD | UbuntuHelp:Installation/UnattendedCD | {{#if: | :}}Installation/UnattendedCD}}/yue | • {{#if: UbuntuHelp:Installation/UnattendedCD|粵語| [[::Installation/UnattendedCD/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/UnattendedCD | UbuntuHelp:Installation/UnattendedCD | {{#if: | :}}Installation/UnattendedCD}}/zh | • {{#if: UbuntuHelp:Installation/UnattendedCD|中文| [[::Installation/UnattendedCD/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/UnattendedCD | UbuntuHelp:Installation/UnattendedCD | {{#if: | :}}Installation/UnattendedCD}}/zh-hans | • {{#if: UbuntuHelp:Installation/UnattendedCD|中文(简体)| [[::Installation/UnattendedCD/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/UnattendedCD | UbuntuHelp:Installation/UnattendedCD | {{#if: | :}}Installation/UnattendedCD}}/zh-hant | • {{#if: UbuntuHelp:Installation/UnattendedCD|中文(繁體)| [[::Installation/UnattendedCD/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:Installation/UnattendedCD|:Installation/UnattendedCD|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :Installation/UnattendedCD/zh | | {{#ifexist: Installation/UnattendedCD/zh | | {{#ifeq: {{#titleparts:Installation/UnattendedCD|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:Installation/UnattendedCD|1|-1|}} | zh | | }}
Goal
The goal of this guide is to help you create an Ubuntu installation CD that you can use to perform unattended installations. Configuration files will be fetched from a web server, so the process can be easily updated without the need to master and burn more CDs. Control of a DHCP server is not required.
Caveats
This system has not been used in a production environment. This guide was developed with the Ubuntu Jaunty (9.04) Server Install CD. For other versions and varieties of Ubuntu, some parts may vary. The custom installation CD is somewhat dangerous, in that you just need to press "enter" after booting to it, and it will proceed to erase the system's hard drive without further confirmation.
Components
Once set up, the system will consist of the following parts:
- A customized installation CD.
- A web server which provides the preseed file.
Usage
Once completed, the CD can be used as follows:
- Connect a keyboard and monitor to a fresh server.
- Boot the server using the CD.
- Press enter to select the "Unattended Installation" option.
- Wait for installation to complete.
- Remove the CD.
- Log in to the server and perform any specific setup tasks.
Guide
Custom installation CD
We'll use the Jaunty server install CD as a base, and make the following changes:
- Set a default language so the language selection menu doesn't appear.
- Add a menu entry called "Unattended Installation" on top of the menu.
Preparation
- Decide on the webserver you'll be using, and construct the general URL for the preseed file. This will be hardcoded into the CD. A good URL is something like: http://mywebserver.mydomain.tld/preseed/ubuntu-9.04.seed
- Determine the codes for your language. You'll need a short one (e.g., "en" for "English") and a longer one for the locale (e.g., "en_US" for U.S. English).
Process
- Download the Ubuntu CD image to be customized from your favorite mirror.
- Install isomaster
- Run isomaster, giving it the Ubuntu CD image as a parameter.
- In isomaster's Tools menu, select Options, then change the editor to "gedit"
- Create a text file in your home directory called "lang" containing the text "en"
- In isomaster's bottom pane, enter the /isolinux directory
- In the top pane, select the file "lang"
- Click the "add" button. You should now have a /isolinux/lang file in the ISO image.
- In the /isolinux directory, select text.cfg and edit it.
- It contains four or five menu options. Add a new one as the first menu option, and set it as the default. Use the example below, but use your own URL and locale. Also, the "append" setting all goes on one line.
default unattended label unattended menu label ^Unattended Installation kernel /install/vmlinuz append preseed/url=http://mywebserver.mydomain.tld/preseed/ubuntu-9.04.seed debian-installer/locale=en_US netcfg/choose_interface=auto initrd=/install/initrd.gz priority=critical --
Explanation: There are several setup questions that occur before your preseed file will be fetched. Some of the options that are set using the "append" directive above provide answers to those questions so they won't be asked.
- Setting preseed/url makes the cd download your preseed file, which can be modified without remastering the CD.
- Setting the locale prevents the installer from asking your locale.
- Setting netcfg/choose_interface makes the installer choose a likely interface. The next thing the installer will do is download the preseed file.
- Setting priority=critical prevents low-priority questions from being asked.
The "append" setting is the last one, and it all goes on one line, up to and including the double dash (--).
- Save text.cfg and close gedit.
- Tell isolinux to "save as", and give it a filename for the new, remastered ISO file. Example: ubuntu-9.04-server-unattended-i386.iso
- Burn the CD. Example: cdrecord ubuntu-9.04-server-unattended-i386.iso
webserver
The webserver's duty is to serve the preseed file. General webserver setup is beyond the scope of this guide. But, a simple way to do it is (using root privileges): mkdir /var/www/preseed ... and then copy the relevant files to /var/www/preseed.
preseed file
This file controls the installation process. There is a lot that can be done with it. In this guide, I'll just note the settings that need to be changed to accomplish an unattended installation.
- Grab an example preseed file. For Ubuntu 9.04, get this one: https://help.ubuntu.com/9.04/installation-guide/powerpc/preseed-using.html
- Decide on root's password.
- Get the password hash by executing: echo "PASSWORD" | mkpasswd -s -m md5
- Change the following settings.
Setting | Value |
partman-auto/disk | /dev/sda |
passwd/root-login | true |
passwd/make-user | false |
passwd/root-password-crypted | (the password hash) |
pkgsel/include | openssh-server wget |
That will suffice to make the installation unattended. You may also want to customize it further, omitting the installation of extra software, and so forth; see https://help.ubuntu.com/9.04/installation-guide/powerpc/preseed-contents.html
- Put the preseed file on the webserver so that the customized CD will fetch it and use it. Copy it to /var/www/preseed, giving it the proper name (e.g., ubuntu-9.04.seed).
Testing
By following the instructions above, you should have an Ubuntu installation CD that will run unattended. You boot a fresh new server using the CD, press enter to choose the "Unattended Installation" option, and the CD does the rest. Follow the steps in the "Usage" section above and ensure that everything's working OK.