OS X(豹,而不是服务器)似乎有tftp和内置的某种types的DHCP服务器,这似乎足以使PXE靴子发生,但我真的不知道从哪里开始。 我也有Windows(XP和7)工作站。
我宁愿快速和肮脏的解决scheme,因为这只是一个临时措施,直到我再次运行我的debian服务器。 🙂
IIRC,在家build立PXE引导环境,我用:
看来Tftpd32也包含了DHCP服务器,我不记得正确的原因,我为什么使用Small HTTP服务器。
我试图通过我的macOS笔记本电脑在台式机上安装Arch Linux。 这有点牵扯,但是可以使用macOS的bootpd(结合BOOTP和DHCP)和tftp服务器来完成。
首先为你的发行版下载一个iPXE的networking启动映像,在我的情况下,在arch发行版中是 ipxe.pxe:
wget https://www.archlinux.org/static/netboot/ipxe.8da38b4a9310.pxe
现在,将您的macOS系统连接到希望进行PXE启动安装的客户端计算机。 我从我的雷电端口使用以太网电缆,这使我的笔记本电脑的WiFi连接到互联网。
接下来在你的macOS – >客户端界面上设置一个手动IP地址。 在networking首选项中select您的接口,并指定手动IP地址192.168.2.254 ,如果需要,使用子网255.255.255.0 。
在这个阶段,我在系统偏好设置中启用了Internet共享 ,在WiFi和以太网之间创build了一个桥接适配器。 客户端计算机已连接很重要,否则/etc/bootpd.plistconfiguration文件将无法正确创build。
现在将你的netboot映像复制到tftp服务器根目录。 默认情况下,这是一个由拥有完全读取权限的root拥有的目录/private/tftpboot 。 将您的netboot映像复制到该目录中:
sudo cp ipxe.8da38b4a9310.pxe /private/tftpboot
接下来,您必须修改bootpd服务器configuration文件以指向您的netboot映像和tftp服务器。 首先,您需要将netboot映像的文件名编码为base64,具体操作如下:
printf %s00 `echo -n ipxe.8da38b4a9310.pxe | xxd -p` | xxd -r -p | openssl base64
现在打开你的bootpd服务器configuration文件
sudo nano /etc/bootpd.plist
并将您的静态IP和base64编码的文件名添加到<subnet> <array> <dict>的底部:
<key>dhcp_option_66</key> <string>192.168.2.254</string> <key>dhcp_option_67</key> <data>aXB4ZS44ZGEzOGI0YTkzMTAucHhlAA==</data>
我的bootpd.plist现在看起来如下所示:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Subnets</key> <array> <dict> <key>_creator</key> <string>com.apple.NetworkSharing</string> <key>allocate</key> <true/> <key>dhcp_domain_name_server</key> <array> <string>192.168.2.1</string> </array> <key>dhcp_router</key> <string>192.168.2.1</string> <key>interface</key> <string>bridge100</string> <key>lease_max</key> <integer>86400</integer> <key>lease_min</key> <integer>86400</integer> <key>name</key> <string>192.168.2/24</string> <key>net_address</key> <string>192.168.2.0</string> <key>net_mask</key> <string>255.255.255.0</string> <key>net_range</key> <array> <string>192.168.2.2</string> <string>192.168.2.254</string> </array> <key>dhcp_option_66</key> <string>192.168.2.254</string> <key>dhcp_option_67</key> <data>aXB4ZS44ZGEzOGI0YTkzMTAucHhlAA==</data> </dict> </array> <key>bootp_enabled</key> <false/> <key>detect_other_dhcp_server</key> <array> <string>bridge100</string> </array> <key>dhcp_enabled</key> <array> <string>bridge100</string> </array> <key>dhcp_ignore_client_identifier</key> <true/> <key>ignore_allow_deny</key> <array> <string>bridge100</string> </array> <key>use_server_config_for_dhcp_options</key> <false/> </dict> </plist>
现在运行以下命令重新启动/启用macOS bootpd和tftp服务器:
sudo launchctl unload -w /System/Library/LaunchDaemons/{bootps,tftp}.plist sudo launchctl load -w /System/Library/LaunchDaemons/{bootps,tftp}.plist
现在你应该通过本地连接并下载你的netboot映像来testing你的tftp服务器:
tftp localhost tftp> get ipxe.8da38b4a9310.pxe Received 343580 bytes in 0.1 seconds tftp> quit
现在启动PXE启动你的客户端系统,它应该find你的macOS DHCP服务器(通过bootpd),分配一个IP地址,findTFTP服务器,传输并运行netboot映像! 成功!
完成后禁用bootpd和tftp服务器:
launchctl unload -w /System/Library/LaunchDaemons/{bootps,tftp}.plist