Starting VNC through Putty SSH

Posted on 2011-10-09
Last Modified: 2012-05-12
When I start a VNC Session after creating an SSH Tunnel using Putty, I am not getting the GUI as expected but rather an X-Window with a command prompt.

My procedure:
- Launch Putty and login as root.  Then type vncserver.  Returns the hostname:1.  Then I close Putty.
- Launch Putty with SSH Tunnels Port set ot 5901 and Destination set to localhost:5901
- Finally I launch VNC with hostname:1. When I log in with root and password, I receive the command prompt instead of the GUI

Question by:orther
    LVL 9

    Accepted Solution

    I don't know which OS you are running specifically but I would request you to the following steps:

    1. Login using SSH
    2. Check for ~username/.vnc folder
    3. In the .vnc folder you should have a file named xstartup -> This file carries configuration for your GUI Display
    4. You might find a commented line similar to  following

    #exec /etc/X11/xinit/xinitrc

    5. Uncomment these lines and restart vncserver

    You should see a normal desktop now.

    If you still face any issues, please post the contents of .vnc folder/xstartup file

    Hope this helps!

    Author Closing Comment

    If you are using webmin this file is located in /root/.vnc.  From there you can edit per the instructions above.

    Thanks for your help.
    LVL 9

    Expert Comment

    It is important to note that Webmin also allows you to login using different users, so the path would be depend you the logged on user and its mapping in Webmin.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    In this tutorial I will explain how to make squid prevent malwares in five easy steps: Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more. It reduces bandwidth and improves response times by caching and reusing frequently-…
    Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
    Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
    Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now