Configure VNC passwords
To manage access to the graphical output of a virtual machine (VM), you can configure a password for the VNC console of the VM.
Before you begin
- The VM that you want to protect with a VNC password has VNC graphics configured.
To ensure that this is the case, use the
virsh dumpxmlcommand as follows:# virsh dumpxml <vm-name> | grep graphics<graphics type='vnc' ports='-1' autoport='yes' listen='127.0.0.1'> </graphics>
About this task
With a VNC password configured on a VM, users of the VMs must enter the password when attempting to view or interact with the VNC graphical console of the VMs, for example by using the virt-viewer utility.
VNC passwords are not a sufficient measure for ensuring the security of a VM environment. For details, see QEMU documentation on VNC security.
In addition, the VNC password is saved in plain text in the configuration of the VM, so for the password to be effective, the user must not be able to display the VM configuration.
Procedure
Results
- Start the modified VM.
# virsh start <vm_name> - Open a graphical console of the VM, for example by using the
virt-viewerutility:# virt-viewer <vm-name>If the VNC password has been configured properly, a dialog window is displayed that requests you to enter the password.