作者:admin,发布日期:2020-05-05
阅读:5072;评论:0

写在开头

本文将使用ipxe引导netboot.xyz提供的在线引导服务来引导系统安装程序以实现Linux系统的网络安装以及一些工具盘的网络启动。

理论概念

Ipxe

PXE(preboot execute environment,预启动执行环境)是由Intel公司开发的技术,工作于Client/Server的网络模式,支持工作站通过网络从远端服务器下载映像,并由此支持通过网络启动操作系统,在启动过程中,终端要求DHCP服务器分配IP地址,再用TFTP(trivial file transfer protocol)或MTFTP(multicast trivial file transfer protocol)协议下载一个启动软件包到本机内存中执行,由这个启动软件包完成终端(客户端)基本软件设置,从而引导预先安装在服务器中的终端操作系统。PXE可以引导多种操作系统,如:Windows95/98/2000/windows2003/windows2008/winXP/win7/win8,linux系列系统等。  

IPXE 官方网址 http://ipxe.org/

gPXE/iPXE是PXE的扩展版,支持HTTP协议,可以通过http、ISCSI SAN、Fibre Channel SAN via FCoE AoE SAN wireless network Infiniband network等方式启动。

iPXE由gPXE分支而来(fork),功能更丰富。

iPXE is free, open-source software licensed under the GNU GPL (with some portions under GPL-compatible licences)

Neboot.xyz

netboot.xyz is a way to PXE boot various operating system installers or utilities from one place within the BIOS without the need of having to go retrieve the media to run the tool. iPXE is used to provide a user friendly menu from within the BIOS that lets you easily choose the operating system you want along with any specific types of versions or bootable flags.

You can remote attach the ISO to servers, set it up as a rescue option in Grub, or even set up your home network to boot to it by default so that it's always available.

网络安装

指从系统中提供的镜像站上下载安装系统的所需的程序,这样只要能引导内核并且有网就可以开始直接安装Linux系统,大大节省了空间。

Ipxe安装

这里我们将直接进入netboot.xyz网站,下载其编译好的ipxe程序。

下载地址:https://netboot.xyz/downloads/

这里我们选择PCBIOS USB,以便后面直接写入到硬盘中

进入服务器,使用进行下载。

root@debian:~# wget https://boot.netboot.xyz/ipxe/netboot.xyz.usb
--2020-05-05 00:48:32--  https://boot.netboot.xyz/ipxe/netboot.xyz.usb
Resolving boot.netboot.xyz (boot.netboot.xyz)... 54.230.173.90, 54.230.173.97, 54.230.173.129, ...
Connecting to boot.netboot.xyz (boot.netboot.xyz)|54.230.173.90|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 376832 (368K) [application/octet-stream]
Saving to: ‘netboot.xyz.usb’

netboot.xyz.usb                     100%[=================================================================>] 368.00K  2.36MB/s    in 0.2s    

2020-05-05 00:48:32 (2.36 MB/s) - ‘netboot.xyz.usb’ saved [376832/376832]

下载完成后,我们直接使用dd命令,将其直接写入到硬盘的0扇区,这样重启之后我们的服务器将会从ipxe程序开始启动,再由ipxe引导其他程序(系统)。

root@debian:~# dd if=netboot.xyz.usb of=/dev/vda
736+0 records in
736+0 records out
376832 bytes (377 kB, 368 KiB) copied, 0.0107205 s, 35.2 MB/s

需要注意的是,这里的of,请自行改成服务器默认启动的硬盘,一般是vda 或者sda。

写入成功之后,我们reboot重启服务器,即可进入Ipxe界面(下一步需要VNC或者显示器)。

Ipxe IP配置

Snipaste_2020-05-05_12-56-21.png

一般Ipxe会首先尝试使用DHCP去获取地址,但是当获取不到的时候,我们就需要手动配置IP。

Snipaste_2020-05-05_12-59-39.png

按照提示配置完成后,回车,Ipxe会自动加载netboot的菜单。

Snipaste_2020-05-05_13-00-22.png

至此,Ipxe安装完成。

Netboot引导系统安装

按照上一步,我们选择Linux Network Installs,进入Linux的安装,当然也可以按照需要进入其他的选项。

Snipaste_2020-05-05_13-03-09.png

这里就可以选择我们需要安装的系统,大家可以自己选择,然后回车按照提示进入熟悉的安装界面。

需要注意的是,由于国内网络问题,有的时候国内可能安装会比较慢,所以说建议使用国内服务器的小伙伴不要轻易尝试。

写在结尾

本文介绍了netboot.xyz服务的使用,以及系统重装的方式,有任何问题可以加群联系群主本人。

评论区

发表评论

必填

选填

选填

必填

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。