Skip to content

Commit

Permalink
Packer ci : try to install virtualbox guest addition manually
Browse files Browse the repository at this point in the history
  • Loading branch information
fxi committed Jun 10, 2024
1 parent 97945bf commit 9a8334f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,20 @@ jobs:
# | __/\_____|\____)_| \_)_____)_|
# |_|
packer:
runs-on: macos-13
runs-on: ubuntu
needs: docker
name: Build VirtualBox ova
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install VirtualBox
run:
brew install --cask virtualbox
run: |
wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -
sudo add-apt-repository "deb http://download.virtualbox.org/virtualbox/debian $(lsb_release -cs) contrib"
sudo apt-get update
sudo apt-get install -y virtualbox-7.0
- name: Setup Packer
uses: hashicorp/setup-packer@main
Expand Down
5 changes: 0 additions & 5 deletions packer/alpine.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,6 @@ variable "iso_url" {
default = "https://dl-cdn.alpinelinux.org/alpine/v3.16/releases/x86_64/alpine-virt-3.16.8-x86_64.iso"
}

variable "alpine_repo" {
type = string
default = "https://dl-cdn.alpinelinux.org/alpine/v3.16/community"
}

variable "memory" {
type = string
Expand Down Expand Up @@ -206,7 +202,6 @@ build {
environment_vars = [
"USERNAME=${var.username}",
"PASSWORD=${var.userpassword}",
"ALPINE_REPOSITORY=${var.alpine_repo}",
"AM5_PORT_APP=${var.port_app}",
"AM5_PORT_APP_PUBLIC=${var.port_app_public}",
"AM5_PORT_HTTP=${var.port_http}",
Expand Down
12 changes: 11 additions & 1 deletion packer/scripts/provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,21 @@ apk --no-cache add \
docker \
dialog \
jq \
virtualbox-guest-additions \
util-linux \
sudo \
rsync

#
# Download and install VirtualBox Guest Additions 7.0.18
#
wget https://download.virtualbox.org/virtualbox/7.0.18/VBoxGuestAdditions_7.0.18.iso -P /tmp/
mkdir /mnt/vboxadditions
mount -o loop /tmp/VBoxGuestAdditions_7.0.18.iso /mnt/vboxadditions
sh /mnt/vboxadditions/VBoxLinuxAdditions.run || true # Allow script to continue even if there are warnings/errors
umount /mnt/vboxadditions
rm -rf /tmp/VBoxGuestAdditions_7.0.18.iso /mnt/vboxadditions


#
# Set users
#
Expand Down

0 comments on commit 9a8334f

Please sign in to comment.