I’m trying to run a Qemu VM installation on a headless remote server running openSUSE Leap 42.1. However, I’m never able to connect to the VM with a remote client; I’ve ensured that VNC gets bound to 0.0.0.0 and even disabled the firewall, but the connection always just times out.
Here’s an example command that I’m trying to run (after creating disk.img):
Thinking about it more, I’m sure this has to be a problem with the server being headless. Installing Qemu brought in some X dependencies, but none of them are being used by the system. Using VNC should make X unnecessary, right?
First, of course you need to verify basic network connectivity.
Then, installing VNC in your VM should be no different than installing on bare metal, the opensuse community docs has a good guide, read it and be sure you understand how vnc server is implemented which may be different than what you may have experienced before
Installing VNC in openSUSE should <always> be done using the YaST Remote Administration module, it will install all the dependencies you need including an xorg x-server. Nowadays, modern Linux architectures will often <not> install an xorg x-server for local use, but these new implementations don’t usually support remote access yet (which is why you need to install).
Otherwise, properly configured the VNC server has little to do with whether your HostOS is a headless install because your VM should be its own isolated and completely self-contained machine, not dependent on what is in the HostOS (unless you do something like pass-through). Or, as I’ve explained even if your VM is “headless.”
You need to fix your networking, I don’t see anything I recognize in your command that invokes your VM specifying how your networking should be configured. If you installed KVM/QEMU completely and follow standard configurations, you should be making use of configured Linux Bridge Devices.
What guide are you following creating and invoking your QEMU VMs?
FYI - some resources to invoke your qemu VM correctly and manage
Note that I’m pointing you to SLES documentation, which is perfectly fine and should work without any alterations (except maybe invoke images other than SLES by default)
Pay close attention to the VNC server configuration file used nowadays, it defines the Guest configurations that are enabled.
In other words, if you’re used to defining options in your VNC connection other than an address and a port, you need to update your knowledge.