[英]How to ssh to a KVM guest VM without accessing the host?
I have set up a VM and the VM is accessible from the host through the SSH also.我已经设置了一个 VM,并且还可以通过 SSH 从主机访问该 VM。
The host has a public IP and accessible through SSH.主机有一个公共 IP,可通过 SSH 访问。 the guest VM can access the internet like pinging to google is working with the bridge connectivity.
来宾虚拟机可以访问互联网,就像 ping 到谷歌正在使用网桥连接。
For example: the host IP is ( xxx.xxx.xxx.xxx) The vm IP is ( 192.168.yyy.yyy)例如:主机 IP 是(xxx.xxx.xxx.xxx) vm IP 是(192.168.yyy.yyy)
Is it possible to SSH the VM without accessing the host from a different network?是否可以在不从其他网络访问主机的情况下对 VM 进行 SSH ?
As explained here , you find out an IP address of Linux KVM guest from Linux host itself正如这里所解释的,您可以从 Linux 主机本身找到 Linux KVM 来宾的 IP 地址
$ virsh list
$ virsh domifaddr rhel7
But that does require access to the host.但这确实需要访问主机。
You would need to configure libvirt, which comes with its own in-build DNS server, dnsmasq , as explained in " Automated DNS resolution for KVM/libvirt guests with a local domain " from Roland Wolters in order to reference the guest VM directly, through a FQDN, instead of an internal IP address you cannot have without host access.您需要配置 libvirt,它带有自己的内置 DNS 服务器dnsmasq ,如Roland Wolters的“ 具有本地域的 KVM/libvirt 来宾的自动 DNS 解析”中所述,以便直接引用来宾 VM,通过一个 FQDN,而不是内部 IP 地址,如果没有主机访问权限,您将无法拥有。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.