Installing packer plugin gives permission denied

I’m trying to create a packer build as follows, and am getting permission denied.

PACKER_LOG=1 packer init .
+ PACKER_LOG=1
+ packer init .
2024/05/06 11:35:03 [INFO] Packer version: 1.10.3 [go1.20.12 linux amd64]
2024/05/06 11:35:03 [TRACE] discovering plugins in /usr/bin
2024/05/06 11:35:03 [TRACE] discovering plugins in .
2024/05/06 11:35:03 [TRACE] discovering plugins in /home/userid/.config/packer/plugins
2024/05/06 11:35:03 [INFO] PACKER_CONFIG env var not set; checking the default config file path
2024/05/06 11:35:03 [INFO] PACKER_CONFIG env var set; attempting to open config file: /home/userid/.packerconfig
2024/05/06 11:35:03 [WARN] Config file doesn't exist: /home/userid/.packerconfig
2024/05/06 11:35:03 [INFO] Setting cache directory: /home/userid/.cache/packer
2024/05/06 11:35:03 [TRACE] init: plugingetter.ListInstallationsOptions{FromFolders:[]string{"/usr/bin", ".", "/home/userid/.config/packer/plugins"}, BinaryInstallationOptions:plugingetter.BinaryInstallationOptions{APIVersionMajor:"5", APIVersionMinor:"0", OS:"linux", ARCH:"amd64", Ext:"", Checksummers:[]plugingetter.Checksummer{plugingetter.Checksummer{Type:"sha256", Hash:(*sha256.digest)(0xc00035d400)}}}}
2024/05/06 11:35:03 [TRACE] listing potential installations for "github.com/hashicorp/vsphere" that match "~> 1". plugingetter.ListInstallationsOptions{FromFolders:[]string{"/usr/bin", ".", "/home/userid/.config/packer/plugins"}, BinaryInstallationOptions:plugingetter.BinaryInstallationOptions{APIVersionMajor:"5", APIVersionMinor:"0", OS:"linux", ARCH:"amd64", Ext:"", Checksummers:[]plugingetter.Checksummer{plugingetter.Checksummer{Type:"sha256", Hash:(*sha256.digest)(0xc00035d400)}}}}
2024/05/06 11:35:03 [TRACE] getting available versions for the github.com/hashicorp/vsphere plugin
2024/05/06 11:35:03 [WARNING] github-getter: no GitHub token set, if you intend to install plugins often, please set the PACKER_GITHUB_API_TOKEN env var
2024/05/06 11:35:03 [DEBUG] github-getter: getting "https://api.github.com/repos/hashicorp/packer-plugin-vsphere/git/matching-refs/tags"
2024/05/06 11:35:04 [DEBUG] will try to install: [1.2.7 1.2.6 1.2.5 1.2.4 1.2.3 1.2.2 1.2.1 1.2.0 1.1.2 1.1.1 1.1.0 1.0.8 1.0.7 1.0.6 1.0.5 1.0.4 1.0.3 1.0.2 1.0.1 1.0.0]
2024/05/06 11:35:04 [TRACE] fetching checksums file for the "1.2.7" version of the github.com/hashicorp/vsphere plugin in "/home/userid/.config/packer/plugins/github.com/hashicorp/vsphere"...
2024/05/06 11:35:04 [DEBUG] github-getter: getting "https://github.com/hashicorp/packer-plugin-vsphere/releases/download/v1.2.7/packer-plugin-vsphere_v1.2.7_SHA256SUMS"
2024/05/06 11:35:04 [TRACE] ignoring invalid remote binary packer-plugin-vsphere_v1.2.7_x5.0_darwin_amd64.zip: wrong system, expected linux_amd64
2024/05/06 11:35:04 [TRACE] ignoring invalid remote binary packer-plugin-vsphere_v1.2.7_x5.0_darwin_arm64.zip: wrong system, expected linux_amd64
2024/05/06 11:35:04 [TRACE] ignoring invalid remote binary packer-plugin-vsphere_v1.2.7_x5.0_freebsd_386.zip: wrong system, expected linux_amd64
2024/05/06 11:35:04 [TRACE] ignoring invalid remote binary packer-plugin-vsphere_v1.2.7_x5.0_freebsd_amd64.zip: wrong system, expected linux_amd64
2024/05/06 11:35:04 [TRACE] ignoring invalid remote binary packer-plugin-vsphere_v1.2.7_x5.0_freebsd_arm.zip: wrong system, expected linux_amd64
2024/05/06 11:35:04 [TRACE] ignoring invalid remote binary packer-plugin-vsphere_v1.2.7_x5.0_linux_386.zip: wrong system, expected linux_amd64
2024/05/06 11:35:04 [TRACE] About to get: packer-plugin-vsphere_v1.2.7_x5.0_linux_amd64.zip
2024/05/06 11:35:04 [DEBUG] github-getter: getting "https://github.com/hashicorp/packer-plugin-vsphere/releases/download/v1.2.7/packer-plugin-vsphere_v1.2.7_x5.0_linux_amd64.zip"
Installed plugin github.com/hashicorp/vsphere v1.2.7 in "/home/userid/.config/packer/plugins/github.com/hashicorp/vsphere/packer-plugin-vsphere_v1.2.7_x5.0_linux_amd64"
2024/05/06 11:35:05 [INFO] (telemetry) Finalizing.
2024/05/06 11:35:06 waiting for all plugin processes to complete...
++ date +%Y%m%dt%H%M%S
+ packer build -var vm_name=name-here -var-file=pkrvars/pkrvars.hcl .
 Error loading configuration:

