1. Turn off the firewall
650) this.width=650; "src=" https://s3.51cto.com/wyfs02/M02/A4/82/wKioL1ms8oSwBdLjAAAaHIQ2PFE660.jpg "title=" 1.jpg "alt=" Wkiol1ms8oswbdljaaaahiq2pfe660.jpg "/>
2.PXE Environment Preparation
2.1 Server static IP settings
sudo vi/etc/network/interfaces
650) this.width=650; "src=" https://s4.51cto.com/wyfs02/M00/A4/83/wKioL1ms8s3h4PKcAAAkRlv4u0M004.jpg "title=" 2.jpg "alt=" Wkiol1ms8s3h4pkcaaakrlv4u0m004.jpg "/>
Start Eth1 Network
sudo ifup eth1
650) this.width=650; "src=" https://s3.51cto.com/wyfs02/M00/A4/83/wKioL1ms8u7i1k2pAABXA8nJhVE209.jpg "title=" 3.jpg "alt=" Wkiol1ms8u7i1k2paabxa8njhve209.jpg "/>
2.2 Installation Services
2.2.1 Installing DNSMASQ as a DNCP service
sudo apt-get install DNSMASQ
Configuring DHCP Files
sudo vi/etc/dnsmasq.conf
650) this.width=650; "src=" https://s4.51cto.com/wyfs02/M00/05/D1/wKiom1ms80bTI7DkAAA-9PMtjxk173.jpg "title=" 4.jpg "alt=" Wkiom1ms80bti7dkaaa-9pmtjxk173.jpg "/>
Bogus-priv
Filterwin2k
Interface=eth1
dhcp-range=10.0.4.100,10.0.4.200,12h
dhcp-host=08:00:27:0f:9b:1e,10.0.4.10
dhcp-boot=pxelinux.0
Enable-tftp
Tftp-root=/var/ftpd
Dhcp-authoritative
Create TFTP directory
sudo mkdir–p/var/ftpd
Start the DNSMASQ service
sudo service dnsmasq start
2.2.3 Installing the Apache2 service, providing the operating system files that need to be installed
sudo apt-get install apache2
Browser verifies that the httpd service is OK
650) this.width=650; "src=" https://s3.51cto.com/wyfs02/M00/A4/83/wKioL1ms83jRyipjAAEO5y21iII036.jpg "title=" 5.jpg "alt=" Wkiol1ms83jryipjaaeo5y21iii036.jpg "/>
Apache2 Configuration to access the installation files directory
sudo vi sites-enabled/000-default.conf
650) this.width=650; "src=" https://s2.51cto.com/wyfs02/M01/05/D1/wKiom1ms88WQMMGDAAAQ4qvAA2o960.jpg "title=" 6.jpg "alt=" Wkiom1ms88wqmmgdaaaq4qvaa2o960.jpg "/>
sudo vi/etc/apache2/apache2.conf
650) this.width=650; "src=" https://s4.51cto.com/wyfs02/M00/A4/83/wKioL1ms882QvgdXAAAXPbyYfAA639.jpg "title=" 7.jpg "alt=" Wkiol1ms882qvgdxaaaxpbyyfaa639.jpg "/>
sudo mkdir-p/var/www/ubuntu
Restarting the Apache2 directory
sudo service apache2 restart
Browser verifies that the httpd service is OK
650) this.width=650; "src=" https://s3.51cto.com/wyfs02/M02/A4/83/wKioL1ms9BeiqS9tAABfNvQE7qE827.jpg "title=" 8.jpg "alt=" Wkiol1ms9beiqs9taabfnvqe7qe827.jpg "/>
2.3. Copy ubuntu14.04 os full directory, kernel and boot image file
Mount Ubuntu–server.iso Mirror sudo mount/dev/cdrom/mnt
Copying PXE boot files and operating system files
sudo cp-vr/mnt/install/netboot/*/var/ftpd
650) this.width=650; "src=" https://s4.51cto.com/wyfs02/M01/A4/83/wKioL1ms9E6gfMBJAAAiEfIJVPg368.jpg "title=" 9.jpg "alt=" Wkiol1ms9e6gfmbjaaaiefijvpg368.jpg "/>
cp–varf/mnt/*/var/www/ubuntu
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/05/D1/wKiom1ms9H_zIKg9AAAkTZStjM4411.jpg "title=" 10. JPG "alt=" wkiom1ms9h_zikg9aaaktzstjm4411.jpg "/>
Create a KS.CFG script
sudo touch/var/www/ubuntu/ks.cfg
#Generated by Kickstart Configurator
#platform =x86
#System language
Lang en_US
#Language Modules to install
Langsupport en_US
#System keyboard
Keyboard US
#System Mouse
Mouse
#System timezone
TimeZone Asia/shanghai
#Root Password
ROOTPW--iscrypted $1$nmozxhnq$y5nsggiyuumyf7ubfthqs/
#Initial User
User--disabled
#Reboot after installation
Reboot
#Use Text Mode Install
Text
#Install OS instead of upgrade
Install
#Use Web Installation
URL--url http://10.0.4.10/ubuntu
#System bootloader Configuration
Bootloader--LOCATION=MBR
#Clear the Master Boot Record
ZEROMBR Yes
#Partition Clearing Information
Clearpart--all--initlabel
#Disk Partitioning Information
Part/boot--fstype EXT4--size 500
Part swap--size 4096
Part/--fstype ext4--size 1--grow--maxsize 1
#System Authorization Infomation
Auth--useshadow--enablemd5
#Network Information
Network--bootproto=dhcp--device=eth0
#Firewall Configuration
Firewall--disabled--ssh
#Do not configure the X Window System
Skipx
%packages
@openssh-server
sudo touch/var/www/ubuntu/ubuntu-server.seed
# # # Localization.
D-i Auto-install/enable Boolean True
D-i Debian-installer/locale String en_US
#d-I Localechooser/translation/warn-light boolean true
#d-I Localechooser/translation/warn-severe boolean true
D-i Console-setup/ask_detect Boolean False
D-i Keyboard-configuration/layoutcode String US
D-i Keyboard-configuration/modelcode String SKIP
# # # Net interface setting.
D-i Netcfg/choose_interface Select Eth0
D-i netcfg/dhcp_failed Note
D-i Netcfg/get_hostname string Ubuntu
D-i Netcfg/get_domain string Ubuntu
# # # Mirror setting. Use the local proxy.
D-i Mirror/country String Manual
D-i Mirror/protocol String http
D-i mirror/http/hostname string 10.0.4.10
D-i mirror/http/directory string /ubuntu/
D-i mirror/http/proxy string http://10.0.4.10
# # Clock and timezone setting. Use local NTP.
D-i CLOCK-SETUP/UTC Boolean True
D-i Time/zone String asia/chongqing
D-i CLOCK-SETUP/NTP Boolean True
# # # Partioning setting.
#d-I partman-auto/disk STRING/DEV/SDA
#d-I partman-auto-lvm/guided_size string max
#d-I partman-auto/choose_recipe Select atomic
D-i Partman-auto/method String Regular
#d-I partman-lvm/confirm boolean true
#d-I partman-lvm/confirm boolean true
#d-I Partman-lvm/confirm_nooverwrite boolean true
D-i PARTMAN-LVM/DEVICE_REMOVE_LVM Boolean True
D-i Partman-lvm/device_remove_md Boolean True
D-i Partman/choose_recipe Select Atomic
D-i Partman/default_filesystem String Ext4
D-i Partman/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/confirm_write_new_label boolean true
# # # Account setting.
D-i Passwd/root-login Boolean False
D-i passwd/user-fullname String Test
D-i passwd/username String Test
D-i passwd/user-password Password Test
D-i passwd/user-password-again Password Test
D-i User-setup/allow-password-weak Boolean True
D-i User-setup/encrypt-home Boolean False
D-i Live-installer/net-image String HTTP://10.0.4.10/INSTALL/FILESYSTEM.SQUASHFS
# # # Package Selection.
D-i Pkgsel/include String Openssh-server
D-i Pkgsel/upgrade Select None
D-i Pkgsel/update-policy Select None
Tasksel tasksel/first MultiSelect Standard, Ubuntu-server
# # # Boot Loader installation.
D-i Grub-installer/only_debian Boolean True
D-i Grub-installer/with_other_os Boolean True
# # # Finishing up the installation.
D-i finish-install/reboot_in_progress Note
# # # Running custom commands.
#d-I preseed/late_command string echo "Hello" >>/root/test
2.4 Starting the Select installation configuration file
sudo vi/var/ftpd/pxelinux.cfg/default
# d-i Config version 2.0
#include ubuntu-installer/amd64/boot-screens/menu.cfg
#default UBUNTU-INSTALLER/AMD64/BOOT-SCREENS/VESAMENU.C32
#prompt 0
#timeout 0
Default Linux
Label Linux
Kernel Ubuntu-installer/amd64/linux
Append ks=http://10.0.4.10/ubuntu/ks.cfg preseed/url=http://10.0.4.10//ubuntu/ubuntu-server.seed vga= Normal initrd=ubuntu-installer/amd64/initrd.gz–-
2.5 New virtual machine test PXE results
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M02/A4/83/wKioL1ms9QKjRXJ1AAAkHfwi97k128.jpg "title=" 11. JPG "alt=" wkiol1ms9qkjrxj1aaakhfwi97k128.jpg "/>
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M00/05/D2/wKiom1ms9a2h_R7fAABkgX4EzWk439.jpg "title=" 12. JPG "alt=" wkiom1ms9a2h_r7faabkgx4ezwk439.jpg "/>
This article is from the "technical Blog of Lemons" blog, be sure to keep this source http://lemonnews.blog.51cto.com/11010917/1962529
ubuntu14.04 build based on Preseed batch distribution environment