Skip to content

Instantly share code, notes, and snippets.

@dypsilon
Created September 27, 2014 04:15
Show Gist options
  • Save dypsilon/a72f28628544413ff3df to your computer and use it in GitHub Desktop.
Save dypsilon/a72f28628544413ff3df to your computer and use it in GitHub Desktop.
Result of the vagrant research

Vagrant

packer.json

{
  "builders": [
    {
      "boot_command": [
        "<esc><wait>",
        "<esc><wait>",
        "install<wait>",
        " auto",
        " console-setup/ask_detect=false",
        " console-setup/layoutcode=us",
        " console-setup/modelcode=pc105",
        " debconf/frontend=noninteractive",
        " debian-installer=en_US",
        " fb=false",
        " initrd=initrd.gz",
        " kbd-chooser/method=us",
        " keyboard-configuration/layout=USA",
        " keyboard-configuration/variant=USA",
        " locale=en_US",
        " netcfg/get_domain=vm",
        " netcfg/get_hostname=vagrant",
        " noapic",
        " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ubuntu-14.04/preseed.cfg",
        " -- ",
        "<enter><wait>"
      ],
      "boot_wait": "5s",
      "disk_size": 40960,
      "guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso",
      "guest_os_type": "Ubuntu_64",
      "http_directory": "http",
      "iso_checksum": "e1e074b4302898698977c08013e0afe5c06245e2",
      "iso_checksum_type": "sha1",
      "iso_url": "http://archive.ubuntu.com/ubuntu/dists/trusty/main/installer-amd64/current/images/netboot/mini.iso",
      "output_directory": "packer-ubuntu-14.04-amd64-virtualbox",
      "shutdown_command": "echo 'vagrant'|sudo -S shutdown -P now",
      "ssh_password": "vagrant",
      "ssh_port": 22,
      "ssh_username": "vagrant",
      "ssh_wait_timeout": "10000s",
      "type": "virtualbox-iso",
      "vboxmanage": [
        [
          "modifyvm",
          "{{.Name}}",
          "--memory",
          "384"
        ],
        [
          "modifyvm",
          "{{.Name}}",
          "--cpus",
          "1"
        ]
      ],
      "virtualbox_version_file": ".vbox_version",
      "vm_name": "packer-ubuntu-14.04-amd64"
    }
  ],
  "post-processors": [
    {
      "output": "../builds/{{.Provider}}/u1404.box",
      "type": "vagrant"
    }
  ],
  "provisioners": [
    {
      "execute_command": "echo 'vagrant'|{{.Vars}} sudo -S -E bash '{{.Path}}'",
      "scripts": [
        "scripts/common/sshd.sh",
        "scripts/ubuntu/networking.sh",
        "scripts/ubuntu/sudoers.sh",
        "scripts/common/vagrant.sh",
        "scripts/common/vmtools.sh",
        "scripts/ubuntu/cleanup.sh",
        "scripts/common/minimize.sh"
      ],
      "type": "shell"
    }
  ]
}

preseed.cfg

d-i base-installer/kernel/override-image string linux-server
d-i clock-setup/utc boolean true
d-i clock-setup/utc-auto boolean true
d-i finish-install/reboot_in_progress note
d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean true
d-i partman-auto-lvm/guided_size string max
d-i partman-auto/choose_recipe select atomic
d-i partman-auto/method string lvm
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman-lvm/device_remove_lvm boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
d-i partman/confirm_write_new_label boolean true
d-i passwd/user-fullname string vagrant
d-i passwd/user-uid string 900
d-i passwd/user-password password vagrant
d-i passwd/user-password-again password vagrant
d-i passwd/username string vagrant
d-i pkgsel/include string openssh-server
d-i pkgsel/install-language-support boolean false
d-i pkgsel/update-policy select unattended-upgrades
d-i pkgsel/upgrade select full-upgrade
d-i time/zone string UTC
d-i user-setup/allow-password-weak boolean true
d-i user-setup/encrypt-home boolean false
tasksel tasksel/first multiselect standard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment