Vagrant should be in sudoers on that box, but some of them are now provided directly by Ubuntu/Canonical. The issue is that it is prompting for the password of the user "ubuntu" not for the vagrant user's password. Its likely that your display manager hides the vagrant user or has it connected to another account that isn't the correct UID, or more likely that the graphical gksu gksudo commands don't honor passwordless sudo.
One issue I've found with many boxes is they are managing the vagrant user directly into /etc/sudoers instead of doing it the smart way as you have in putting it in /etc/sudoers.d so that it doesn't get clobbered by system updates. On Friday, April 1, 2016 at 8:30:17 AM UTC-5, Valentin Nastasache wrote: > > It seems the vagrant user is not added to sudoers on the official Vagrant > ubuntu/trusty boxhttps://atlas.hashicorp.com/ubuntu/boxes/trusty64 > > > The fix was to add these lines as inline shell provisioning: > > # provision > config.vm.provision :shell, inline: <<-SHELL > # Set up sudo > echo 'vagrant ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/vagrant > chmod 0440 /etc/sudoers.d/vagrant > # Setup sudo to allow no-password sudo for "sudo" > usermod -a -G sudo vagrant > SHELL > > > > On Friday, 1 April 2016 13:25:27 UTC+2, Valentin Nastasache wrote: >> >> Hi, >> >> I have a vagrant project, provisioned with ansible. >> >> For ssh settings I use: >> >> config.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'" >> config.ssh.forward_agent = true >> config.ssh.forward_x11 = true >> >> >> The problem is that I start the VM with GUI >> vb.gui = true >> have installed with ansible lightdm-gtk-greeter-settings, >> >> https://github.com/valentin-nasta/development-environment/blob/master/playbooks/roles/desktop/tasks/main.yml#L14 >> >> but I'm asked for ubuntu's user password instead of the vagrant user. >> >> >> This is the problem I'm trying to solve. >> >> >> As a workaround (as I didn't know the ubuntu's user password), I logged >> into the vm and change it manually. >> vagrant ssh >> sudo passwd ubuntu >> But still I would like to know the secret behind. >> >> Here is my Vagrantfile >> >> https://github.com/valentin-nasta/development-environment/blob/master/Vagrantfile >> >> Kind regards, >> Valentin >> >> >> -- This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list. GitHub Issues: https://github.com/mitchellh/vagrant/issues IRC: #vagrant on Freenode --- You received this message because you are subscribed to the Google Groups "Vagrant" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/ffaab83b-c641-4697-93be-b05adb8d6d67%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
