
Title
Create new category
Edit page index title
Edit category
Edit link
Enabling VNC on Existing KVM Instances
This article outlines the steps needed to enable VNC on existing virtual machines.
KVM
Step 1 - Shutdown the Instance
SSH into the host where the virtual machine of interest resides. To shut down the virtual machine gracefully, invoke the following command on the terminal:
xxxxxxxxxxvirsh shutdown test-vmwhere test-vm is the name of the virtual machine.
Check to see if the instance is in the shut off state by invoking the following:
xxxxxxxxxxvirsh list --allYou may also SSH into the instance and power off the instance from the terminal.
If all else fails, you may want to shutdown the instance ungracefully.
This is the equivalent of pulling the power cord
xxxxxxxxxxvirsh destroy test-vmStep 2 - Edit the Virtual Machine's XML Configuration
After verifying that the instance is shut off, open the instance's XML configuration:
xxxxxxxxxxvirsh edit test-vmAdd the following inside the <devices> element:
It should look similar to this:
xxxxxxxxxx<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' keymap='en-us'> <listen type='address' address='127.0.0.1'/> </graphics>Step 3 - Start the Instance
Start the instance after saving the configuration:
xxxxxxxxxxvirsh start test-vmTo verify whether the configuration succeeded, run the following on the terminal:
xxxxxxxxxxvirsh vncdisplay test-vmYou should see something similar to this:
xxxxxxxxxxroot@localhost:~# virsh vncdisplay test-vm127.0.0.1:0