I am using Vagrant to deploy VMs for development. One of the requirements is that vagrant provision creates a new user (done in a provisioning script I wrote)
EDIT
Was too fast to answer without trying it out first. The code in the link below may have worked in previous versions, however in 1.7.2 it will not work; You need to tweak it a bit:
Vagrant.configure("2") do |config|
if ARGV[0] == "ssh"
config.ssh.username = 'other_username'
end
...
end
original answer below
Came here looking for an answer to the same question but none of existing ones were quite satisfying, so with a bit more digging I found this comment on github about how you could go around for your requirements:
Vagrant.configure("2") do |config|
if VAGRANT_COMMAND == "ssh"
config.ssh.username = 'other_username'
end
...
end
You just check if the vagrant command you're issuing is ssh then it will use the username you specified.