vssh icon indicating copy to clipboard operation
vssh copied to clipboard

when mutlitple vm are declared, doing `vssh` try to connect to box named "default"

Open allan-simon opened this issue 7 years ago • 4 comments

though there's no such boxes with this name

I think it's because vagrant ssh is able to parse the primary: true

config.vm.define "dev", primary: true do |app|

and vagrant ssh-config should put an alias "default" in its output

allan-simon avatar Feb 15 '18 21:02 allan-simon

Just ran into this too. But seeing how the ssh line is built up within the vssh shell script was enough to let me roll my own. Very handy to know how to get the benefits of vagrant up and related commands without the penalty of two or more seconds for every ssh to the vm if one is willing to call ssh directly with the vagrant config file. Thanks.

FrankReh avatar Feb 03 '19 18:02 FrankReh

@FrankReh If convenient, could you share with us what you've came up with ? thank you :)

allan-simon avatar Feb 03 '19 21:02 allan-simon

@allan-simon I don't know ruby and just took the lesson from vssh about how to call ssh directly with the arguments relevant to my situation. So I call ssh passing the .vagrant config file and by using the complete path to the config file, I can call a shell alias or shell script without regard to the current working directory.

$ ssh -F ~/path/to/.vagrant/ssh_config $hostname

FrankReh avatar Feb 05 '19 21:02 FrankReh