QEMU KVM VNC support
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.
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.
Related videos on Youtube
Tim Nieland
Updated on September 18, 2022Comments
-
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 over 11 yearsAre you using plain qemu/kvm or libvirt?
-
Tim Nieland over 11 yearsqemu-kvm + libvirt for controll
-
-
Tim Nieland over 11 yearsil try that as soon as possible thx so far
-
Tim Nieland over 11 yearsvnc config already looks that way - think i have to try out salems idea to maybe enable remote access in general
-
Tim Nieland over 11 yearsthx very much worked out for me atm, have to check which security issues i accept in order to get my vnc working