Pxe+kickstart Automatic Installation ubuntu14.04

Source: Internet
Author: User

This article refers to a number of articles, first thanks to the authors of these articles.

Installing a system using PXE requires the installation of services such as Dhcp,tftp,http (and, of course, other file sharing methods such as NFS,FTP).

Lab Environment:

1. VMware 12

2. Network segment 10.0.0.0/8, PXE server ip:10.0.0.100

First, install DHCP service

You can choose to install Isc-dhcp-server or DNSMASQ (which is used more in OpenStack, and it also includes a TFTP service, which is very convenient to configure, because I'm too lazy to change because I already have DHCP and TFTP installed).

I chose Isc-dhcp-server:apt-get install isc-dhcp-server-y

Vim/etc/default/isc-dhcp-server

Interfaces= "Eth0" # or the network interface name you want to specify.

Vim/etc/dhcp/dhcpd.conf

Add at the end of the file:

Subnet 10.0.0.0 netmask 255.0.0.0 {
Range 10.0.0.101 10.0.0.200;
Option Subnet-mask 255.0.0.0;
Option routers 10.0.0.100;
Option Broadcast-address 10.255.255.255;
FileName "pxelinux.0";
Next-server 10.0.0.100;
}

Subnet, masks can be set according to their own needs

FileName "pxelinux.0";
Next-server 10.0.0.100; Specifies the PXE boot file name and IP address, Next-server also refers to the TFTP server IP.

After configuring the Restart service:

Service Isc-dhcp-server Restart

Second, the installation of TFTP services

Apt-get Install Tftpd-hpa-y

After installation is OK, using the default can, remember TFTP directory is/var/lib/tftpboot/Oh, back to use!

Third, installation apache2

Apt-get Install Apache2-y

It is also installed, the HTTP root directory is/var/www/html/.

Place the downloaded Ubuntu-14.04.5-server-amd64.iso in a directory. For example, the directory, and then the following operations;

CD ~

Mkdir/var/www/html/ubuntu

Mount Ubuntu-14.04.5-server-amd64.iso/var/www/html/ubuntu or Mount Ubuntu-14.04.5-server-amd64.iso/media and then Cp-r */media/*/var/www/html/ubuntu

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

cp/var/www/html/ubuntu/preseed/ubuntu-server.seed/var/www/html/

Then Vim/var/www/html/ubuntu-server.seed

Add at the end of the file:

D-i Live-installer/net-image String HTTP://10.0.0.100/UBUNTU/INSTALL/FILESYSTEM.SQUASHFS

Because after the ubuntu12.10 version, installing some packages will depend on the preconfigured file system, which is why the use of the Kickstart method failed to install successfully.

Iv. installation of Kickstart

Kickstart requires GUI interface, I install the desktop because it is the server installed, if it is not required to be installed, the following installation;

Apt-get Install Ubuntu-desktop system-config-Kickstart - y

After the installation, restart the desktop, directly startx in the virtual machine card desktop.

Kickstart interface operation is very simple, the experiment once again know the main or ks.cfg. If the VM interface is small and needs to be remote, you can install XRDP, vnc4server, and then vim ~/.xsession input: xfc4-session

Here is not much to say, search for a lot of remote Ubuntu articles.

Save Ks.cfg to/var/www/html/after the interface finishes operation

Ks.cfg content is as follows:

#Generated by Kickstart Configurator#platform=AMD64 or Intel em64t#system languagelang en_us#language modules toInstalllangsupport en_us#system keyboardkeyboard us#system mousemouse#system timezonetimezone--UTC asia/shanghai#root PASSWORDROOTPW--disabled#initial Useruser Trait--fullname"Trait"--iscrypted--password $1$Umx 1cgrj$. Prarn7ap66xbosybu4n1#reboot after installationreboot#use text modeInstallText#install OS instead of upgradeInstall#Use Web Installationurl--url http://10.0.0.100/ubuntu#System bootloader Configurationbootloader--location=MBR #Clear the Master Boot recordzerombr yes#partition clearing Informationclearpart--all--Initlabel #Disk Partitioning Informationpart/--fstype Ext4--size1024x768--asprimary--Ondisk SDA Part swap--size ---Ondisk SDA #System authorization Infomationauth--useshadow--enablemd5 #Firewall Configurationfirewall--disabled #Do not configure the X Window systemskipx%Packagesopenssh-Server%post

Then modify the vim/var/lib/tftpboot/ubuntu-installer/amd64/boot-screens/txt.cfg:

Default Installlabel install        menu label ^install        menu default        kernel ubuntu-installer/amd64/linux        Append ks=http://10.0.0.100/ks.cfg preseed/url=http://10.0.0.100/ubuntu-server.seed vga=788 initrd= ubuntu-installer/amd64/initrd.gz---Quiet 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

OK, now you can create an empty virtual machine to verify the installation.

Pxe+kickstart Automatic Installation ubuntu14.04

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.