Connecting to KVM VM via VNC

AndreiG. asked:

I just installed KVM on centos 6.5 and after I created a VM I don’t know how to access via VNC.

I used this command to create the VM:

virt-install --name=guest_name --arch=x86_64 --vcpus=2 --ram=5120 --os-type=linux --os-variant=rhel5 --hvm --connect=qemu:///system --network bridge:br0 --cdrom=/var/lib/libvirt/images/CentOS-6.5-x86_64-minimal.iso --disk path=/home/guest_name.img,size=80 --accelerate --vnc

What to do next?

My answer:

The easy way to do this is to run virt-manager on your desktop and set it up with a remote ssh connection to the hypervisor, the server running your new virtual machine.

The hard way to do this is by running virsh vncdisplay guest_name on the server. This will give you VNC connection information. But, you may find this unusable as it may only be bound to, or firewalled.

View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.