fork/exec /home/userid/.config/packer/plugins/github.com/hashicorp/vsphere/packer-plugin-vsphere_v1.2.7_x5.0_linux_amd64: permission denied

Yet, the directory permissions look fine to me:

[userid@host  vsphere]$ ls -la  /home/userid/.config/packer/plugins
total 0
drwxr-xr-x. 3 userid userid 24 May  6 11:35 .
drwxr-xr-x. 3 userid userid 73 May  6 11:35 ..
drwxr-xr-x. 3 userid userid 23 May  6 11:35 github.com

[userid@host  vsphere]$ ls -la  /home/userid/.config/packer/plugins/github.com/hashicorp/vsphere/
total 61096
drwxr-xr-x. 2 userid userid      122 May  6 11:35 .
drwxr-xr-x. 3 userid userid       21 May  6 11:35 ..
-rwxr-xr-x. 1 userid userid 62558208 May  6 11:35 packer-plugin-vsphere_v1.2.7_x5.0_linux_amd64
-rw-r--r--. 1 userid userid       64 May  6 11:35 packer-plugin-vsphere_v1.2.7_x5.0_linux_amd64_SHA256SUM


[userid@host  vsphere]$ file packer-plugin-vsphere_v1.2.7_x5.0_linux_amd64
packer-plugin-vsphere_v1.2.7_x5.0_linux_amd64: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, stripped

I get the same error if I replace the build statement with:

PACKER_LOG=1 packer plugins install github.com/hashicorp/vsphere

That said, I have a feeling it has something to do with the following, i.e. that I can’t run ./executable.

[userid@host  vsphere]$ vi test.sh
[userid@host  vsphere]$ chmod 0755 test.sh
[userid@host  vsphere]$ ./test.sh
-bash: ./test.sh: Permission denied

[userid@host  vsphere]$ bash test.sh
This is a test

[userid@host vsphere]$ cat test.sh
#!/bin/bash

echo "This is a test"

In the same way, executing the plugin executable doesn’t work, either:

[userid@host vsphere]$ . ./packer-plugin-vsphere_v1.2.7_x5.0_linux_amd64
-bash: .: ./packer-plugin-vsphere_v1.2.7_x5.0_linux_amd64: cannot execute binary file
[user@host vsphere]$ ./packer-plugin-vsphere_v1.2.7_x5.0_linux_amd64
-bash: ./packer-plugin-vsphere_v1.2.7_x5.0_linux_amd64: Permission denied
[user@host vsphere]$ export PATH=${PATH}:.
[user@host vsphere]$ packer-plugin-vsphere_v1.2.7_x5.0_linux_amd64
-bash: ./packer-plugin-vsphere_v1.2.7_x5.0_linux_amd64: Permission denied

I don’t think it’s SELinux related, as the output below looks fine to me.

[user@host vsphere]$ ls -latZ .
total 61104
drwxr-xr-x. 2 userid userid unconfined_u:object_r:config_home_t:s0     4096 May  6 15:17 .
-rwxr-xr-x. 1 userid userid unconfined_u:object_r:config_home_t:s0       35 May  6 15:17 test.sh
-rw-r--r--. 1 userid userid unconfined_u:object_r:config_home_t:s0        0 May  6 14:56 plugins.hwm
-rw-r--r--. 1 userid userid unconfined_u:object_r:config_home_t:s0        0 May  6 14:56 plugins.pwd
-rw-r--r--. 1 userid userid unconfined_u:object_r:config_home_t:s0        0 May  6 14:56 plugins.pwi
-rw-r--r--. 1 userid userid unconfined_u:object_r:config_home_t:s0       64 May  6 11:35 packer-plugin-vsphere_v1.2.7_x5.0_linux_amd64_SHA256SUM
-rwxr-xr-x. 1 userid userid unconfined_u:object_r:config_home_t:s0 62558208 May  6 11:35 packer-plugin-vsphere_v1.2.7_x5.0_linux_amd64
drwxr-xr-x. 3 userid userid unconfined_u:object_r:config_home_t:s0       21 May  6 11:35 ..

Any thoughts as to how I can get the packer plugin working?

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật