[Linux] PXE Boot Ubuntu 20.04 via Serva on Windows 10

在 Windows 10 透過 Serva 進行 Ubuntu 20.04 Live Desktop PXE 開機

Lau Dai He
3 min readApr 6, 2022

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

  1. Serva software [Download link], I use Serva_Community_v4.6.0 in this practice.
  2. Windows OS which run Serva software
  3. DHCP server (optional if run proxyDHCP)
  4. 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.

中文版教學與細節補充:

基本上看完官方教學文章,或者按照上面流程就可以正確執行。

主要分成幾個階段

  1. 設定PXE Server所需的服務如TFTP server, DHCP 與 proxyDHCP server。
  2. 掛載SMB/CIFS服務,將檔案移至該文件區。
  3. 建立後續啟動時,與SMB/CIFS 服務連線使用的帳號密碼。
  4. 設定 ServaAsset.inf 檔案,讓非 Windows 的情況下,Serva 的 NBP 可以認得這些檔案。

運作流程:

  1. PXE Client 透過廣播方式,取得 IP、TFTP Server 位置
  2. 向 TFTP Server 取得 NBP 檔案
  3. 透過 NBP取得 vmlinuzinitrd檔案
  4. 啟動 initrd後,進行 netboot,嘗試與 SMB/CIFS server 進行連線
  5. 將 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開機作業。

特別注意:

  1. ServaAsset.inf 不要儲存成文字檔,這不像 Linux 單純看檔名決定檔案屬性。
  2. 目前使用 Ubuntu 20.04.4-desktop.iso 進行此次試驗。Ubuntu 20.04.2-desktop.iso 在相同的軟體、ServaAsset.inf 設定檔、相同的SMB/CIFS 環境,並且驗證過檔案完整性的情況下;在使用PXE Boot的時候,會遇到 kernel nfsmount 掛載參數失敗的問題。

--

--

Lau Dai He
Lau Dai He

Written by Lau Dai He

Less is more. 2021/08/01起,主要會紀錄各種技術的精華重點文章,方向可能是Pyhton, Linux, WIndows等都有可能。文章內容精簡為主,搭配少部份的個人情感抒發等。(inspired by 路人甲的世界​-知乎作者)

No responses yet