[Linux] PXE Boot Ubuntu 20.04 via Serva on Windows 10
在 Windows 10 透過 Serva 進行 Ubuntu 20.04 Live Desktop PXE 開機
Author:Lau Dai
Date:2022/03/24
You can learn more about PXE via Serva’s offical article:
PXE/BINL — AN01: Windows Network Install — Basis
PXE/BINL — AN03: Non-Windows Network Boot/Install
Requirements
- Serva software [Download link], I use Serva_Community_v4.6.0 in this practice.
- Windows OS which run Serva software
- DHCP server (optional if run proxyDHCP)
- Assumed knowledge: PXE knowledge, Linux basics.
PXE Boot tutorial
Step 1. Run Serva as administrator and set the TFTP server, DHCP/proxyDHCP server
In this article I use proxyDHCP service instead of DHCP server via Serva.
Select the root folder for the TFTP server
Step 2. Setup the proxyDHCP and checked the BINL service
Step 3. Close the Serva and restart Serva to run the config.
Step 4. After restart the Serva. Share the NWA_PXE folder as NWA_PXE_SHARE via Advanced Sharing.
Step 5. Mount the your ubuntu20.04-desktop.iso
. Copy the file to NWA_PXE/{your distro folder name}
Step 6. Create ServaAsset.inf in NWA_PXE/{your distro folder name}/ServaAsset.inf
ServaAsset.inf content like this:
Step 7. Open SMB/CIFS (you can run OptionalFeatures
command)
Step 8. Create a username/password account serva/avres
You can run cmd/powershell as administrator via command net user serva avers /add
Step 9. Run your PXE client device to select your OS to boot.
You can see the log in Serva when you run PXE client.
中文版教學與細節補充:
基本上看完官方教學文章,或者按照上面流程就可以正確執行。
主要分成幾個階段
- 設定PXE Server所需的服務如TFTP server, DHCP 與 proxyDHCP server。
- 掛載SMB/CIFS服務,將檔案移至該文件區。
- 建立後續啟動時,與SMB/CIFS 服務連線使用的帳號密碼。
- 設定 ServaAsset.inf 檔案,讓非 Windows 的情況下,Serva 的 NBP 可以認得這些檔案。
運作流程:
- PXE Client 透過廣播方式,取得 IP、TFTP Server 位置
- 向 TFTP Server 取得 NBP 檔案
- 透過 NBP取得
vmlinuz
、initrd
檔案 - 啟動
initrd
後,進行 netboot,嘗試與 SMB/CIFS server 進行連線 - 將 live_media 的檔案複製到 ram tmpfs(此測試為在8G ram的檔案中,掛載3461858k的tmpfs)
mount -t tmpfs -o size=3461858k /dev/shm /cdrom_swap
6. 檔案會先從 SMB/CIFS 中下載到 PXE Client tmpfs 當中(此時會吃硬碟與網路的效能)
7. 之後就是檢查檔案完整性的流程(已無從SMB/CIFS取得檔案),最後會啟動 Live CD,完成Live Desktop開機作業。
特別注意:
- ServaAsset.inf 不要儲存成文字檔,這不像 Linux 單純看檔名決定檔案屬性。
- 目前使用 Ubuntu 20.04.4-desktop.iso 進行此次試驗。Ubuntu 20.04.2-desktop.iso 在相同的軟體、ServaAsset.inf 設定檔、相同的SMB/CIFS 環境,並且驗證過檔案完整性的情況下;在使用PXE Boot的時候,會遇到 kernel nfsmount 掛載參數失敗的問題。