Skip to content

Commit 00965a4

Browse files
committed
VirtualBox builders install VBoxGuestAdditions
1 parent c7446a4 commit 00965a4

7 files changed

+53
-7
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
/iso/*
33
!/iso/README.md
44
/output-vmware/
5+
/output-virtualbox/
56
/*.box
67
/packer_cache/

scripts/install-puppet.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#!/bin/sh
22
set -x
33

4-
wget --no-check-certificate http://pm.puppetlabs.com/puppet-enterprise/2.7.2/puppet-enterprise-2.7.2.msi
5-
msiexec /qn /i puppet-enterprise-2.7.2.msi
4+
wget --no-check-certificate http://pm.puppetlabs.com/puppet-enterprise/3.0.1/puppet-enterprise-3.0.1.msi -O puppet.msi
5+
msiexec /qn /i puppet.msi
6+
rm -rf puppet.msi
67
cmd.exe /c setx /m PATH "%path%;C:\\Program Files (x86)\\Puppet Labs\\Puppet Enterprise\\bin"
78

89
sleep 1

scripts/install-virtualbox-tools.sh

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/sh
2+
set -x
3+
4+
if [ "$PACKER_BUILDER_TYPE" != "virtualbox" ]; then
5+
echo "not building virtualbox, skipping"
6+
exit
7+
fi
8+
9+
# 7zip will allow us to extract a file from an ISO
10+
wget http://downloads.sourceforge.net/sevenzip/7z920-x64.msi
11+
msiexec /qb /i 7z920-x64.msi
12+
13+
# There needs to be Oracle CA (Certificate Authority) certificates installed in order
14+
# to prevent user intervention popups which will undermine a silent installation.
15+
cmd /c certutil -addstore -f "TrustedPublisher" A:\\oracle-cert.cer
16+
17+
mkdir /home/vagrant/virtualbox
18+
chown -R vagrant /home/vagrant/virtualbox
19+
20+
# Extract and install
21+
/cygdrive/c/Program\ Files/7-Zip/7z.exe x -y C:\\cygwin\\VBoxGuestAdditions*.iso -ovirtualbox
22+
cmd.exe /c .\\virtualbox\\VBoxWindowsAdditions.exe /S
23+
24+
rm -rf /home/vagrant/VBoxGuestAdditions.iso
25+
rm -rf /home/vagrant/virtualbox
26+
27+
msiexec /qb /x 7z920-x64.msi
28+
rm -rf 7z920-x64.msi
29+
30+
#cmd /c shutdown.exe /r /t 0 /d p:4:1 /c "Vagrant reboot for VBoxWindowsAdditions"
31+
sleep 1

scripts/install-vmware-tools.sh

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
if [ "$PACKER_BUILDER_TYPE" -ne "vmware" ]; then
1+
#!/bin/sh
2+
set -x
3+
4+
if [ "$PACKER_BUILDER_TYPE" != "vmware" ]; then
25
echo "not building vmware, skipping"
36
exit
47
fi

scripts/oracle-cert.cer

1.37 KB
Binary file not shown.

windows_2008_r2.json

+7-2
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,20 @@
3434
"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Vagrant Shutdown\"",
3535
"guest_os_type": "Windows2008_64",
3636
"disk_size": 61440,
37-
"floppy_files": ["./answer_files/2008_r2/Autounattend.xml", "./scripts/install-cygwin-sshd.bat", "./scripts/install-win-updates.ps1"],
37+
"floppy_files": [
38+
"./answer_files/2008_r2/Autounattend.xml",
39+
"./scripts/oracle-cert.cer",
40+
"./scripts/install-cygwin-sshd.bat",
41+
"./scripts/install-win-updates.ps1"
42+
],
3843
"vboxmanage": [
3944
["modifyvm", "{{.Name}}", "--memory", "2048"],
4045
["modifyvm", "{{.Name}}", "--cpus", "2"]
4146
]
4247
}],
4348
"provisioners": [{
4449
"type": "shell",
45-
"scripts": ["./scripts/postinstall.sh", "./scripts/install-vmware-tools.sh", "./scripts/install-chef.sh"]
50+
"scripts": ["./scripts/postinstall.sh", "./scripts/install-vmware-tools.sh", "./scripts/install-virtualbox-tools.sh", "./scripts/install-chef.sh"]
4651
}],
4752
"post-processors": [{
4853
"type": "vagrant",

windows_2012.json

+7-2
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,20 @@
3434
"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Vagrant Shutdown\"",
3535
"guest_os_type": "Windows2012_64",
3636
"disk_size": 61440,
37-
"floppy_files": ["./answer_files/2012/Autounattend.xml", "./scripts/install-cygwin-sshd.bat", "./scripts/install-win-updates.ps1"],
37+
"floppy_files": [
38+
"./answer_files/2012/Autounattend.xml",
39+
"./scripts/oracle-cert.cer",
40+
"./scripts/install-cygwin-sshd.bat",
41+
"./scripts/install-win-updates.ps1"
42+
],
3843
"vboxmanage": [
3944
["modifyvm", "{{.Name}}", "--memory", "2048"],
4045
["modifyvm", "{{.Name}}", "--cpus", "2"]
4146
]
4247
}],
4348
"provisioners": [{
4449
"type": "shell",
45-
"scripts": ["./scripts/postinstall.sh", "./scripts/install-vmware-tools.sh", "./scripts/install-chef.sh"]
50+
"scripts": ["./scripts/postinstall.sh", "./scripts/install-vmware-tools.sh", "./scripts/install-virtualbox-tools.sh", "./scripts/install-chef.sh"]
4651
}],
4752
"post-processors": [{
4853
"type": "vagrant",

0 commit comments

Comments
 (0)