I'm using vagrant/VirtualBox on my Window (8.1) Laptop to start up a linux-test-vm from a Cygwin terminal... vagrant up
, vagrant ssh
, everything is working fine.
Now I want to work on that environment remotely from my main Linux-Workstation, so I've set up sshd
in Cygwin and I can successfully ssh into my Windows-Box (same user as logged in locally in windows).
But when I cd
'ed (via my remote ssh connection to windows-laptop) in my working directory and ran vagrant ssh
, it tells me:
VM must be created before running this command. Run 'vagrant up' first
But I see the VM is running in VirtualBox GUI on Windows.
From this point on even locally on the Windows machine I can no longer interact with the running vagrant vm and the .vagrant
(sub)directory has not files inside.
Same happens vice versa:
- I stopped/deleted the VM in VirtualBox GUI
- ran
vagrant up
via my ssh connection ... worked - ran
vagrant ssh
via my ssh connection ... works - but I do not see the VM in VirtualBox GUI on Windows
- trying
vagrant ssh
locally on Windows ... same error again and.vagrant
directory gets cleared
So I assume the Cygwin/sshd connection creates some sort of different Sessions that do not share the same "instance" of VirtualBox.
Is there any chance to share VirtualBox/vagrant environment between the local Windows and remote ssh session ???
WORKAROUND:
- export ssh-config on the windows host:
vagrant ssh-config > ssh_config
- from the cygwin/ssh jump into the VM:
ssh -F ssh_config default
- never run any
vagrant
command from the cygwin/ssh connection