External VNC viewer?

wacked

New Member
Aug 22, 2008
2
0
1
I have Java issues and would like to use an external vncviewer (Win32) to connect to a VM. I tried to connect to VMID 101 with the command line:

vncviewer 192.168.0.60:101

got an connection refused error and turns out that there's not even a VNC server listening (at port 5900). Is is possible to use an extern vnc viewer to connect to the VM's? :confused:
 
no, there is no vnc server listening, but you can start a server with:

Code:
nc -l -p 5900 -c "qm vncproxy VMID PASSWORD"

After that you can connect one time (because PASSWORD is a one time ticket).

- Dietmar
 
I'm also interested in solving that issue.
I've tried the solution above but all I got is: "Not a valid VNC server".

I've tried also to forward a vnc connection from a kvm machine.
I've used socat (piping from /tmp/qemu-server-vnc-ID.socket to tcp socket) and been close to success: vnc viewer saw a server.
But I can not figure out what password should use to authenticate.
BTW "change vnc password" does not work in QM.

Best regards
Pawel
 
OK, that works for kvm, so socat is not needed.
But what to do to get external vnc viewer to work with ovz? The solution above does not work ("Not a valid VNC server").

And just out of curiosity: how to pass authentication when trying to connect to the unix socket: /tmp/qemu-server-vnc-ID.socket?


Best regards
Pawel
 
OK, that works for kvm, so socat is not needed.
But what to do to get external vnc viewer to work with ovz? The solution above does not work ("Not a valid VNC server").

And just out of curiosity: how to pass authentication when trying to connect to the unix socket: /tmp/qemu-server-vnc-ID.socket?


Best regards
Pawel

for openvz container just connect remotely via ssh, why do you want to use vnc here?
 
for openvz container just connect remotely via ssh, why do you want to use vnc here?

I can image such a situation: one can create and start a container from web interface so the container network is not configured yet.
And provided vnc viewer can't be started (e.g. problems w/ java plugin version).

regards
Pawel
 
I can image such a situation: one can create and start a container from web interface so the container network is not configured yet.
And provided vnc viewer can't be started (e.g. problems w/ java plugin version).

regards
Pawel

in such a case connect via ssh to the Proxmox VE and then:

Code:
vzctl enter VMID

the host can access all containers without the need of a running network.
 
no, there is no vnc server listening, but you can start a server with:

Code:
nc -l -p 5900 -c "qm vncproxy VMID PASSWORD"

After that you can connect one time (because PASSWORD is a one time ticket).

- Dietmar
Thanks, works great.

wacked.
 
OK, that works for kvm, so socat is not needed.
But what to do to get external vnc viewer to work with ovz? The solution above does not work ("Not a valid VNC server").

We use vncterm for that:

Code:
vncterm [VNCOPTS] [-c command [ARGS]]
 
#example:
vncterm -c vzctl enter VMID
 
vncterm -rfbport 5900 -passwdfile FILE -timeout 20 -c vzctl enter 104

that way you can proxy any application.

- Dietmar
 
  • Like
Reactions: shaikh
I added this to my /etc/inetd.conf so that I can always connect to my VMs with an external viewer:
9001 stream tcp nowait root /usr/sbin/qm qm vncproxy 101 SecretPassword
9002 stream tcp nowait root /usr/sbin/qm qm vncproxy 102 SecretPassword
9003 stream tcp nowait root /usr/sbin/qm qm vncproxy 103 SecretPassword
9004 stream tcp nowait root /usr/sbin/qm qm vncproxy 104 SecretPassword
9005 stream tcp nowait root /usr/sbin/qm qm vncproxy 105 SecretPassword
9006 stream tcp nowait root /usr/sbin/qm qm vncproxy 106 SecretPassword
9007 stream tcp nowait root /usr/sbin/qm qm vncproxy 107 SecretPassword
9008 stream tcp nowait root /usr/sbin/qm qm vncproxy 108 SecretPassword
 
I added this to my /etc/inetd.conf so that I can always connect to my VMs with an external viewer:
9001 stream tcp nowait root /usr/sbin/qm qm vncproxy 101 SecretPassword
9002 stream tcp nowait root /usr/sbin/qm qm vncproxy 102 SecretPassword
9003 stream tcp nowait root /usr/sbin/qm qm vncproxy 103 SecretPassword
9004 stream tcp nowait root /usr/sbin/qm qm vncproxy 104 SecretPassword
9005 stream tcp nowait root /usr/sbin/qm qm vncproxy 105 SecretPassword
9006 stream tcp nowait root /usr/sbin/qm qm vncproxy 106 SecretPassword
9007 stream tcp nowait root /usr/sbin/qm qm vncproxy 107 SecretPassword
9008 stream tcp nowait root /usr/sbin/qm qm vncproxy 108 SecretPassword
What about that is configurable for my local settings, assuming I use the user 'root' for Proxmox, 'administrator' for all the VMs, and a single password for them all? Also, what would I type into my terminal server client (the app of the same name in Ubuntu) to access the VMs?
 
