• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Raspberry Pi running a VNC server

    Blog entry posted in 'Uncategorised', January 05, 2013.

    Yes, i kinda skipped ahead of the web server article. I just set my Pi up with a VNC server, so i can work with a more manageable screen resolution (which will help with the previously mentioned problem of having part of the TOR setup window of Vidalia missing off the bottom of the screen. First, install Tightvnc server on the Pi (in a root terminal):

    Code:

    apt-get install tightvncserver


    then assign a password by running
    Code:
    vncserver

    and answer the password prompts.

    Then on your "work" computer, install a vnc viewer (my Slackware linux box already has KRDC installed on it). For Windows users, you can download TightVnc from http://www.tightvnc.com/download-old.php (the older version on this page is FREE, and is close to the version of vnc on the PI, which will avoid any compatibility issues with widely mismatched versions).

    shut down the root instance of vncserver on the Pi:
    Code:
    vncserver -kill :1

    then open a user terminal on the pi and run vncserver as the "pi" user:
    Code:
    vncserver :1


    on your "work" computer, open a vnc viewer, and when it asks for an address, put in the IP address of the Pi, and put the port number :5901 at the end of the address (the Pi for some reason chose port 5901, and not 5900, which caused me a bit of a headache...)
    for instance:
    Code:
    192.168.0.25:5901


    you will then be prompted for the password, and you should (after about 10 seconds or so) see a screen:69592


    If you can't connect, you can retrieve the port number from the log in the .vnc directory on the pi, where the log says something like:
    Code:
    Listening for VNC connections on TCP port 5901


    Once it is working, you are remote controlling your Pi from another computer. Don't use this connection for watching movies, as the network bandwidth and server overhead will make it look jerky and simply awful. What shows on the remote display is NOT the same as what's on the "local" display of the PI. If you have apps running, that you opened through the remote window, and you disconnect from the remote connection, the apps will not appear on the local display. you will have to log back on to the remote display to control them (such as closing them etc...).

    If you want to reduce the network and CPU overhead of running the remote connection, and don't mind the loss of video quality, you can select the slowest speed connection. This allows for quicker action, for instance when you click on something, and, with the higher bit rate connections, you would have to wait a second or two before something happens. With the low speed connection, it actually speeds up the rate at which the remote desktop image updates.

    Comments
    unclejed613, January 05, 2013
    one very cool side effect of running the VNC server, is that if i have a TV hooked up to the PI, and i open a terminal window (on the remote screen on your "work" computer) and type [CODE]omxplayer name-of-movie-file[/CODE] the Pi will play the movie on the GPU hardware (not on the remote screen), which means it will show up on the TV. this acts like a remote controlled media player. mplayer and vlc will NOT do this, but will play on the remote screen (and bog down your network in the process, especially if, like me you are hosting the video files on your "work" computer). putting the video files on the SD card of the Pi is not a good idea, since the SD hardware will bog down a bit while playing video.
 

EE World Online Articles

Loading

 
Top