1

How can I ssh a virtual machine from another virtual machine?

I am using KVM-libvirt and Vagrant to create these VMs, if this helps.

My host machine is Ubuntu desktop 16.

Please help me with exact commands how can I achieve this?

  • It depends what network you have configured between these machines. But usually you just need to connect to its IP. – Jakuje Apr 14 '17 at 8:24
0

You should setup private network in your Vagrant file for this virtual machines.

For example:

Vagrant.configure("2") do |config|
  config.vm.define "openvpn" do |openvpn|
    openvpn.vm.box = "centos/7"
    openvpn.vm.network "private_network", ip: "192.168.50.11"                                                                                          
  end

  config.vm.define "client" do |client|
    client.vm.box = "centos/7"
    client.vm.network "private_network", ip: "192.168.50.12"                                                                                            
  end
end

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.