Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vagrant becoming root on login stalls vagrant-hostmanager #221

Open
Eimert opened this issue Jan 7, 2017 · 1 comment
Open

vagrant becoming root on login stalls vagrant-hostmanager #221

Eimert opened this issue Jan 7, 2017 · 1 comment

Comments

@Eimert
Copy link

Eimert commented Jan 7, 2017

Issue
Vagrant is stuck at the step '==> buildserver: Updating /etc/hosts file on active guest machines...'.

Cause
I added echo "sudo -i" >> /home/vagrant/.bashrc to my provisioner script. My aim is to become root after login. It seems that the vagrant-hostmanager plugin cannot handle this (yet); After removing the sudo -i line, vagrant works just fine.

Tried a workaround
Putting the vagrant-hostmanager plugin as the last step didn't work either, because I have three machines and the plugin cannot update the /etc/hosts file on the first machine (since that machine does a sudo -i on login).

Reproduction
The issue can be reproduced by doing a vagrant up on the attached Vagrantfile and provisioner script.

vagrant-hostmanager-issue.zip

@Eimert
Copy link
Author

Eimert commented Jan 24, 2017

Possible fix: adding sudo -i to $HOME/.bash_profile, since that file is only loaded on interactive logins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant