Lab environment: vmworkstation10, centos6.5, remote terminal xshell, and apache has been installed in the operating system. The ip address of the VM is 192.168.1.55. The service to be started when the server is installed on the network. DHCP: it is used to assign an IP address to the client during startup and tell the client to find the boot program for starting and installing the system on the tftp server.
Lab environment: vmworkstation10, centos6.5, remote terminal xshell, and apache has been installed in the operating system. The ip address of the VM is 192.168.1.55.
The service to be started when the server is installed on the network.
DHCP: it is used to assign an IP address to the client during startup and tell the client to find the boot program to start and install the system on the tftp server.
Tftp: provides boot system boot programs and boot kernel.
File Server: provides software packages required during installation and kickstart response files.
The client needs to connect the network to the same network as the server, and the bios of the device allows the network to start. ensure that the first boot item is network boot.
Install and configure the dhcp service
| |
# Rpm-qa dhcp # check whether the dhcp package is installed. If no dhcp package is installed, skip the next step. # Yum-y install dhcp # use yum to install dhcp |
# Vim/etc/dhcp/dhcpd. conf # Edit the dhcp configuration file. for details, refer to/usr/share/doc/dhcp. <与dhcp包版本同名> /Dhcpd. conf. sample. This is the template of the dhcp configuration file. The line starting with option is to configure network information for the client, and the remaining configuration is to configure the work characteristics of the dhcp server. The configuration file here is as follows.
| |
Option domain-name "wukui.com"; # option domain-name-servers 8.8.8.8; # allocate the domain to the customer mechanism dnsdefault-lease-time 600; # lease time, in seconds. Max-lease-time 7200; # maximum lease time, in seconds log-facility local7; # Record DHCP server directory level subnet 192.168.1.0 netmask limit 255.255.0 {# Mark the network to be allocated, {} is a whole. Range 192.168.1.60 192.168.1.100; # address pool option routers 192.168.1.1; # The default client gateway next-server 192.168.1.55; # This is used only when the operating system is installed on the network, specify the first tftp server to be searched after the client obtains the network configuration. Filename "pxelinux.0"; # specify to read files on the tftp server. Host winxp {# This section is used to specify a MAC address to obtain the specified IP address. This section is not used here. it is just used to notify a single host of IP allocation. Hardware ethernet 00: 11: 22: 33: 44: 55; # hardware address fixed-address 192.168.1.88; # IPoption routers 192.168.1.1 assigned to the hardware address; # gateway allocated to this IP address host }} |
Install and configure the tftp server. The tftp package is a client, and the tftp-server is a server. Tftp depends on the super daemon xinetd to start the listening service. xinetd must be started before the tftp service can be used.
| |
# Yum-y install tftp-server # yum-y install tftp # vim/etc/xinetd. d/tftp # Modify the disable value to no. do not modify anything else. Service tftp {socket_type = dgram protocol = udp wait = yes user = root server =/usr/sbin/in. tftpd server_args =-s/var/lib/tftpboot disable = no # modify the value here to no, so that after xinetd is started, the tftp listening port will be used. Per_source = 11 cps = 100 2 flags = IPv4} |
Record the xinetd service and test tftp.
| |
# Service xinetd restart # restart the xinetd service to listen to the tftp service. # Rpm-ql tftp-server # Check the files generated by the tftp-server software package. here, we mainly look at the directory where the service is provided/etc/xinetd. d/tftp/usr/sbin/in. tftpd/usr/share/doc/tftp-server-0.49/usr/share/doc/tftp-server-0.49/CHANGES/usr/share/doc/tftp-server-0.49/README/usr/share/doc/tftp-server-0.49/README. security/usr/share/doc/tftp-server-0.49/README. security. tftpboot/usr/share/man/man8/in.tftpd.8.gz/usr/share/man/man8/tftpd.8.gz/var/lib/tftpboot # main directory for providing services |
Test tftp to see if the file can be uploaded and downloaded normally. After entering tftp, you cannot use commands such as ls. Use help to get help
| |
# Ss-unl | grep 69 # check whether the tftp uses udp 69 port for listening. # Cp/etc/passwd/var/lib/tftpboot/# tftp 192.168.1.55> get passwd> quit # ls passwd # check whether the file can be downloaded. Make sure that the tftp service is correct. |
Copy the files required for startup to the tftp directory. The following is a brief description of the role of each file.
Pxelinux.0 is similar to the grub boot program. The file is located in/usr/shate/syslinux/pxelinux.0. After it is loaded, a command line similar to grub will appear. Then load the Linux kernel and ramdisk on tftp. Load anaconda (The software maintained by fedora to install the operating system) to install the system.
Graphical interface for vesamenu. c32 pxelinux.0 loading.
Splash.jpg loads the background image inside the image.
The function configuration file of the content displayed in the isolinux. cfg graphic interface. here I mainly specify the file for installing the automatic response file of the operating system. This file must be copied to the pxelinux. cfg directory in the tftp home directory, and the file name must be default
The above three files are stored in the isolinux directory on the CD.
The Linux Kernel started from the vmlinuz network.
Initrd. img helps the kernel to load the driver of the client's large disk.
The above two files are stored in the image/pxeboot directory on the CD.
| |
The configuration file default vesamenu. c32 timeout 60 # specifies the timeout time to 6 seconds. Display boot. msgmenu background splash.jpg menu title Welcome to CentOS 6.5! Menu color border 0 # ffffffff #00000000 menu color sel 7 # ffffffff # ff000000menu color title 0 # ffffffff #00000000 menu color tabmsg 0 # ffffffff #00000000 menu color unsel 0 # ffffffff #00000000 menu color hotsel 0 # ff000000 # ffffffffmenu color hotkey 7 # ffffffff # ff000000menu color scrollbar 0 # ffffffff #00000000 label linuxmenu label ^ start install system menu defaultkernel vmlinuz ks = # pass parameters to the kernel, bit of the configuration file . Append initrd = initrd. img |
Now, the configuration file server and kickstart automatically respond to the file. File service uses apache. The httpd service has been installed on my system. So you can start it directly.
Prepare the operating system installation file
| |
# Service httpd start # start apache # cp-r/media/*/var/www/html/centos/# copy the files required during operating system installation to make kickstart automatic response File template file under the centos directory is/root/anaconda-ks.cfg, refer to this file. You can also use the graphical configuration tool system-config-kickstart to configure the response file. This software needs to be installed. # Yum-y install system-config-kickstart # Start the image configuration window. I tried not to use it in putty. The startup interface is as follows. |
Configure the time zone and root password
The url of the file required to install the operating system. Here, point to my CD file.
Partition configuration, and grub installation configuration. However, LVM is not supported. to use LVM, you need to refer to the template file and manually add it. Partition depends on your own situation. pay attention to backing up data .!!
Select the software package to install
There are also scripts for installation and execution. At last, click the file button to save the file, which is saved in the current working directory.
Place the response file in the apache root directory and ensure that the file can be accessed. Make sure that the kernel vmlinuz ks = http: // 192.168.1.55/ks. cfg in the/var/lib/tftpboot/pxelinux. cfg/default file points to the correct r response file.