
MiniPCにESXiをインストールしてみる-02
前回の様子
前回は開梱してSSDを増設したところまで進めました。
そもそもMiniPCはESXiをインストールできるの?
ESXiをインストールするためにはコンパチの取れているNICが乗っていることが重要だが、MiniPCに乗りがちなRealtec系のNICはノンサポの状態=ドライバが無くインストールが完了しない!
そのため、コンパチの取れている適当なUSB NICを接続する必要があります。
ただ、その外部NIC用のドライバはISOに含まれていないため、Custom ISOを作る必要があります。
…合ってるはず。たぶん。
用意したもの
ESXiのISO
外部NICのドライバ
PowerCLI
Python実行環境
ESXi ISOに外部ドライバ組み込むPythonファイル
ESXiのISOを入手する
VMware社のアカウントを作成し、以下のURLからISOをダウンロードする。
https://customerconnect.vmware.com/home
今回DLしたのは8.0U1a。U2でやろうとしましたが、なぜか後述のNICドライバを組み込めず、Verを下げることに。
外部NUCドライバ
以下URLから”USB Network Native Driver for ESXi”内の該当VerをDownload

PowerCLIをインストール
管理者権限をつけたPowerShellを起動し、以下を実行
Install-Module -Name VMware.PowerCLI -AllowClobber
Pythonの実行環境
コマンド叩いて、きちんとパスが通っていることを確認
python -V
Python 3.10.6
今回は3.10台が入っていました。色々やろうとしてたときの名残ですね…。
ESXi ISOに外部ドライバを組み込むPythonファイル
以下GithubよりESXi-Customizer-PS.ps1を入手。
この方、有名らしいですね。しらなんだ。
実際に外部NICドライバをISOに組み込んでいく
実際に入れていたのは以下のコマンド
まず、実行権限を与えておく。
PS F:\vm\customesxi> Set-ExecutionPolicy Bypass -Scope Process -Force
PS F:\vm\customesxi> Get-ExecutionPolicy
次に、構文をパk…参照して、以下を実行
.\ESXi-Customizer-PS.ps1 -v80 -pkgDir vmkusb-nic-fling80u1 -izip VMware-ESXi-8.0U1-21495797-depot.zip -outDir F:\vm\customesxi -log .\20231231_1.log
ログとしては以下
**********************
Windows PowerShell トランスクリプト開始
開始時刻: 20231231135905
ユーザー名:
RunAs ユーザー:
構成名:
コンピューター:
ホスト アプリケーション: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
プロセス ID: 13060
PSVersion: 5.1.19041.3803
PSEdition: Desktop
PSCompatibleVersions: 1.0, 2.0, 3.0, 4.0, 5.0, 5.1.19041.3803
BuildVersion: 10.0.19041.3803
CLRVersion: 4.0.30319.42000
WSManStackVersion: 3.0
PSRemotingProtocolVersion: 2.3
SerializationVersion: 1.1.0.1
**********************
Welcome to VMware PowerCLI!
Log in to a vCenter Server or ESX host:
Connect-VIServer
To find out what commands are available, type:
Get-VICommand
To show searchable help for all PowerCLI commands:
Get-PowerCLIHelp
Once you've connected, display all virtual machines:
Get-VM
If you need more help, visit the PowerCLI community:
Get-PowerCLICommunity
Copyright (C) VMware, Inc. All rights reserved.
Running with PowerShell version 5.1 and VMware PowerCLI version 13.2.1 build 22851661
Adding base Offline bundle VMware-ESXi-8.0U1-21495797-depot.zip ...
[OK]
Getting Imageprofiles, please wait ...
[OK]
Using Imageprofile ESXi-8.0U1-21495797-standard ...
(Dated 04/18/2023 00:00:00, AcceptanceLevel: PartnerSupported,
The general availability release of VMware ESXi Server 8.0U1 brings whole new levels of virtualization performance to datacenters and enterprises.)
Loading Offline bundles and VIB files from vmkusb-nic-fling80u1 ...
Loading F:\vm\customesxi\vmkusb-nic-fling80u1\VMW_bootbank_vmkusb-nic-fling_1.12-1vmw.801.0.0.64098092.vib ...
[OK]
Add VIB vmkusb-nic-fling 1.12-1vmw.801.0.0.64098092
[OK, added]
Exporting the Imageprofile to 'F:\vm\customesxi\ESXi-8.0U1-21495797-standard-customized.iso'. Please be patient ...
All done.
**********************
Windows PowerShell トランスクリプト終了
終了時刻: 20231231140035
**********************
これで、指定した同ディレクトリにCustomISOが生成されました。
ファイル名としては”ESXi-8.0U1-21495797-standard-customized.iso”ですね。
トラブルシューティング
上記はうまく行った例ですが、失敗もありました。
一番解消に時間かかったのが以下Errorです。
Adding base Offline bundle VMware-ESXi-8.0-20513097-depot.zip ...
PS>終了エラー(Add-EsxSoftwareDepot): "Failed to initialize the VMware.ImageBuilder PowerCLI module because of error: Missing Python modules. Make sure the following Python modules are installed: six, lxml, psutil, pyopenssl.
Make sure that Python 3.7.1 or higher is installed and that you have set the path to the Python executable by using Set-PowerCLIConfiguration -PythonPath <executable_path>. See the PowerCLI Compatibility Matrixes for information on the Python requirements."
An unexpected error occurred:
Failed to initialize the VMware.ImageBuilder PowerCLI module because of error: Missing Python modules. Make sure the following Python modules are installed: six, lxml, psutil, pyopenssl.
Make sure that Python 3.7.1 or higher is installed and that you have set the path to the Python executable by using Set-PowerCLIConfiguration -PythonPath <executable_path>. See the PowerCLI Compatibility Matrixes for information on the Python requirements.
"Make sure that Python 3.7.1 or higher"と言われても、"python -V" 叩いて"Python 3.10.6"で返ってきているのは確認しているし…。
Windowsが悪いのか?Python入れ直し??ググっていたところ、どうやらWindowsには"アプリ実行エイリアス"という項目があり、なんか違うルートでパスを通そうとするとのこと。
自分の環境を確認してみると、たしかに有効に。
これを無効化して、再起動して、やっとコマンドが実行できました。

次回予告
ISOをUSBに焼いてBootさせるだけ!ミスる要素ないっしょ!
結果→IP固定できないし、挙動が謎。どないせぇっちゅうねん!
デュエルスタンバイ!!