Score:0

VNC Connects to VM, not Host

uy flag

Running KVM on 20.04.2 LTS; I have two VMs running. When I use VNCViewer from a Windows box and connect to the IP of the KVM Host, I see a terminal window to one of the two VMs, NOT the host - any ideas appreciated.

Nate T avatar
it flag
What port are you trying to use?
Score:0
it flag

There are a few solutions to your dilemma. Your VM likely has its port forwarded to the router in NAT mode. In other words, the port you are accessing currently belongs to the VM. To make the two endpoints separate, you can either change the port of the application you are trying to reach on the local (and make sure that port is accessible at the router). Also, you could stop forwarding the VM. This means it wont be accessible. Finally, you can bridge the VM. This method is described below.

In order to give your virtual machine its own IP address, and thereby distinguish it from the host, you can configure it to use a bridged network.

By default, Most VM software uses NAT networking to "hide" the VMs from outside connections. With NAT, the VM is accessed via the address of its network. In your case, the port of the VM is probably forwarded, so it sorta takes over the network, or at least that port

However, If you switch to bridged mode, your VM will use its own IP, and will therefore be accessed via a completely different channel from its host. The process for changing the IP networking mode is dependant on the VM software atop which your VMs are running.

Here is a tutorial for changing it inside VMWare and Virtualbox. It also provides more detailed info on the subject, so you will be able to find it if you are using a different VM software.

The linked article does this for a different purpose, but the process is the same. The result will be 2 (or 3) separate IP adresses and no confusion.

If you find that you are in bridged mode already, then you are using the wrong IP. Try accessing the localhost via the router's IP.

By the way, the other methods mentioned at the beginning are also in the article. At least they should make more sense now.

Nate T avatar
it flag
To everyone else, did I get anything wrong? IT isn't my day job. XD Just saw the KVM. Never used it but the process should be the same as the others mentioned above.
Nate T avatar
it flag
For the second option in the 1st paragraph, youll need to change the port in the KVM host.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.