How to use ssh agent forwarding with “vagrant ssh”?

I’m using vagrant 2 on OS X Mountain Lion. Vagrant.configure(“2”) do |config| config.ssh.private_key_path = “~/.ssh/id_rsa” config.ssh.forward_agent = true end config.ssh.private_key_path is your local private key Your private key must be available to the local ssh-agent. You can check with ssh-add -L, if it’s not listed add it with ssh-add ~/.ssh/id_rsa Don’t forget to add you … Read more

How to export a Vagrant virtual machine to transfer it

You have two ways to do this, I’ll call it dirty way and clean way: 1. The dirty way Create a box from your current virtual environment, using vagrant package command: http://docs.vagrantup.com/v2/cli/package.html Then copy the box to the other pc, add it using vagrant box add and run it using vagrant up as usual. Keep … Read more

A VirtualBox machine with the name ‘homestead’ already exists

I solved by using vboxmanage to get the ID of the VM. $ vboxmanage list vms “my-vm” {c700b8b6-b766-4638-871b-736b44b7db18} Copy the ID of the desired VM (the c700…db18 string) into the contents of ~/.vagrant/machines/default/virtualbox/id. Save the file then run vagrant up to get the vm working without having to destroy it.

Vagrant reverse port forwarding?

When you run vagrant ssh, it’s actually using this underlying command: ssh -p 2222 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=ERROR -o IdentitiesOnly=yes -i ~/.vagrant.d/insecure_private_key vagrant@127.0.0.1 SSH supports forwarding ports in the direction you want with the -R guestport:host:hostport option. So, if you wanted to connect to port 12345 on the guest and have it forwarded … Read more

Vagrant Not Starting Up. User that created VM doesn’t match current user

I ran into the same problem today. I edited my UID by opening the file .vagrant/machines/default/virtualbox/creator_uid and changing the 501 to a 0. After I saved the file, the command vagrant up worked like a champ. NB: the .vagrant folder is in the same directory as your Vagrantfile, where you ran vagrant up

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)