Open ZimmerHao opened 8 months ago
I'm getting this too with a Debian guest.
Did you manage to fix/work around it?
Seeing this as well:
OS: 14.2.1
Vagrant: 2.4.0
Provider: vmware fusion 13
Vagrant Plugin: vagrant-vmware-desktop (3.0.3, global)
Same problem here:
OS: 14.1
Vagrant: 2.4.0
Provider: vmware fusion 13.5
Vagrant Plugin: vagrant-vmware-desktop (3.0.3, global)
The author of the vagrant box answered somewhere else, that it is a known problem (=>https://superuser.com/questions/1813100/vagrant-up-fails-with-vmware-provider/1814380), suggesting that it's not a big deal, as vagrant ssh
works. For some use cases hover, proper networking is essential. Sadly I was not able to find further information about that known issue or any workaround...
So I was running into this same issue and figured it out (in my case). The smoking gun was
stderr: sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
from vagrant up --debug
logs. This told me that the box I was using did not have passwordless sudo correctly configured for the vagrant user. https://developer.hashicorp.com/vagrant/docs/boxes/base#password-less-sudo
Lucky for me I was building my own base box via packer. So in my case the issue was a bug in my preseed file (debian OS). Here is a link to the fix for those that are interested https://github.com/hashicorp/packer-plugin-vmware/pull/141/files#diff-6989dfb636a06edede23b1cfeaead81bff0e5d8df739889695b65cbdbc8dcc45L104-L107
For others being effected by this I would try running your vagrant up
with the debug flag. Look carefully through the logs for the instance of something like
INFO ssh: Execute: /sbin/ip -o -0 addr | grep -v LOOPBACK | awk '{print $2}' | sed 's/://' (sudo=true)
The following line should be the real reason that errored. If you see this
DEBUG ssh: stderr: sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
Then you are likely dealing with the same issue I had, a misconfigured base box. If you control the base box double check you are giving vagrant
passwordless sudo if not make an issue with the box author
When execute
vagrant up
, getting this errorOS:
13.5.1 (22G90)
\ Vagrant:2.4.0
\ Provider:vmware fusion 13
\ Vagrant Plugin:vagrant-vmware-desktop (3.0.3, global)
Debug output
Expected behavior
Running
Actual behavior
Output error
Reproduction information
Vagrant version
2.4.0
Host operating system
macOS Ventura 13.5.1
Guest operating system
Centos 9
Steps to reproduce
vagrant up --provider vmware_desktop
Vagrantfile