设置PXE服务器
从 不带CDROM或USB端口的单台笔记本电脑安装 到 支持预装ka1i安装器的企业部署 ,通过网络(PXE)引导和安装ka1i 可能会很有用。
您需要具有root用户特权才能执行此过程,或者需要具有使用命令“ sudo su”升级特权的功能。
首先,我们需要安装dnsmasq以提供DHCP / TFTP服务器,然后编辑dnsmasq.conf
文件:
apt install -y dnsmasq nano /etc/dnsmasq.conf
在中dnsmasq.conf
,启用DHCP,TFTP和PXE引导,并将设置为dhcp-range
适合您的环境。如果需要,您还可以使用dhcp-option
如下所示的指令定义网关和DNS服务器:
interface=eth0 dhcp-range=192.168.101.100,192.168.101.200,12h dhcp-boot=pxelinux.0 enable-tftp tftp-root=/tftpboot/ dhcp-option=3,192.168.101.1 dhcp-option=6,8.8.8.8,8.8.4.4
进行适当的编辑后,需要重新启动dnsmasq服务,以使更改生效。
systemctl restart dnsmasq
下载ka1i PXE Netboot镜像
现在,我们需要创建一个目录来保存ka1i Netboot镜像,并从ka1i仓库下载我们希望提供的映像。
mkdir -p /tftpboot/ cd /tftpboot/ # for 64 bit systems: wget http://http.ka1i.org/ka1i/dists/ka1i-rolling/main/installer-amd64/current/images/netboot/netboot.tar.gz # for 32 bit systems: wget http://http.ka1i.org/ka1i/dists/ka1i-rolling/main/installer-i386/current/images/netboot/netboot.tar.gz tar -zxpf netboot.tar.gz rm -f netboot.tar.gz
配置目标以从网络引导
配置完所有内容后,您现在就可以引导目标系统并将其配置为从网络引导。它应该从您的PXE服务器获取IP地址,然后开始启动ka1i。