From 4bb4272e610379d28a810488aa798951fa12421e Mon Sep 17 00:00:00 2001 From: fgierlinger <2966031+fgierlinger@users.noreply.github.com> Date: Mon, 24 Jun 2024 16:28:16 +0200 Subject: [PATCH] fix open-vm-tools installation in debian11 Signed-off-by: fgierlinger <2966031+fgierlinger@users.noreply.github.com> --- packer_templates/scripts/_common/vmware_debian_ubuntu.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packer_templates/scripts/_common/vmware_debian_ubuntu.sh b/packer_templates/scripts/_common/vmware_debian_ubuntu.sh index 1409a8bd6..8f8b2addb 100644 --- a/packer_templates/scripts/_common/vmware_debian_ubuntu.sh +++ b/packer_templates/scripts/_common/vmware_debian_ubuntu.sh @@ -2,7 +2,16 @@ case "$PACKER_BUILDER_TYPE" in vmware-iso|vmware-vmx) + # determine the major Debian version we're runninng + major_version="$(grep VERSION_ID /etc/os-release | awk -F= '{print $2}' | tr -d '"')" + architecture="$(uname -m)" + + # open-vm-tools for amd64 are only available in bullseye-backports repo echo "install open-vm-tools" + if [ "$major_version" -eq 11 ] && [ "$architecture" = "aarch64" ]; then + echo 'deb http://deb.debian.org/debian bullseye-backports main' >> /etc/apt/sources.list + apt-get update + fi apt-get install -y open-vm-tools; mkdir /mnt/hgfs; systemctl enable open-vm-tools