[libvirt] ssh from host to guest on default network

Kay Williams Kay at thewilliams.net
Tue May 31 03:28:42 UTC 2011


Hello,

I am looking for an reliable, scriptable method to 1) install a kvm guest using the default network and 2) ssh from the host to the guest to perform machine maintenance (e.g. yum update).

Ideally, this would be done by providing a host name for the guest during install (e.g. virt-install  --name <myname> ...), and then by ssh'ing to the machine using the provided hostname (e.g. ssh <myname>) and a username/password or preconfigured certificate.

The trouble I am having is with ssh'ing from the host to guest machine.


1.       I can't (easily) use the guest hostname, as the host isn't automatically configured to resolve guest names.

2.       I can't (easily) use the guest IP address (e.g. read from /var/lib/libvirt/dnsmasq/default.leases), as the IP addresses are dynamic and can change when the guest is reinstalled (which I am doing a fair amount, at least in testing).

3.       I can't (easily) assign the guest a static IP address, as the default network configuration assumes all IP addresses in the range can be dynamically allocated, and thus a  statically assigned IP might conflict.

I can work around these issues in a variety of unfortunate ways.  But I wonder if there is something elegant I am missing.

If not, this would be a very nice feature for the future....

Thanks,
Kay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110530/e62d7dd3/attachment-0001.htm>


More information about the libvir-list mailing list