What about that is configurable for my local settings, assuming I use the user 'root' for Proxmox, 'administrator' for all the VMs, and a single password for them all? Also, what would I type into my terminal server client (the app of the same name in Ubuntu) to access the VMs?

Each line added to the file represents a Proxmox VE virtual machine that you want to be able to connect to externally. In my example 101 through 108.

The first column is the port you want to listen on for a particular VM (penultimate column). That is of course configurable.

The last column is the password you want to use to connect to the VNC server. This has nothing to do with users or passwords on the virtual machine. It's best to think of the VNC server as simply a virtual monitor, keyboard and mouse. Like any monitor keyboard and mouse, the VNC server knows nothing about what OS your running or its users so this password has nothing to do with the users or passwords on your virtual machine. This password is simply used to access the VNC server (as if your keyboard and mouse required a password to use).

Don't use Terminal Server Client for VNC servers. It just runs vncviewer which is really, really slow. Use Vinagre instead which I think is a standard Gnome app. In the "Connect" dialog use the hostname or IP of the Proxmox VE server (not of your VM) and the port for the VM you set up in the inetd.conf file. When it connects Vinagre will ask you for the password for the VNC server which is the one in the inetd.conf file. Once you're connected you will see what you normally would see on a monitor-- a login prompt or login dialog depending on the OS on the VM.

It's worth noting that the OS sees this as its regular monitor and keyboard so if it's configured to blank the screen after a period of inactivity you may need to hit a key to see anything at all.

It's also worth noting that just like a regular monitor, keyboard and mouse the VNC server has no concept of cut and paste. You can't cut something on your local machine running Vinagre and paste it into your VM. You can of course cut and paste entirely within the VM as usual. So if cut and paste is something you need you should use Remote Desktop for Windows virtual machines or some other method for other virtal machines.
 
I added this to my /etc/inetd.conf so that I can always connect to my VMs with an external viewer:
9001 stream tcp nowait root /usr/sbin/qm qm vncproxy 101 SecretPassword
9002 stream tcp nowait root /usr/sbin/qm qm vncproxy 102 SecretPassword
9003 stream tcp nowait root /usr/sbin/qm qm vncproxy 103 SecretPassword
9004 stream tcp nowait root /usr/sbin/qm qm vncproxy 104 SecretPassword
9005 stream tcp nowait root /usr/sbin/qm qm vncproxy 105 SecretPassword
9006 stream tcp nowait root /usr/sbin/qm qm vncproxy 106 SecretPassword
9007 stream tcp nowait root /usr/sbin/qm qm vncproxy 107 SecretPassword
9008 stream tcp nowait root /usr/sbin/qm qm vncproxy 108 SecretPassword

I should have mentioned that I don't think inetd is installed on Proxmox VE by default. So to use this you need to run
apt-get install openbsd-inetd
on the Proxmox VE server as root.
 
Anyone ever try xinetd, since it is already installed in the PVE?

I tried to create a file in /etc/xinetd.d:

service vnc-200
{
socket_type = stream
protocol = tcp
port = 9000
wait = no
user = root
server = /usr/sbin/qm
server_args = vncproxy 200 windowsvnc
}

Then, from a Win box, I try to access the VM via 192.168.x.y:9000, but I get a connection refused.

Any suggestions?
 
There seems to be a confusion about the installed inetd.

By default, we install 'openbsd-inetd'

- Dietmar
 
BTW, I have some java issues as well, but only with one of my recently installed proxmox boxes. I've installed 2 machines, both with the same iso, and one of them works great, but the other one has no java vnc viewer (laptop with ff3, sun's java, ubuntu). Reinstall did nothing. Anyone else has these problems? I can work around them but the java vnc viewer is useful at times.

Thanks
 
I'm also interested in solving that issue.
I've tried the solution above but all I got is: "Not a valid VNC server".

I've tried also to forward a vnc connection from a kvm machine.
I've used socat (piping from /tmp/qemu-server-vnc-ID.socket to tcp socket) and been close to success: vnc viewer saw a server.
But I can not figure out what password should use to authenticate.
BTW "change vnc password" does not work in QM.

Best regards
Pawel

What password are you using to authenticate? I tried the command Tom mentioned, VNCviewer (windows) asks only for a password, I tried with the rootpw, blank, space they all fail and "nc" drops the connection.
 
no, there is no vnc server listening, but you can start a server with:

Code:
nc -l -p 5900 -c "qm vncproxy VMID PASSWORD"
After that you can connect one time (because PASSWORD is a one time ticket).

- Dietmar


This sounds promising, but I get here:

"Not a valid VNC server"

Tried vncviewer and krdc

Any suggestions most appreciated.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!