1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

External VNC viewer?

Discussion in 'Proxmox VE 1.x: Installation and configuration' started by wacked, Aug 22, 2008.

  1. wacked

    wacked New Member

    Joined:
    Aug 22, 2008
    Messages:
    2
    Likes Received:
    0
    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:
     
  2. dietmar

    dietmar Proxmox Staff Member
    Staff Member

    Joined:
    Apr 28, 2005
    Messages:
    14,169
    Likes Received:
    69
    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
     
  3. pjo

    pjo New Member

    Joined:
    Aug 20, 2008
    Messages:
    13
    Likes Received:
    0
    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
     
  4. pjo

    pjo New Member

    Joined:
    Aug 20, 2008
    Messages:
    13
    Likes Received:
    0
    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
     
  5. tom

    tom Proxmox Staff Member
    Staff Member

    Joined:
    Aug 29, 2006
    Messages:
    11,012
    Likes Received:
    49
    for openvz container just connect remotely via ssh, why do you want to use vnc here?
     
  6. pjo

    pjo New Member

    Joined:
    Aug 20, 2008
    Messages:
    13
    Likes Received:
    0
    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
     
  7. tom

    tom Proxmox Staff Member
    Staff Member

    Joined:
    Aug 29, 2006
    Messages:
    11,012
    Likes Received:
    49
    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.
     
  8. wacked

    wacked New Member

    Joined:
    Aug 22, 2008
    Messages:
    2
    Likes Received:
    0
    Thanks, works great.

    wacked.
     
  9. dietmar

    dietmar Proxmox Staff Member
    Staff Member

    Joined:
    Apr 28, 2005
    Messages:
    14,169
    Likes Received:
    69
    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
     
  10. pjo

    pjo New Member

    Joined:
    Aug 20, 2008
    Messages:
    13
    Likes Received:
    0
    Great! It works much faster. Thanks a lot.
    BTW Where I can learn more about vncterm? Its man page is not informative very much ;)
     
  11. dietmar

    dietmar Proxmox Staff Member
    Staff Member

    Joined:
    Apr 28, 2005
    Messages:
    14,169
    Likes Received:
    69
  12. clipcarl

    clipcarl New Member

    Joined:
    Jul 1, 2008
    Messages:
    17
    Likes Received:
    0
    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
     
  13. djbon2112

    djbon2112 New Member

    Joined:
    Sep 18, 2008
    Messages:
    12
    Likes Received:
    0
    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?
     
  14. clipcarl

    clipcarl New Member

    Joined:
    Jul 1, 2008
    Messages:
    17
    Likes Received:
    0
    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.
     
  15. clipcarl

    clipcarl New Member

    Joined:
    Jul 1, 2008
    Messages:
    17
    Likes Received:
    0
    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.
     
  16. alphadog

    alphadog Member

    Joined:
    Nov 5, 2008
    Messages:
    46
    Likes Received:
    0
    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?
     
  17. dietmar

    dietmar Proxmox Staff Member
    Staff Member

    Joined:
    Apr 28, 2005
    Messages:
    14,169
    Likes Received:
    69
    There seems to be a confusion about the installed inetd.

    By default, we install 'openbsd-inetd'

    - Dietmar
     
  18. Neoscopio

    Neoscopio New Member

    Joined:
    Mar 31, 2009
    Messages:
    13
    Likes Received:
    0
    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
     
  19. Giovanni

    Giovanni Member

    Joined:
    Apr 1, 2009
    Messages:
    35
    Likes Received:
    0
    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.
     
  20. DaveQB

    DaveQB Member

    Joined:
    Apr 14, 2009
    Messages:
    40
    Likes Received:
    0

    This sounds promising, but I get here:

    "Not a valid VNC server"

    Tried vncviewer and krdc

    Any suggestions most appreciated.
     

Share This Page