In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to configure PXE server in Ubuntu 14.04". The explanation in this article is simple and clear and easy to learn and understand. Please follow the editor's train of thought to study and learn "how to configure PXE server in Ubuntu 14.04".
The PXE (pre-boot execution Environment (Preboot Execution Environment)) server allows users to launch Linux distributions from the network and install them in hundreds of PC simultaneously without the need for a Linux ISO image. If your client computer does not have a CD/DVD or USB boot disk, or if you want to install multiple computers at the same time in a large enterprise, then the PXE server can save you time and money.
In this article, we will show you how to configure the PXE server on Ubuntu 14.04.
Configure the network
Before you start, you need to set up the PXE server to use static IP. To use static IP addresses on your system, you need to edit the "/ etc/network/interfaces" file.
Open the "/ etc/network/interfaces" file.
Sudo nano / etc/network/interfaces
Make the following modifications:
# Loopback Network Interface auto loiface lo inet loopback# Primary Network Interface auto eth0iface eth0 inet staticaddress 192.168.1.20netmask 255.255.255.0gateway 192.168.1.1dns-nameservers 8.8.8.8
Save the file and exit. This will set its IP address to "192.168.1.20". Then restart the network service.
Sudo / etc/init.d/networking restart
Install DHCP, TFTP and NFS
DHCP,TFTP and NFS are important components of the PXE server. First, you need to update your system and install all the required software packages.
To do this, run the following command:
Sudo apt-get updatesudo apt-get install isc-dhcp-Server inetutils-inetd tftpd-hpa syslinux nfs-kernel-Server
Configure the DHCP service
DHCP stands for dynamic Host configuration Protocol (Dynamic Host Configuration Protocol), which is mainly used to dynamically assign network configuration parameters, such as IP addresses for interfaces and services. In a PXE environment, the DHCP server allows the client to request and automatically obtain an IP address to access the network.
1. Edit the / etc/default/dhcp3-server file.
Sudo nano / etc/default/dhcp3-server
Make the following modifications:
INTERFACES= "eth0"
Save (Ctrl + o) and exit the (Ctrl + x) file.
two。 Edit the "/ etc/dhcp3/dhcpd.conf" file:
Sudo nano / etc/dhcp/dhcpd.conf
Make the following modifications:
Default-lease-time 600 Maxima color time 7200 switch subnet 192.168.1.0 netmask 255.255.255.0 {range 192.168.1.21 192.168.1.240 option subnet-mask 255.255.255.0 option routers 192.168.1.20 option broadcast-address 192.168.1.255 "pxelinux.0"; next-Server 192.168.1.20;}
Save the file and exit.
3. Start the DHCP service.
Sudo / etc/init.d/isc-dhcp-server start
Configure the TFTP server
TFTP is a file transfer protocol similar to FTP, but it does not require user authentication and cannot list directories. The TFTP server always listens for requests from PXE clients on the network. When it detects that a PXE client requests a PXE service on the network, it provides a network packet containing the boot menu.
1. When configuring TFTP, you need to edit the "/ etc/inetd.conf" file.
Sudo nano / etc/inetd.conf
Make the following modifications:
Tftp dgram udp wait root / usr/sbin/in.tftpd / usr/sbin/in.tftpd-s / var/lib/tftpboot
Save the file and exit.
two。 Edit the / etc/default/tftpd-hpa file.
Sudo nano / etc/default/tftpd-hpa
Make the following modifications:
TFTP_USERNAME= "tftp" TFTP_DIRECTORY= "/ var/lib/tftpboot" TFTP_ADDRESS= "[: 0.0.0.0:]: 69" TFTP_OPTIONS= "- secure" RUN_DAEMON= "yes" OPTIONS= "- l-s / var/lib/tftpboot"
Save the file and exit.
3. Use xinetd to have the boot service start automatically each time the system boots, and start the tftpd service.
Sudo update-inetd-enable BOOTsudo service tftpd-hpa start
4. Check the status.
Sudo netstat-lu
It will look like this:
Proto Recv-Q Send-Q Local Address Foreign Address Stateudp 0 0 *: tftp *: *
Configure the PXE startup file
Now, you need to put the PXE boot file "pxelinux.0" in the TFTP root directory. Create a directory structure for TFTP and copy all bootstrap files provided by syslinux from "/ usr/lib/syslinux/" to "/ var/lib/tftpboot/", as follows:
Sudo mkdir / var/lib/tftpbootsudo mkdir / var/lib/tftpboot/pxelinux.cfgsudo mkdir-p / var/lib/tftpboot/Ubuntu/14.04/amd64/sudo cp / usr/lib/syslinux/vesamenu.c32 / var/lib/tftpboot/sudo cp / usr/lib/syslinux/pxelinux.0 / var/lib/tftpboot/
Set up the PXELINUX profile
The PXE configuration file defines the menu that appears when the PXE client starts, which can boot and associate with the TFTP server. By default, when a PXE client starts, it uses its own MAC address to specify the configuration file to read, so we need to create a default file that contains a list of bootable kernels.
Edit the PXE server configuration file to use valid installation options.
Edit "/ var/lib/tftpboot/pxelinux.cfg/default":
Sudo nano / var/lib/tftpboot/pxelinux.cfg/default
Make the following modifications:
DEFAULT vesamenu.c32TIMEOUT 100PROMPT 0MENU INCLUDE pxelinux.cfg/PXE.confNOESCAPE 1LABEL Try Ubuntu 14.04 DesktopMENU LABEL Try Ubuntu 14.04 Desktopkernel Ubuntu/vmlinuzappend boot=casper netboot=nfs nfsroot=192.168.1.20:/var/lib/tftpboot/Ubuntu/14.04/amd64initrd=Ubuntu/initrd.lz quiet splashENDTEXTLABEL Install Ubuntu 14.04 DesktopMENU LABEL Install Ubuntu 14.04 Desktopkernel Ubuntu/vmlinuzappend boot=casper automatic-ubiquity netboot=nfs nfsroot=192.168.1.20:/var/lib/tftpboot/Ubuntu/14.04/amd64initrd=Ubuntu/initrd.lz quiet splashENDTEXT
Save the file and exit.
Edit the / var/lib/tftpboot/pxelinux.cfg/pxe.conf file.
Sudo nano / var/lib/tftpboot/pxelinux.cfg/pxe.conf
Make the following modifications:
MENU TITLE PXE ServerNOESCAPE 1ALLOWOPTIONS 1PROMPT 0MENU WIDTH 80MENU ROWS 14MENU TABMSGROW 24MENU MARGIN 10MENU COLOR border 30th 44 # ffffffff # 00000000 std
Save the file and exit.
Add a Ubuntu 14.04 desktop boot image to the PXE server
The Ubuntu kernel and initrd files are required for this step. To get these files, you need a Ubuntu 14.04 desktop ISO image. You can download the Ubuntu 14.04 ISO image to the / mnt directory with the following command:
Sudo cd / mntsudo wget http://releases.ubuntu.com/14.04/ubuntu-14.04.3-desktop-amd64.iso
Note: the URL used for download may change because the ISO mirror will be updated. If the above URL is not accessible, take a look at this website for the download link.
Mount the ISO file and copy all files to the TFTP folder using the following command:
Sudo mount-o loop / mnt/ubuntu-14.04.3-desktop-amd64.iso / media/sudo cp-r / media/* / var/lib/tftpboot/Ubuntu/14.04/amd64/sudo cp-r / media/.disk / var/lib/tftpboot/Ubuntu/14.04/amd64/sudo cp / media/casper/initrd.lz / media/casper/vmlinuz / var/lib/tftpboot/Ubuntu/
Configure the exported ISO directory to the NFS server
Now, you need to set up "install Source Mirror (Installation Source Mirrors)" through the NFS protocol. You can also use HTTP and FTP to install the source image. Here, I have used NFS to output ISO content.
To configure the NFS server, you need to edit the "/ etc/exports" file.
Sudo nano / etc/exports
Make the following modifications:
/ var/lib/tftpboot/Ubuntu/14.04/amd64 * (ro,async,no_root_squash,no_subtree_check)
Save the file and exit. For the changes to take effect, output and start the NFS service.
Sudo exportfs-asudo / etc/init.d/nfs-kernel-server start
Your PXE server is now ready.
Configure the Network Boot PXE client
The PXE client can be any computer system that supports PXE network boot. Now, your client only needs to set the "boot from the network (Boot From Network)" option in the system's BIOS to launch and install the Ubuntu 14.04 desktop.
Now get ready to go-start your PXE client computer with a network boot, and you should now see a submenu showing the menu items for the Ubuntu 14.04 desktop we created.
Thank you for reading, the above is the content of "how to configure PXE server in Ubuntu 14.04". After the study of this article, I believe you have a deeper understanding of how to configure PXE server in Ubuntu 14.04, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.