Skip to content
This repository has been archived by the owner on Oct 4, 2019. It is now read-only.

Commit

Permalink
Merge pull request #2 from dylanmei/vbox_guest_additions
Browse files Browse the repository at this point in the history
VirtualBox builders install VBoxGuestAdditions
  • Loading branch information
Joe Fitzgerald committed Sep 19, 2013
2 parents c7446a4 + 00965a4 commit 8f98d8e
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
/iso/*
!/iso/README.md
/output-vmware/
/output-virtualbox/
/*.box
/packer_cache/
5 changes: 3 additions & 2 deletions scripts/install-puppet.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/bin/sh
set -x

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

sleep 1
31 changes: 31 additions & 0 deletions scripts/install-virtualbox-tools.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/sh
set -x

if [ "$PACKER_BUILDER_TYPE" != "virtualbox" ]; then
echo "not building virtualbox, skipping"
exit
fi

# 7zip will allow us to extract a file from an ISO
wget http://downloads.sourceforge.net/sevenzip/7z920-x64.msi
msiexec /qb /i 7z920-x64.msi

# There needs to be Oracle CA (Certificate Authority) certificates installed in order
# to prevent user intervention popups which will undermine a silent installation.
cmd /c certutil -addstore -f "TrustedPublisher" A:\\oracle-cert.cer

mkdir /home/vagrant/virtualbox
chown -R vagrant /home/vagrant/virtualbox

# Extract and install
/cygdrive/c/Program\ Files/7-Zip/7z.exe x -y C:\\cygwin\\VBoxGuestAdditions*.iso -ovirtualbox
cmd.exe /c .\\virtualbox\\VBoxWindowsAdditions.exe /S

rm -rf /home/vagrant/VBoxGuestAdditions.iso
rm -rf /home/vagrant/virtualbox

msiexec /qb /x 7z920-x64.msi
rm -rf 7z920-x64.msi

#cmd /c shutdown.exe /r /t 0 /d p:4:1 /c "Vagrant reboot for VBoxWindowsAdditions"
sleep 1
5 changes: 4 additions & 1 deletion scripts/install-vmware-tools.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
if [ "$PACKER_BUILDER_TYPE" -ne "vmware" ]; then
#!/bin/sh
set -x

if [ "$PACKER_BUILDER_TYPE" != "vmware" ]; then
echo "not building vmware, skipping"
exit
fi
Expand Down
Binary file added scripts/oracle-cert.cer
Binary file not shown.
9 changes: 7 additions & 2 deletions windows_2008_r2.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,20 @@
"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Vagrant Shutdown\"",
"guest_os_type": "Windows2008_64",
"disk_size": 61440,
"floppy_files": ["./answer_files/2008_r2/Autounattend.xml", "./scripts/install-cygwin-sshd.bat", "./scripts/install-win-updates.ps1"],
"floppy_files": [
"./answer_files/2008_r2/Autounattend.xml",
"./scripts/oracle-cert.cer",
"./scripts/install-cygwin-sshd.bat",
"./scripts/install-win-updates.ps1"
],
"vboxmanage": [
["modifyvm", "{{.Name}}", "--memory", "2048"],
["modifyvm", "{{.Name}}", "--cpus", "2"]
]
}],
"provisioners": [{
"type": "shell",
"scripts": ["./scripts/postinstall.sh", "./scripts/install-vmware-tools.sh", "./scripts/install-chef.sh"]
"scripts": ["./scripts/postinstall.sh", "./scripts/install-vmware-tools.sh", "./scripts/install-virtualbox-tools.sh", "./scripts/install-chef.sh"]
}],
"post-processors": [{
"type": "vagrant",
Expand Down
9 changes: 7 additions & 2 deletions windows_2012.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,20 @@
"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Vagrant Shutdown\"",
"guest_os_type": "Windows2012_64",
"disk_size": 61440,
"floppy_files": ["./answer_files/2012/Autounattend.xml", "./scripts/install-cygwin-sshd.bat", "./scripts/install-win-updates.ps1"],
"floppy_files": [
"./answer_files/2012/Autounattend.xml",
"./scripts/oracle-cert.cer",
"./scripts/install-cygwin-sshd.bat",
"./scripts/install-win-updates.ps1"
],
"vboxmanage": [
["modifyvm", "{{.Name}}", "--memory", "2048"],
["modifyvm", "{{.Name}}", "--cpus", "2"]
]
}],
"provisioners": [{
"type": "shell",
"scripts": ["./scripts/postinstall.sh", "./scripts/install-vmware-tools.sh", "./scripts/install-chef.sh"]
"scripts": ["./scripts/postinstall.sh", "./scripts/install-vmware-tools.sh", "./scripts/install-virtualbox-tools.sh", "./scripts/install-chef.sh"]
}],
"post-processors": [{
"type": "vagrant",
Expand Down

0 comments on commit 8f98d8e

Please sign in to comment.