Vagrant box: can’t login with password from VirtualBox GUI

UPDATE after clarification of question

You should be able to login as

user: vagrant
password: vagrant 

This is a convention described in the base box creation documentation:

Also, even though Vagrant uses key-based authentication by default, it
is a general convention to set the password for the “vagrant” user to
“vagrant”. This lets people login as that user manually if they need
to.

If you have a box where the password for the vagrant user is not set (or you just don’t know it) you can do the following:

me@somebox$ vagrant ssh
vagrant@vagrant-ubuntu-trusty-64:~$ sudo passwd vagrant 
Enter new UNIX password: <type invisible new password here>
Retype new UNIX password: <re-type invisible new password here>
passwd: password updated successfully

Now you can login e.g. through the VirtualBox GUI.

Original answer (basically explaining that you should not have to do the above)

The basic idea is, that you do not have to use the Virtual machine providers tools for anything to work with vagrant. So as soon as you think you have to use the VirtualBox GUI you are doing something wrong.

Just try in terminal (or in cmd.exe if you are on windows):

me@somebox$ vagrant init ubuntu/trusty64
me@somebox$ vagrant up
me@somebox$ vagrant ssh
vagrant@vagrant-ubuntu-trusty-64:~$

If everything works you should be on the command line inside your new machine logged in as the user vagrant.

Leave a Comment