pxe + preseed. cfg 자동 설치 debian 7.4 실현

실험 환경:
vmware 10, debian 7.4, 공유 기 pppoe 인터넷 방식,
인 터 넷 게 이 트 웨 이: 192.168.1.1
내부 네트워크 dns: 192.168.1.1
본기 ip    :192.168.1.160
준비 작업

1) 설치 에 필요 한 소프트웨어 tftpd - hpa, isc - dhcp - server, apache
2) netboot. tar. gz 를 다운로드 하여 tftp server 의 루트 디 렉 터 리 에 압축 해제
http://mirrors.163.com/debian/dists/wheezy/main/installer-i386/current/images/netboot/netboot.tar.gz
1. tftp server 를 설정 하고 루트 디 렉 터 리 는 / srv / tftp 입 니 다.
root@debian:/srv/tftp/fai# cat /etc/default/tftpd-hpa
# /etc/default/tftpd-hpa
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/srv/tftp/"
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="--secure"
pxelinux. cfg / default 편집
root@debian:/srv/tftp# cat pxelinux.cfg/default
# D-I config version 2.0
#include debian-installer/i386/boot-screens/menu.cfg
default debian-installer/i386/boot-screens/vesamenu.c32
prompt 0
timeout 0
default auto
label auto
menu label ^Auto install
menu default
kernel debian-installer/i386/linux
append auto=true priority=critical vga=788 initrd=debian-installer/i386/initrd.gz debian-installer/allow_unauthenticated=true  nterface=auto netcfg/dhcp_timeout=60 netcfg/choose_interface=auto url=http://192.168.1.160/preseed.cfg
root@debian:/srv/tftp#
======================================
2. dhcp 서비스 설정:
vi /etc/dhcp/dhcpd.conf
subnet 192.168.1.0  netmask 255.255.255.0 {
 range 192.168.1.200 192.168.1.220;
 option domain-name-servers 192.168.1.1;
#  option domain-name "internal.example.org";
 option routers 192.168.1.1;
 option broadcast-address 192.168.1.255;
 default-lease-time 600;
 max-lease-time 7200;
 next-server 192.168.1.160;
 filename  "pxelinux.0";
}
3. preseed. cfg 파일 편집
이것 은 중점 입 니 다. 앞의 dhcp, tftp 는 매우 쉽 습 니 다.공식 적 으로 제공 하 는 템 플 릿 을 사용 하여 수정 할 수 있 습 니 다.
템 플 릿 위치:http://www.debian.org/releases/wheezy/example-preseed.txt
공식 설치 매 뉴 얼:http://www.debian.org/releases/wheezy/i386/
문 서 를 상세 하 게 소개 해서 잘 배 울 수 있 습 니 다. 이번 실험 은 이 문서 에 따라 한 것 입 니 다. 기술적 인 함량 이 없고 실천 만 했 을 뿐 입 니 다.
저 는 preseed. cfg 파일 의 내용 을 사용 합 니 다. 이 파일 은 apache 의 웹 페이지 파일 루트 디 렉 터 리 에 있 습 니 다.debconf - set - selections - c preseed.cfg 를 사용 하여 문법 적 정확성 을 측정 합 니 다.
root@debian:/var/www# grep -vE  "^$|^#" preseed.cfg
d-i debian-installer/locale string en_US.UTF-8
\ # \ # 키보드 설정 이 항목 은 예제 파일 을 사용 하고 있 습 니 다. d-i keymap select us   효과 가 없 으 면 키보드 레이아웃 을 선택 하 는 대화 형 인터페이스 가 나타 나 다음 줄 의 설정 을 사용 하면 정상적으로 진행 할 수 있 습 니 다.
d-i keyboard-configuration/xkb-keymap select us  
d-i netcfg/choose_interface select auto
d-i netcfg/get_hostname string unassigned-hostname
d-i netcfg/get_domain string unassigned-domain
d-i mirror/country string manual
\ # 소프트웨어 소스 여기 서 공식 미 러 소스 를 사용 하려 면 dvd 또는 cd 로 구 축 된 랜 apt 소스 를 사용 해 야 합 니 다. 자동 설치 시스템 을 실현 할 수 없습니다. 중간 에 심각 한 경고 가 발생 할 수 있 습 니 다. 인위적인 관여 가 있어 야 진행 할 수 있 습 니 다. 이것 은 자동 설치 가 불가능 합 니 다.물론 공식 소스 의 가 지 를 만 져 로 컬 미 러 를 만 드 는 것 도 고려 할 수 있 지만 시간 과 디스크 공간 이 비교적 커서 이것 을 하지 않 았 다.
d-i mirror/http/hostname string mirrors.163.com
d-i mirror/http/directory string /debian
d-i mirror/http/proxy string
d-i passwd/make-user boolean false
d-i passwd/root-password password admin
d-i passwd/root-password-again password admin
d-i clock-setup/utc boolean true
d-i time/zone string US/Eastern
d-i clock-setup/ntp boolean true
d-i partman-auto/method string lvm
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-md/device_remove_md boolean true
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman-auto/choose_recipe select atomic
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
d-i partman-md/confirm boolean true
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
d-i debian-installer/allow_unauthenticated boolean true
\ # 설치 표준 세트 를 선택 하 십시오. 기본 적 인 상황 에서 예제 파일 은 이 설명 을 떨 어 뜨 린 다음 설치 할 때 1300 여 개의 가방 을 설치 하고 standard 를 사용 하 며 100 여 개 만 사용 하면 시간 을 절약 합 니 다.물론 실제 상황 은 수요 에 따라
tasksel tasksel/first multiselect  standard
d-i finish-install/reboot_in_progress note
4. 이 과정 은 가장 간단 한 자동화 설 치 를 실 현 했 을 뿐 이 고 더 많은 사용자 정의 내용 도 수정 할 수 있다. 예 를 들 어 특정한 소프트웨어 를 지정 하고 설치 한 후에 일부 스 크 립 트 를 실행 하 는 등 또 하나의 방안 은 fai 도 구 를 사용 하 는 것 이다. 그 다음은 fai 라 는 방법 을 배 우 는 것 이다.

좋은 웹페이지 즐겨찾기