Skip to content

Instantly share code, notes, and snippets.

@gabriel403
Created November 6, 2013 10:07
Show Gist options
  • Save gabriel403/7333708 to your computer and use it in GitHub Desktop.
Save gabriel403/7333708 to your computer and use it in GitHub Desktop.
{
"builders": [{
"type" : "virtualbox",
"iso_url" : "http://releases.ubuntu.com/12.10/ubuntu-12.10-server-amd64.iso",
"iso_checksum" : "4bd3270bde86d7e4e017e3847a4af485",
"iso_checksum_type" : "md5",
"disk_size" : 80000,
"guest_os_type" : "Ubuntu_64",
"http_directory" : "preseed",
"ssh_username" : "vagrant",
"ssh_password" : "vagrant",
"output_directory" : "ubuntu_quantal_64_basebox_virtualbox",
"boot_command" : [
"<esc><esc><enter><wait>",
"/install/vmlinuz noapic ",
"preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ",
"debian-installer=en_GB auto locale=en_GB kbd-chooser/method=uk ",
"hostname={{ .Name }} ",
"fb=false debconf/frontend=noninteractive ",
"keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=GB ",
"keyboard-configuration/variant=GB console-setup/ask_detect=false ",
"initrd=/install/initrd.gz -- <enter>"
],
"vboxmanage" : [
["modifyvm", "{{.Name}}", "--memory", "1024"]
],
"shutdown_command" : "echo 'shutdown -P now' > shutdown.sh; echo 'vagrant'|sudo -S sh 'shutdown.sh'"
}],
"provisioners" : [{
"type": "shell",
"execute_command": "echo 'vagrant' | sudo -S sh '{{ .Path }}'",
"inline": [
"apt-get update -y",
"apt-get install -y linux-headers-$(uname -r) build-essential dkms puppet-common nfs-kernel-server nfs-common",
"apt-get clean",
"mount -o loop VBoxGuestAdditions.iso /media/cdrom",
"sh /media/cdrom/VBoxLinuxAdditions.run",
"umount /media/cdrom",
"mkdir ~/.ssh",
"wget -qO- https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub >> ~/.ssh/authorized_keys",
"echo 'vagrant ALL=NOPASSWD:ALL' > /tmp/vagrant",
"chmod 0440 /tmp/vagrant",
"mv /tmp/vagrant /etc/sudoers.d/"
]
}],
"post-processors" : [
{
"type" : "vagrant",
"keep_input_artifact": true,
"only" : ["virtualbox"]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment