3

I have the following details:

Vagrant File:

Vagrant.configure("2") do |config|
 config.vm.box = "Precise32"
 config.vm.box_url = "http://files.vagrantup.com/precise32.box"
 config.vm.synced_folder "./Public","/var/www/",create:true
 config.vm.network :private_network, ip: "192.168.55.55"
 config.vm.provision :shell, :path => "setup.sh"
end

Shell File:

   sudo apt-get -y update
   sudo apt-get install apache2 php5 libapache2-mod-php5 
   sudo sudo apachectl restart

  The shell is s little limited but i want to get it to work first before i attempt all the other php stuff etc


  The error i get starts here:

  Do you want to continue [Y/n]? Abort.
  The following SSH command responded with a non-zero exit status.
  Vagrant assumes that this means the command failed!

  chmod +x /tmp/vagrant-shell && /tmp/vagrant-shell

  Stdout from the command:

then continues with trying to get or hit files

  Fetched 3,018 kB in 4s (681 kB/s)
  Reading package lists...
  Reading package lists...
  Building dependency tree...
  Reading state information...
  The following extra packages will be installed:
    apache2-mpm-worker apache2-utils apache2.2-bin apache2.2-common libapr1
    libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap ssl-cert
  Suggested packages:
    www-browser apache2-doc apache2-suexec apache2-suexec-custom
    openssl-blacklist
  The following NEW packages will be installed:
    apache2 apache2-mpm-worker apache2-utils apache2.2-bin apache2.2-common
    libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap ssl-cert
  0 upgraded, 10 newly installed, 0 to remove and 155 not upgraded.
  Need to get 1,845 kB of archives.
  After this operation, 5,314 kB of additional disk space will be used.
  Do you want to continue [Y/n]? Abort.


  Stderr from the command:

  stdin: is not a tty

i have even tried:

   config.vm.network :forwarded_port, host: 3003, guest: 3000

And thats it failure, althought when i do go to localhost:3000 or that i get:

   SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1
   Protocol mismatch.

I am on a MAC OSX 10.8.5

also the sections where it say Do you want to continue [Y/n]?

i don't get to choose it automatically does this for me.

Simon Davies
  • 3,668
  • 9
  • 41
  • 69
  • 9
    Can you try adding a '-y' to apt-get install? like: sudo apt-get -y install apache2 php5 libapache2-mod-php5 to overcome the 'Do you want to continue [Y/n]'? – nikhil Oct 18 '13 at 19:16
  • @nikhil thanks for this i have replicated it on my mac at home and it seems to have worked, but will also give it ago on the works machine on monday and let you now proper but so place it as an answer. It installed php 5.3 really need it to use php 5.5 but thats another quest. thanks – Simon Davies Oct 18 '13 at 19:37
  • @SimonDavies if this solved your problem, could you include (and accept) it as an answer? This will help future visitors of this Q. – BrianC Aug 05 '14 at 19:17
  • possible duplicate of [Answering prompt using vagrant file?](http://stackoverflow.com/questions/23974081/answering-prompt-using-vagrant-file) – kryger Mar 25 '15 at 10:27

1 Answers1

1

Can you try adding a '-y' to apt-get install? like: sudo apt-get -y install apache2 php5 libapache2-mod-php5 to overcome the 'Do you want to continue [Y/n]'? - nikhil

hrishikeshp19
  • 8,838
  • 26
  • 78
  • 141