Ubuntu16 kickstart pxe installation system, ubuntu16kickstart

Source: Internet
Author: User

Ubuntu16 kickstart pxe installation system, ubuntu16kickstart

This article does not describe a lot of principles, but mainly explains practices.

Lab environment:

Virtual Machine: vm

Ubuntu: 16.04 (desktop installation required), as the server

Server IP Address: 192.168.193.128

 

Practice:

1. Install the dhcp service

Apt-get install isc-dhcp-server-y # If the prompt E: unable to locate the software package isc-dhcp-Server, execute this command apt-get update

2. Configure the dhcp service (mainly two files)

A. vim/etc/default/isc-dhcp-server

INTERFACES = "ens33" # Name of the specified network interface

B. vim/etc/dhcp/dhcpd. conf # Add it at the end of the file.

Subnet 192.168.193.0 netmask 255.255.255.0 {# subnet 192.168.193 CIDR block allocated to the ip address by dhcpserver, which must be the same network segment as a network adapter of the PXE server

Range 192.168.193.100 192.168.193.200; # assign an ip range to the client

Default-lease-time 600;

Max-lease-time 7200;

Filename "pxelinux.0"; # Find and download the pxelinux.0 file through tftp

Next-server 192.168.193.128; # specify the ip address of the tftp server

}

Restart the system after Configuration

Systemctl restart isc-dhcp-server

View services

Netstat-tunlp | grep 67

Udp 0 0 0.0.0.0: 67 0.0.0.0: * 2119/dhcpd

3. Install the tftp service

Apt-get install tftpd-hpa-y # After installation is complete, use the default configuration. The tftp directory is/var/lib/tftpboot/

Vim/etc/default/tftpd-hpa # default Configuration

#/Etc/default/tftpd-hpa

 

TFTP_USERNAME = "tftp"

TFTP_DIRECTORY = "/var/lib/tftpboot"

TFTP_ADDRESS = ": 69"

TFTP_OPTIONS = "-- secure"

4. Install apache2

Apt-get install apache2-y # the installation is complete. The http root directory is/var/www/html/

5. Copy and modify required files

 

Mkdir/var/www/html/ubuntu

Rm-fr/var/www/html/index.html

Mount/dev/cdrom/mnt

Cp-r/mnt/*/var/www/html/ubuntu/

Cp-r/var/www/html/ubuntu/install/netboot/*/var/lib/tftpboot/

Cp/var/www/html/ubuntu/pre-seed/ubuntu-server.seed/var/www/html/

Vim/var/www/html/ubuntu-server.seed # Add the last file

Live-installer/net-image = http: // 192.168.193.128/ubuntu/install/filesystem. squashfs

6. Install kickstart

Kickstart requires a GUI. Because I am an installed server, I need to install the desktop (not required if it is a desktop version ).

 

Apt-get install ubuntu-desktop-y

Apt-get install system-config-kickstart-y

After the installation is complete, restart and enter the desktop.

Open the terminal and execute system-config-kickstart.

Pop-up

Configure

Select the software package to be installed. You cannot select it here. After the ks file is generated, add it directly to the ks file.

In the root directory of the command line

Cp ks. cfg/var/www/html/

Vim/var/www/html/ks. cfg # Add the installed software package

Skipx # Add the software package to be installed below

% Packages

Openssh-server

 

Edit txt. cfg

Vim/var/lib/tftpboot/ubuntu-installer/amd64/boot-screens/txt. cfg

Default install

Label install

Menu label ^ Install

Menu default

Kernel ubuntu-installer/amd64/linux

Append ks = http: // 192.168.193.128/ks. cfg vga = 788 initrd = ubuntu-installer/amd64/initrd.gz live-installer/net-image = http: // 192.168.193.128/ubuntu/install/filesystem. squashfs

Label cli

Menu label ^ Command-line install

Kernel ubuntu-installer/amd64/linux

Append tasks = standard pkgsel/language-pack-patterns = pkgsel/install-language-support = false vga = 788 initrd = ubuntu-installer/amd64/initrd.gz --- quiet

 

Edit file default

Vim/var/lib/tftpboot/pxelinux. cfg/default

# D-I config version 2.0

# Search path for the c32 support libraries (libcom32, libutil etc .)

Path ubuntu-installer/amd64/boot-screens/

Include ubuntu-installer/amd64/boot-screens/menu. cfg

Default ubuntu-installer/amd64/boot-screens/vesamenu. c32

Prompt 0

Timeout 10 # The default value is 0 (manual) and changed to 10 (the install option is automatically selected after 1 second)

 

Then you can install the system.

 

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.