QEMU KVM VNC support

27,135

Solution 1

VNC support should be available by default. So as you said there may be a problem in firewall or qemu/libvirt configuration.

Regarding qemu by default it only accepts local vnc connections. To change that edit /etc/libvirt/qemu.conf:

vnc_listen = "0.0.0.0"

This will enable connections from all hosts, which depending what you are trying to do can be very dangerous. In that file you can find more info on how to secure things up.

Also, if you use libvirt I think it also only accepts local connections by default. To enable remote access edit /etc/libvirt/libvirtd.conf:

listen_tcp = 1

The same security concerns regarding qemu apply here. See how to secure the connection if needed here.

As a last resort check if the ports used by vnc and libvirt are open. In the case you are using ufw:

sudo ufw status verbose

Solution 2

KVM (QEMU) has a built-in VNC server, and it works by default. It can be enabled in several ways. If you want a graphical tool, use virt-manager.

VNC

HOWEVER, IMO there is a better option, use the SPICE package.

The SPICE server is much faster.

Ubuntu wiki spice - https://wiki.ubuntu.com/spice

I use SPICE on Fedora, sorry about that. For Ubuntu see:

Getting SPICE working in Ubuntu 12.04.1-LTS

For a nice demo see:

http://www.montanalinux.org/fedora-virt-preview-f15-virt-manager-spice.html

Yes, it is a bit dated and for Fedora, but I use SPICE with my Ubuntu guests, and it works fine.

Share:
27,135

Related videos on Youtube

Tim Nieland
Author by

Tim Nieland

Updated on September 18, 2022

Comments

  • Tim Nieland
    Tim Nieland almost 2 years

    Do I need to install a special package to get the VNC support?

    I installed:

    sudo apt-get install kvm qemu-kvm qemu-kvm-extras
    

    Everything works fine. I only get no VNC server up and running, although it's configured for the VM.

    Maybe this is a firewall problem since I can connect locally.

    • geethujoseph
      geethujoseph over 11 years
      Are you using plain qemu/kvm or libvirt?
    • Tim Nieland
      Tim Nieland over 11 years
      qemu-kvm + libvirt for controll
  • Tim Nieland
    Tim Nieland over 11 years
    il try that as soon as possible thx so far
  • Tim Nieland
    Tim Nieland over 11 years
    vnc config already looks that way - think i have to try out salems idea to maybe enable remote access in general
  • Tim Nieland
    Tim Nieland over 11 years
    thx very much worked out for me atm, have to check which security issues i accept in order to get my vnc working