如何从其他虚拟机ssh虚拟机?


1

如何从其他虚拟机ssh虚拟机?

我正在使用KVM-libvirt和Vagrant来创建这些VM,如果这有帮助的话。

我的主机是Ubuntu桌面16。

请帮我准确的命令如何实现这一目标?


这取决于您在这些计算机之间配置的网络。但通常你只需要连接到它的IP。
Jakuje

Answers:


0

您应该在Vagrant文​​件中为此虚拟机设置专用网络

例如:

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
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.