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 GUIhave installed with ansible lightdm-gtk-greeter-settings,
vb.gui = true
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.
vagrant ssh
sudo passwd ubuntu
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 vagrantSHELL