Extending my homelab with the vExpert gift

People that follow me on Twitter, know that we (vExperts) received an awesome gift from Cohesity. During VMware Explore in Barcelona we received a NUC for our homelab. How cool is that, an excellent gift to extend my homelab.

Content blog article

  1. Extra hardware
  2. Installing ESXi
    1. Download USB fling
    2. Build custom image
    3. Continue building custom image
  3. Installing ESXi with custom image
    1. Avoiding the install failure
  4. Make NIC config peristent after reboot
  5. Closing off

1. Extra hardware

Like with any NUC, you need to buy some extra hardware to be able to use it. This is the RAM and NIC I’ve bought to fit my homelab. You also have to buy a harddrive but I still had something laying around.

HardwareTypePriceWebsite
RAM64GB : 2 x Crucial CT32G4SFS624A170,80โ‚ฌAmazon link
NICCable Matters USB to Ethernet Adapter (USB 3.0 to Ethernet) 16,99โ‚ฌAmazon link

2. Installing ESXi

When you install ESXi on the NUC with the standard image it will fail because there aren’t any drivers in the standard image for the onboard NIC’s nor for the USB NIC.

This means we will need to build a custom image to install ESXi on our NUC.

2.1 Download USB fling

If you’re wondering what the hell the USB fling is. Well that’s a community project driven by William Lam that gives the possibility to use USB NIC’s for our homelabs.

I’m going to install vSphere 8, so I need to download the matching USB NIC driver from the Fling website => link
Download the driver and save it to eg. C:\temp\ESX

2.2 Build custom image

Open a powershell in Administrator mode and navigate to the same directory as where we downloaded our USB NIC driver. In my case C:\temp\ESX


First we’re going to add the software depot from the VMware website.
Add-EsxSoftwareDepot https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml

Now that we added the depot, we can search for the ESXi Image that we need. Remember, I’m installing vSphere 8 so I’m searching for anything with ESXi-8 in it’s name.
Get-EsxImageProfile -name ESXi-8*

2.2.1 Issue 1: Update PowerCLI

Now we need to download the vSphere 8 image locally.
Export-EsxImageProfile -ImageProfile ESXi-8.0a-20842819-standard -ExportToBundle -filepath ESXi-8.0a-20842819-standard.zip

This image has an empty alt attribute; its file name is image-12.png

I was getting these type of errors while creating my new image => “File path of ……. is claimed by multiple non-overlay VIBs”

Reason for that was because I was still running an older version of powerCLI. Meaning it was time to update my modules ๐Ÿ™‚
Update-Module VMware.*

2.2.2 Issue 2: Install Python

Next issue that was waiting for me, was the fact that Python wasn’t installed. This is a prereq. for the latest version of PowerCLI if you want to use ImageBuilder.

The prereqs for Python are documented on the VMware developer website => link

But I noted them down below:

  • Download python from www.python.org/downloads/release/python-379/ and install it. No printscreens of that because it’s a simple next, next, finish.
  • It has to be 3.7 because I’ve tried with the latest version (3.11) and it didn’t work ๐Ÿ™‚
  • Download get-pip.py from https://bootstrap.pypa.io/get-pip.py and install it with
    .\Appdata\Local\Programs\Python\Python37\python.exe C:\Users\administrator.VKASAERT\Downloads\get-pip.py

Install the required extra packages
.\Appdata\Local\Programs\Python\Python37\Scripts\pip3.7.exe install six psutil lxml pyopenssl

After the installation, we need to set the python path in PowerCLI. You will see that the printsreen still references my attempt of installing Python 3.11 but the command below is the correct one. Sorry about that.
Set-PowerCLIConfiguration -PythonPath C:\Users\administrator.VKASAERT\Appdata\Local\Programs\Python\Python37\python.exe -scope user

After you set your powerCLIConfiguration, you must reboot your machine for the configuration to work.
You can always check your config with Get-PowerCLIConfiguration | select *

After your reboot you should be able to run python from your powershell.

2.3 Continue building custom image

Now that I tackled all the issues I can finally download the vSphere 8 Image.
Export-EsxImageProfile -ImageProfile ESXi-8.0a-20842819-standard -ExportToBundle -filepath ESXi-8.0a-20842819-standard.zip

Once the image is downloaded we remove the SoftwareDepot and we add both files in our SoftwareDepot
Remove-EsxSoftwareDepot https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml
Add-EsxSoftwareDepot C:\Temp\ESX\ESXi-8.0a-20842819-standard.zip
Add-EsxSoftwareDepot C:\Temp\ESX\ESXi800-VMKUSB-NIC-FLING-61054763-component-20826251.zip

With this command we’re creating our new ImageProfile
New-EsxImageProfile -cloneprofile ESXi-8.0a-20842819-standard -Name "ESXi8_with_USBdriver" -Vendor vKasaert

In this step we’re adding the USB driver to the ImageProfile we created in the previous step.
Add-EsxSoftwarePackage -ImageProfile ESXi8_with_USBdriver -SoftwarePackage vmkusb-nic-fling

If you want to know where I got the “vmkusb-nic-fling” just execute Get-EsxSoftwarePackage and search for the USB fling package.

Now we will export the image to an ISO file.
Export-EsxImageProfile -ImageProfile ESXi8_with_USBdriver -ExportToIso -FilePath ESXi8_with_USBdriver.iso

If you open your explorer, you will see the ISO that we just exported.
You can create a bootable image with Rufus

3. Installing ESXi with custom image

If you know my kind of luck, you will know that my issues aren’t done yet. Installing ESXi with the custom image started, but at 73% I got an error message “no vmknic tagged for management”.
This is because we’re using a USB NIC.

What do you need to do…

  • Remove your USB drive
  • Reboot
  • Logon with empty password
  • Go to “Network Restore Options”

Choose “Restore Network Settings”

Press F11 to Reset.

After this step you should be able to configure the network settings on your NUC and you’re able to access your fresh ESXi install ๐Ÿ™‚

3.1 Avoiding the install failure

Alternatively, if you want to avoid this failure at 73% you can edit the boot.cfg config on the bootable USB drive that you created. Go to /efi/boot/ and edit the boot.cfg file.

On line 6 that contains “kernelopt” append “usbBusFullScanOnBootEnabled=1” at the end.

This will install your ESXi without the install failure.

4. Make NIC config peristent after reboot

To make sure the USB NIC remains persistent after reboot you need to edit the /etc/rc.local.d/local.sh file. Add below text to the file and save it.

vusb0_status=$(esxcli network nic get -n vusb0 | grep 'Link Status' | awk '{print $NF}')
count=0
while [[ $count -lt 20 && "${vusb0_status}" != "Up" ]]
do
sleep 10
count=$(( $count + 1 ))
vusb0_status=$(esxcli network nic get -n vusb0 | grep 'Link Status' | awk '{print $NF}')
done

esxcfg-vswitch -R

If you reboot your NUC you will now retain your connectivity.

5. Closing off

Once again a big thank you to Cohesity for the gift.
And hopefully this blog helps you in your NUC ESXi install ๐Ÿ™‚

Feel free to leave a comment.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s