I have created a new CentOS Linux release 7.2.1511 (Core) box by VirtualBox and Vagrant also I have followed the proper steps to create it
"Vagrant up" and "vagrant ssh" commands are working properly but when I try to "vagrant halt" I got the following error:
The following SSH command responded with a non-zero exit status. Vagrant assumes that this means the command failed!
shutdown -h now
Stdout from the command:
Stderr from the command:
sudo: no tty present and no askpass program specified
When I go in to the box by "vagrant ssh" command and run the "shutdown -h now" command I have been asked for the vagrant user password:
[hww_vagrant@centos7x64 ~]$ shutdown -h now ==== AUTHENTICATING FOR org.freedesktop.login1.power-off === Authentication is required for powering off the system. Authenticating as: hww_vagrant Password:
It shouldn't ask me as I have add the following row on sudoers file:
hww_vagrant ALL=(ALL) NOPASSWD: ALL
, and also I have commented the following row on sudoers file too:
Defaults requiretty
Here is the problem....as I have been asked for password when vagrant user tries to power off the box when I try to run "vagrant halt" it fails.
I think it should works with my configuration but still asking me the password for powering off the box by "vagrant" user...Does anybody what is happening?
Thanks!
shutdown -h now
it can ask you but if you dosudo shutdown -h now
it should be ok ? - Frederic Henri