Search code examples
vagrantbigdataapache-stormvagrant-plugin

How create an ssh connection from vagrant to a specific virtual machine? Can I create a connection to a VM installed on WMware?


I am absolutly new in Vagrant and in Apache Storm.

I am following an online course where show the following situation.

1) There is an Ubuntu virtual machine installed on Virtual Box 2) On the physic machine (the same where is installed Virtual Box and that run the Ubuntu VM) it is installed Vagrant

Ok, from the physic machine, it log into the virtual machine using this statment:

vagrant ssh

and show that it is created a connection to the installed Ubuntu VM.

Here the first doubt: how it know what is the exact virtualized system? What happen if I have installed more than one VM on Virtual Box (with the previous command it is not specified to what installed VM have to be connected)

Another doubt is: I don't use Virtual Box but I use WMware workstation? How can I use the vagrand ssh command to create a connection to a specific VM installed on my WMware workstation?


Solution

  • I'd try to answer a few points from your question -

    First, in vagrant language the physic machine will be the host and the VM is called the guest (or guest VM)

    Vagrant knows how to connect to the VM it did create as it maintains the Id of the created VM into a .vagrant directory where you have initialized the Vagrantfile.

    You can run vagrant global-status and you will have an output with all the VMs that vagrant managed along with the Id, Name and Provider information.

    The provider can be VirtualBox or VMWare or anything else. The same in the .vagrant directory you will have subdirectory for the provider (e.g. a directory .vagrant/machines/default/virtualbox or .vagrant/machines/default/vmware_xxx) by default vagrant will start the Virtualbox provider but you can specify the --provider=XXX option when setting up the VM for the 1st time and then vagrant will create the VM for this specific provider and further command on this VM (ssh, reload ...) will work on this specific provider.