Network Installation Linux

Source: Internet
Author: User
Tags file url

Experimental environment: vmworkstation10,centos6.5, remote terminal Xshell, the operating system has been installed Apache. The IP of the virtual machine is 192.168.1.55.


The network installation server needs to start the service.

DHCP: Used to assign IP to the client when it is started, and to tell the client to look for boot programs to boot the installation system on the TFTP server.

TFTP: Responsible for providing boot system boot program, boot kernel and so on.

File server: Provide the package required during installation, Kickstart answer files, etc.

The client needs to connect the network to the same network as the server, and the device BIOS allows the network to boot, ensuring that the first boot entry is the network boot.


Installing the Configure DHCP service

# Rpm-qa DHCP #查看dhcp包有没有安装, if you do not install the next installation, you have already installed skip the next step. # yum-y Install DHCP #使用yum安装dhcp

#vim/etc/dhcp/dhcpd.conf #编辑dhcp的配置文件, you can refer to/usr/share/doc/dhcp< >/dhcpd.conf.sample with the same name as the DHCP package version. This is the template for the DHCP configuration file. The line at the beginning of option is to configure network information for the client, and the rest of the configuration is to configure the DHCP server-side features. I have the following configuration file here.

option domain-name  "wukui.com";         #客户机所属的域option   domain-name-servers 8.8.8.8;       #分配给客户机制dnsdefault-lease-time 600;         #租约时间, in seconds. max-lease-time 7200;           #最大租约时间, in seconds log-facility  local7;                # Log the DHCP server directory level subnet 192.168.1.0 netmask 255.255.255.0{     #标记要分配的网络, {} is a whole.   range 192.168.1.60 192.168.1.100;     #地址池   option  routers 192.168.1.1;       #客户端的默认网关   next-server  192.168.1.55;          #这里在网络安装操作系统时才用的到, specifies the first TFTP server to be found after the client obtains the network configuration.   filename  "pxelinux.0"  ;             #指定读取tftp服务器上的文件. host winxp {                                                  # This section is used to specify a MAC address to obtain the specified IP. This is not used here, only to make a hint to the individual host to assign IP method. hardware ethernet 00:11:22:33:44:55;        # Hardware Address fixed-address 192.168.1.88;                          #给这个硬件地址分配的IPoption  routers  192.168.1.1;                          #分配给这个IP地址主机的的网关}}




Install the TFTP server configuration. TFTP packet is the client, Tftp-server for server turbulence. TFTP relies 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     #修改disable的值为no, others without modification. service tftp{        socket_type = dgram         protocol = udp         wait = yes        user = root         server = /usr/sbin/in.tftpd         server_args = -s /var/lib/tftpboot        disable  = no         #修改这里的值为no so that the xinetd will listen for TFTP ports after booting.         per_source = 11         cps = 100 2        flags = ipv4} 


Re-remember the XINETD service and test tftp.

# service xinetd Restart #重启xinetd服务 to allow it to listen to the TFTP service. #rpm-ql tftp-server #查看tftp-server packages have generated those files, and here the main view is where it serves the directory where/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 #提供服务的主目录

Test the TFTP to see if you can upload the downloaded files properly. Commands such as LS are not available after entering TFTP. Use Help to get assistance

#ss-UNL | grep #查看tftp使用udp 69 port is listening. #cp/etc/passwd/var/lib/tftpboot/#tftp 192.168.1.55>get passwd>quit#ls passwd #看下是否能够下载文件. Make sure the TFTP service is not a problem.



Copy the files needed for startup to the TFTP directory. The following is a brief description of each file function.


pxelinux.0 Similar to the Grub boot program, the file is located in/usr/shate/syslinux/pxelinux.0. A command line similar to grub will appear after loading it. Then load the Linux kernel and RAMDisk on the TFTP. Reload Anaconda (Fedora-maintained software used to install the operating system) to begin the installation of the system.

vesamenu.c32 pxelinux.0 when loading the graphical interface.

splash.jpg Loads the background image of the inner face of the graphic.

The isolinux.cfg graphical interface displays the contents of the feature profile, and I am here primarily to specify the installation operating system auto answer file in this file. This file must be copied to the Pxelinux.cfg directory under the TFTP home directory, and the filename must be the default

The above three files are in the Isolinux directory on the CD

vmlinuz network boot boot Linux kernel.

The initrd.img helps the kernel load the driver for the client's large disk.

The above two files are in the Image/pxeboot directory on the CD

 configuration file default vesamenu.c32   timeout 60     #指定超时时间为6秒. display boot.msgmenu background splash.jpg menu title welcome to  centos 6.5!menu color border 0  #ffffffff   #00000000menu  color sel  7  #ffffffff   #ff000000menu  color title 0  #ffffffff   #00000000menu  color  tabmsg 0  #ffffffff   #00000000  menu color unsel 0  #ffffffff  # 00000000menu color hotsel 0  #ff000000   #ffffffffmenu  color hotkey 7   #ffffffff   #ff000000menu  color scrollbar 0  #ffffffff   #00000000label   linuxmenu label ^start install system menu defaultkernel vmlinuz ks=     #给内核传参数, specify the location of the configuration file. Append initrd=initrd.img 


Now that the work configuration is started, configure the file server and the Kickstart auto answer file. The file service uses Apache. The HTTPD service has been installed since my system was installed. So it can be started directly.

Preparing the operating system installation files

# service httpd start #启动apache # cp-r/media/*/var/www/html/centos/# Copy the files needed during the installation of the operating system to the CentOS directory under the root directory of the Web site to make kickstart automatically The answer file template file is/root/anaconda-ks.cfg, and you can refer to this file. You can also use the graphical Configuration tool, System-config-kickstart, to configure the answer file with this tool. This software needs to be installed. # yum-y Install System-config-kickstart # system-config-kickstart #启动图形配置窗口, I tried not to use it in putty. The interface after startup is as follows.


Configure the time zone and root password

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/42/D2/wKiom1PY0E2zVnvxAAMnh1tLvG4006.jpg "style=" float: none; "title=" 2.png "alt=" Wkiom1py0e2zvnvxaamnh1tlvg4006.jpg "/>




The file URL that is required to install the operating system. This points to my disc file.

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/42/D2/wKiom1PY0E2y6LpoAAHUXH8S9iE663.jpg "style=" float: none; "title=" 3.png "alt=" Wkiom1py0e2y6lpoaahuxh8s9ie663.jpg "/>

Partition configuration, with the Grub installation configuration. However, LVM is not supported and you want to use LVM to refer to the template file and manually add it. Partitions are based on their own situation, pay attention to the backup data.!

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/42/D2/wKioL1PY0WeQigjSAALEHSR3b5U758.jpg "style=" float: none; "title=" 4.png "alt=" Wkiol1py0weqigjsaalehsr3b5u758.jpg "/>

Select the package to install here

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/42/D2/wKioL1PY0WezsZ1PAAK8yFcXcJs257.jpg "style=" float: none; "title=" 5.png "alt=" Wkiol1py0wezsz1paak8yfcxcjs257.jpg "/>

There are scripts for installation execution, and so on. The last Point File button saves the files and the files are saved in the current working directory.


Place the answer file in the root directory of Apache and make sure you have access to it. and ensure 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 answer file.


This article is from the "beauty of the long-lost Pride" blog, please be sure to keep this source http://wukui.blog.51cto.com/1080241/1532949

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.