Skip to content

Instantly share code, notes, and snippets.

@mattupstate
Created September 3, 2013 20:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mattupstate/6429333 to your computer and use it in GitHub Desktop.
Save mattupstate/6429333 to your computer and use it in GitHub Desktop.
Ubuntu 12.04 VirtualBox Packer example
{
"provisioners": [
{
"type": "shell",
"scripts": [
"scripts/base.sh",
"scripts/vagrant.sh",
"scripts/virtualbox.sh",
"scripts/ruby.sh",
"scripts/chef.sh",
"scripts/cleanup.sh",
"scripts/zerodisk.sh"
],
"override": {
"virtualbox": {
"execute_command": "echo 'vagrant'|sudo -S sh '{{.Path}}'"
}
}
}
],
"builders": [
{
"type": "virtualbox",
"boot_command": [
"<esc><esc><enter><wait>",
"/install/vmlinuz noapic preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg <wait>",
"debian-installer=en_US auto locale=en_US kbd-chooser/method=us <wait>",
"hostname={{ .Name }} <wait>",
"fb=false debconf/frontend=noninteractive <wait>",
"keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA keyboard-configuration/variant=USA console-setup/ask_detect=false <wait>",
"initrd=/install/initrd.gz -- <enter><wait>"
],
"boot_wait": "4s",
"disk_size": 10140,
"guest_os_type": "Ubuntu_64",
"http_directory": "http",
"iso_checksum_type": "md5",
"iso_url": "http://releases.ubuntu.com/12.04/ubuntu-12.04.3-server-amd64.iso",
"iso_checksum": "2cbe868812a871242cdcdd8f2fd6feb9",
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_port": 22,
"ssh_wait_timeout": "10000s",
"shutdown_command": "echo 'shutdown -P now' > shutdown.sh; echo 'vagrant'|sudo -S sh 'shutdown.sh'",
"guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso",
"virtualbox_version_file": ".vbox_version",
"vboxmanage": [
[
"modifyvm",
"{{.Name}}",
"--memory",
"512"
],
[
"modifyvm",
"{{.Name}}",
"--cpus",
"1"
]
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment