Linux network installation

I recently encountered installing Centos 7 in unusual conditions.

Firstly, at home. That is, I was dealing with a local computer, and not with a server with IPMI.

Secondly, for lack of a disk drive, I usually use a bootable USB flash drive, which in this case turned out to be useless, since the new computer boots only from USB flash drives with the Windows installer. The problem is not new, judging by the reviews on the motherboard.

At my disposal was the network. I will give an example of installing Centos 7 on PXE and iPXE

So, let's begin.

How to install Linux via ipxe?
How to install linux via pxe?


Installation via PXE


Connect the ethernet cable to computer1 - on which there will be DHCP, TFTP and computer2 - on which the OS should be installed.

Add the static settings of the network adapter to computer1. My address is 192.168.1.50.

Download and install TFTP . In this program, we will configure DHCP and TFTP server from which we will give the IP address and installation files to computer2.

Turn off the firewall and run tftpd with administrator privileges. Set the same settings as in the pictures. You may need to restart tftpd.







On computer2, in the boot menu, select the network adapter. A progress bar will be displayed in the tftpd window on computer1.

After that, on the computer2, the OS installer window will load.

Install Linux via iPXE


Download image ipxe.iso . Rufus, create a bootable flash drive based on this image.

Put the install.ipxe script on any web server. You can find out how to raise a web server on a local computer here . The address of my script will be like this sitename.ru/install.ipxe The

contents of the install.ipxe script for installing Centos 7

#!ipxe
set base http://mirror.centos.org/centos/7/os/x86_64
prompt -k 0x197e -t 2000 Press F12 to install CentOS... || exit
kernel ${base}/images/pxeboot/vmlinuz initrd=initrd.img repo=${base}
initrd ${base}/images/pxeboot/initrd.img
boot

By analogy with this script for installing Centos 7, you can prepare your own script for installing another OS.

Connect the computer on which you want to install Linux, and the ethernet router cable. Insert the flash drive and boot from it. After pressing F12, the ipxe console will appear. We use the following commands to get the IP address and download the script

iPXE> dhcp
    DHCP (net0 52:54:00:12:34:56).... ok
iPXE> chain http://sitename.ru/install.ipxe

After that, the OS installer window will load.

All Articles