title: Packer build fails due to tty needed for sudo
body: <p>My packer build is failing with the following message:</p>
  
  <pre><code>sudo: sorry, you must have a tty to run sudo.
  </code></pre>
  
  <p>My host is Windows 8 with vagrant and virtualbox, my guest is centos7.
  On researching it is my understanding that not requiring tty for sudo is the reason for the message. But I have the following in <code>ks.cfg</code>:</p>
  
  <pre><code>sed -i 's/^.*requiretty/#Defaults requiretty/' /etc/sudoers
  </code></pre>
  
  <p>Could the issue be that there's something I need to set on the windows vagrant ssh side so that a psuedo-tty is created?</p>
  
  <p>This is my first go at packer.</p>
  
  <p>I am using a packer build that I downloaded.</p>
  
  <p>packer.json below:</p>
  
  <pre><code>{
    "variables": {
      "version": "{{env `VERSION`}}"
    },
    "provisioners": [
      {
        "type": "shell",
        "execute_command": "sudo {{.Vars}} sh {{.Path}}",
        "scripts": [
          "scripts/vagrant.sh",
          "scripts/vmtools.sh",
          "scripts/cleanup.sh",
          "scripts/zerodisk.sh"
        ]
      }
    ],
    "post-processors": [
      {
        "type": "vagrant",
        "output": "INSANEWORKS-CentOS-7.0-x86_64-{{user `version`}}-{{.Provider}}.box"
      }
    ],
    "builders": [
      {
        "type": "virtualbox-iso",
        "iso_url": "http://ftp.iij.ad.jp/pub/linux/centos/7/isos/x86_64/CentOS-7-x86_64-NetInstall-1503.iso",
        "iso_checksum": "498bb78789ddc7973fe14358822eb1b48521bbaca91c17bd132c7f8c903d79b3",
        "iso_checksum_type": "sha256",
        "ssh_username": "vagrant",
        "ssh_password": "vagrant",
        "ssh_wait_timeout": "45m",
        "ssh_disable_agent": "true",
        "boot_command": [
          "&lt;tab&gt; text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ks.cfg&lt;enter&gt;&lt;wait&gt;"
        ],
        "disk_size": "40000",
        "hard_drive_interface": "sata",
        "guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso",
        "guest_additions_sha256": "7b61f523db7ba75aebc4c7bb0cae2da92674fa72299e4a006c5c67517f7d786b",
        "guest_os_type": "RedHat_64",
        "headless": "true",
        "http_directory": "http",
        "shutdown_command": "sudo /sbin/halt -p",
        "vboxmanage": [
          [ "modifyvm", "{{.Name}}", "--memory", "1024" ],
          [ "modifyvm", "{{.Name}}", "--cpus", "1" ]
        ]
      }
    ]
  }
  </code></pre>
  
  <p>Thanks in advance.</p>