18.2. Remote management over TLS and SSL

18.2. Remote management over TLS and SSL

You can manage virtual machines using TLS and SSL. TLS and SSL provides greater scalability but is more complicated than ssh (see Section 18.1, “Remote management with ssh. TLS and SSL is the same technology used by web browsers for secure connections. The libvirt management connection will open a TCP port for incoming connections, which is securely encrypted and authenticated based on x509 certificates. In addition the VNC console for each guest virtual machine will be setup to use TLS with x509 certificate authentication.

Using this method you will not need to give users shell accounts on the remote machines being managed. However, extra firewall rules are needed to access the management service or VNC console. Certificate revocation lists can be used to revoke access to users.

Steps to setup TLS/SSL access for virt-manager

The following short guide assuming you are starting from scratch and you do not have any TLS/SSL certificate knowledge. If you are lucky enough to have a certificate management server you can probably skip the first steps.

libvirt server setup

The libvirt website has a walk-through on creating certificates, and placing them in the corrRefer to http://libvirt.org/remote.html

The Red Hat Virtualization VNC Server

The Red Hat Virtualization VNC server can have TLS enabled by editing the configuration file, /etc/xen/xend-config.sxp. Remove the commenting on the (vnc-tls 1) configuration parameter in the configuration file.

The /etc/xen/vnc directory needs the following 3 files:

  • ca-cert.pem - The CA certificate

  • server-cert.pem - The Server certificate signed by the CA

  • server-key.pem - The server private key

This provides encryption of the data channel. It might be appropriate to require that clients present their own x509 certificate as a form of authentication. To enable this remove the commenting on the (vnc-x509-verify 1) parameter.

virt-manager and virsh client setup

The setup for clients is slightly inconsistent at this time. To enable the libvirt management API over TLS, the CA and client certificates must be placed in /etc/pki. For details on this consult http://libvirt.org/remote.html

In the virt-manager user interface, use the 'SSL/TLS' transport mechanism option when connecting to a host.

For virsh, the qemu://hostname.domainname/system or xen://hostname.domainname/ URIs should be used.

To enable SSL and TLS for VNC, it is necessary to put the certificate authority and client certificates into $HOME/.pki, that is the following three files:


Note: This documentation is provided {and copyrighted} by Red Hat®, Inc. and is released via the Open Publication License. The copyright holder has added the further requirement that Distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. The CentOS project redistributes these original works (in their unmodified form) as a reference for CentOS-5 because CentOS-5 is built from publicly available, open source SRPMS. The documentation is unmodified to be compliant with upstream distribution policy. Neither CentOS-5 nor the CentOS Project are in any way affiliated with or sponsored by Red Hat®, Inc.