2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

pcakerで`virtualbox-iso: sudo: sorry, you must have a tty to run sudo`が出る

Posted at

packerでbuild時にvirtualbox-iso: sudo: sorry, you must have a tty to run sudoがでた時の備忘録です。

configファイルのbuildersセクションに以下を追加すると解決。

"ssh_pty" : "true"

以下利用しているbuildersセクション

  "builders":[{
    "type": "virtualbox-iso",
    "guest_os_type": "RedHat_64",
    "iso_url": "http://ftp.iij.ad.jp/pub/linux/centos/6.7/isos/x86_64/CentOS-6.7-x86_64-minimal.iso",
    "iso_checksum": "9381a24b8bee2fed0c26896141a64b69",
    "iso_checksum_type": "md5",
    "ssh_username": "vagrant",
    "ssh_password": "vagrant",
    "ssh_wait_timeout": "3000s",
    "vm_name": "box",
    "http_directory": "./",
    "boot_wait": "30s",
    "boot_command":[
      "<esc><wait>",
      "linux ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ks.cfg ",
      "<enter><wait>"
    ],
    "shutdown_command": "echo 'vagrant' | sudo -S shutdown -P now",
    "ssh_pty" : "true"
  }],

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?