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?

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

1 Answer 1

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .