Skip to content

Commit 1f92f04

Browse files
committed
Fixed issue with build on amd64 for PS
1 parent db3e726 commit 1f92f04

File tree

3 files changed

+89
-8
lines changed

3 files changed

+89
-8
lines changed

.github/workflows/docker-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212

1313
jobs:
1414
docker:
15-
runs-on: ubuntu-20.04
15+
runs-on: ubuntu-latest
1616
steps:
1717
- name: Checkout
1818
uses: actions/checkout@v3

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ RUN mkdir -p ${DOTNET_ROOT} \
9090
# apt package(s): ca-certificates, less, libssl1.1, libicu66, wget, unzip
9191
RUN PS_MAJOR_VERSION=$(curl -Ls -o /dev/null -w %{url_effective} https://aka.ms/powershell-release\?tag\=lts | cut -d 'v' -f 2 | cut -d '.' -f 1) \
9292
&& PS_INSTALL_FOLDER=/opt/microsoft/powershell/${PS_MAJOR_VERSION} \
93-
&& PS_PACKAGE=$(curl -Ls -o /dev/null -w %{url_effective} https://aka.ms/powershell-release\?tag\=lts | sed 's#https://github.com#https://api.github.com/repos#g; s#tag/#tags/#' | xargs curl -s | grep browser_download_url | grep linux-${PS_ARCH} | cut -d '"' -f 4 | xargs basename) \
94-
&& PS_PACKAGE_URL=$(curl -Ls -o /dev/null -w %{url_effective} https://aka.ms/powershell-release\?tag\=lts | sed 's#https://github.com#https://api.github.com/repos#g; s#tag/#tags/#' | xargs curl -s | grep browser_download_url | grep linux-${PS_ARCH} | cut -d '"' -f 4) \
93+
&& PS_PACKAGE=$(curl -Ls -o /dev/null -w %{url_effective} https://aka.ms/powershell-release\?tag\=lts | sed 's#https://github.com#https://api.github.com/repos#g; s#tag/#tags/#' | xargs curl -s | grep browser_download_url | grep linux-${PS_ARCH}.tar.gz | cut -d '"' -f 4 | xargs basename) \
94+
&& PS_PACKAGE_URL=$(curl -Ls -o /dev/null -w %{url_effective} https://aka.ms/powershell-release\?tag\=lts | sed 's#https://github.com#https://api.github.com/repos#g; s#tag/#tags/#' | xargs curl -s | grep browser_download_url | grep linux-${PS_ARCH}.tar.gz | cut -d '"' -f 4) \
9595
&& curl -LO ${PS_PACKAGE_URL} \
9696
&& mkdir -p ${PS_INSTALL_FOLDER} \
9797
&& tar zxf ${PS_PACKAGE} -C ${PS_INSTALL_FOLDER} \

README.md

Lines changed: 86 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ VMware's PowerCLI with PowerShell Core and Python for ImageBuilder Support in Li
99

1010
## About
1111

12-
This container is based on Ubuntu 20.04, contains the `mkisofs` package (for repacking ISO images) and has the following software installed, per the [Compatibility Matrixes for VMware PowerCLI 13.1.0](https://vdc-repo.vmware.com/vmwb-repository/dcr-public/f479301e-3164-47bc-9584-89b84a1bf5ce/c4ea2d2f-bf6d-4c18-bb20-6c4782ac6576/powercli1310-compat-matrix.html) and [Compatibility Matrixes for VMware PowerCLI 13.0.0](https://developer.vmware.com/docs/17472//powercli1300-compat-matrix.html#install-prereq):
12+
This container is based on Ubuntu 20.04, contains both `xorriso` and `mkisofs` packages (for repacking ISO images) and has the following software installed, per the [Compatibility Matrixes for VMware PowerCLI 13.1.0](https://vdc-repo.vmware.com/vmwb-repository/dcr-public/f479301e-3164-47bc-9584-89b84a1bf5ce/c4ea2d2f-bf6d-4c18-bb20-6c4782ac6576/powercli1310-compat-matrix.html) and [Compatibility Matrixes for VMware PowerCLI 13.0.0](https://developer.vmware.com/docs/17472//powercli1300-compat-matrix.html#install-prereq):
1313

1414
- .NET Core 3.1 (which is now [End of Support](https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-core))
1515
- PowerShell Core 7.2 LTS (Automated)
@@ -19,7 +19,7 @@ This container is based on Ubuntu 20.04, contains the `mkisofs` package (for rep
1919
**NOTE**:
2020

2121
- Python is configured per requirements outlined in [Install and Configure Python on Linux](https://developer.vmware.com/docs/15315/powercli-user-s-guide/GUID-101A5D2A-6BEB-43B0-8328-3B2F9F80C628.html)
22-
- For `ARM64` (aka Apple Silicone) users, there is a bug in PowerCLI 13.1.0 with ImageBuilder and it will not run so, `ARM64` images contain PowerCLI 13.0.0. Actively racking this issue down with VMware for resolution.
22+
- For `ARM64` (aka Apple Silicone) users, there is a bug in PowerCLI 13.1.0 with ImageBuilder and it will not run so, `ARM64` images contain PowerCLI 13.0.0. VMware states its due to one of their modules not being compiled for ARM and have provided no ETA on when they'll fix it. Until then, I am keeping PowerCLI 13.0.0 for ARM64 images.
2323

2424
## How to Use
2525

@@ -37,13 +37,13 @@ For most use cases where the intent is to only use PowerCLI (without Image Build
3737
docker run -it jmcombs/vmware-powercli
3838
```
3939

40-
If the intent is to use PowerCLI with Image Builder, a volume will need to be mapped:
40+
If the intent is to use PowerCLI with Image Builder and use `xorriso` to repackage modified Images, a volume will need to be mapped:
4141

4242
```shell
4343
docker run -it --volume=/your/local/filesystem/files:/home/coder/files jmcombs/vmware-powercli
4444
```
4545

46-
If the intent is to use PowerCLI with Image Builder and use `mkisofs` to repackage modified Images, a volume will need to be mapped and it is required to run the container in Privileged Mode
46+
If the intent is to use PowerCLI with Image Builder and use `mkisofs` to repackage modified Images, a volume will need to be mapped `mkisofs` requires the container to be ran in Privileged Mode
4747

4848
```shell
4949
docker run -it --privileged --volume=/your/local/filesystem/files:/home/coder/files jmcombs/vmware-powercli
@@ -260,7 +260,88 @@ PS /home/coder/files> Export-EsxImageProfile -ImageProfile ESXi-7.0U3g-nuc12-syn
260260

261261
10. Happy ESXi Installing!
262262

263-
### Modify & Repackage ESXi ISO
263+
### Modify & Repackage ESXi ISO with `xorriso`
264+
265+
The following are instructions for
266+
267+
- This is the recommended approach
268+
- Mounting an ESXi ISO image
269+
- Copying ESXi ISO image to a temporary location (for modification) & Repackaging using `xorriso`
270+
271+
#### **NOTE:** The example below:
272+
273+
- Is using an ESXi `7.0U3g` ISO image created with Image Builder which includes [Community Networking Driver for ESXi](https://flings.vmware.com/community-networking-driver-for-esxi) and [Synology NFS Plug-in for VMware VAAI](https://kb.synology.com/en-us/DSM/tutorial/How_do_I_install_Synology_NFS_VAAI_Plug_in_on_an_ESXi_host) VIBs
274+
- Image Builder ISO file is named `VMware-VMvisor-Installer-7.0U3g-20328353.x86_64.nuc12-syn.iso`
275+
- Repackaged ISO file is named `custom_esxi.iso`
276+
- Location of files is in `/home/coder/files`
277+
278+
#### **Assumptions:**
279+
280+
- It is assumed the user knows how to modify an ESXi Image (adding Kickstart scripts, modifying `boot.cfg`, creating Boot Menus, etc.) and, as such, are not demonstrated below
281+
282+
#### **Instructions**
283+
284+
1. Verify ISO Information
285+
286+
```shell
287+
isoinfo -d -i ./VMware-VMvisor-Installer-7.0U3g-20328353.x86_64.nuc12-syn.iso
288+
CD-ROM is in ISO 9660 format
289+
System id:
290+
Volume id: ESXI-7.0U3G-NUC12-SYN
291+
Volume set id:
292+
Publisher id:
293+
Data preparer id:
294+
Application id: ESXIMAGE
295+
Copyright File id:
296+
Abstract File id:
297+
Bibliographic File id:
298+
Volume set size is: 1
299+
Volume set sequence number is: 1
300+
Logical block size is: 2048
301+
Volume size is: 196201
302+
El Torito VD version 1 found, boot catalog is in sector 1419
303+
NO Joliet present
304+
NO Rock Ridge present
305+
Eltorito validation header:
306+
Hid 1
307+
Arch 0 (x86)
308+
ID ''
309+
Key 55 AA
310+
Eltorito defaultboot header:
311+
Bootid 88 (bootable)
312+
Boot media 0 (No Emulation Boot)
313+
Load segment 0
314+
Sys type 0
315+
Nsect 4
316+
Bootoff 4699 18073
317+
```
318+
319+
2. Create temporary folder for ESXi Installer (for modifications to boot commands, adding kickstart scripts, adding boot loader menus, etc)
320+
321+
```shell
322+
mkdir /home/coder/files/custom_esxi_cdrom/
323+
```
324+
325+
3. Extract ESXi installer files from mounted ISO to temporary folder and change permissions (to enable editing):
326+
327+
```shell
328+
osirrox -indev ./VMware-VMvisor-Installer-7.0U3l-21424296.x86_64.nuc-syn.iso -extract / ./custom_esxi_cdrom/
329+
chmod -R u+w /home/coder/files/custom_esxi_cdrom
330+
```
331+
332+
4. Make changes to ESXi Installer
333+
5. Create new ESXi Installer ISO
334+
335+
```shell
336+
cd /home/coder/files/custom_esxi_cdrom
337+
xorriso -as mkisofs -relaxed-filenames -joliet-long --norock -appid ESXIMAGE -volid ESXI70U3G_NUC12-SYN -output /home/coder/files/custom_esxi.iso -eltorito-boot ISOLINUX.BIN -eltorito-catalog BOOT.CAT -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -eltorito-platform 0xEF -e EFIBOOT.IMG -no-emul-boot /home/coder/files/custom_esxi_cdrom
338+
```
339+
340+
**NOTE:** `--norock` is for ESXi Images only
341+
342+
8. Happy ESXi Installing!
343+
344+
### Modify & Repackage ESXi ISO with `mkisofs`
264345

265346
The following are instructions for
266347

0 commit comments

Comments
 (0)