Select Page

vnc4server is a remote desktop management utility, allowing remote access to the KDE GUI on your Debian System.

Connections can be established from any machine running a supported client, from anywhere you can get an internet connection.

Installing vnc4server will prove very useful when the troubleshooting, support or remote access is needed.

  1. At the Debian/GNU w/ KDE Welcome Screen, chose the “Menu” option in the lower left part of the screen.
  2. In the Menu chose the “Console Login” option. (You Can also simply click ALT+N from the Debian GNU/Linux w/ KDE Welcome Screen, in place of the first two steps in this section. This is a shortcut to the Console or “CONSOLE MODE”.)
  3. At the Login prompt type: “root” and hit the [enter] key.
  4. Type in the Password of the “root” user and hit the [enter] key. You would have set this password up during installation. See our Installing Debian 4 on a PC guide.
  5. Then you will type the following code:
    test:~# apt-get update
    then press the [enter] key. This will download the latest, most up to date installation packages. Do not try to continue until it has completed the package header downloads.
  6. Once all the package headers have been downloaded, type:
    test:~# apt-get install vnc4server
    then press the [enter] key. This will install the vnc4server packages. You will be get a prompt about being sure. Hit the “Y” key and press the [enter] key to continue. When the installation has completed you will be returned to the # command prompt.
  7. Next, type:
    test:~# vnc4server –geometry 1024x768 –depth 24 –name test
    then hit the [enter] key. You will be prompted to enter and confirm a password. (This password will be used to access the desktop of this machine remotely.) Once the password has been entered and verified you will have successfully launched the vnc4server on your system, and will be returned to the # command prompt.
  8. We will now kill the vnc4server process by typing:
    test:~# vnc4server –kill :1
    then hit the [enter] key. This will terminate the vnc session you just started, leaving you at the # command prompt. Now type:
    test:~# cp /root/.vnc/xstartup /root/.vnc/xstartup_old
    then hit the [enter] key. This will create a backup “_old” of the xstartup file in case you need it later. (The “xstartup” file may be located in the /$USER/.vnc/xstartup directory or in the /root/.vnc/xstartup directory. The location of this will depend on whether the installation is done from within the KDE GUI and which user is logged in at the time of the installation, or if the installation is performed from the command console, as the “root” user.
  9. To verify that the backup was created successfully, type:
    test:~# dir /root/.vnc/
    and make sure you have both a “xstartup” and “xstartup_old” file displayed. (If you do not have both files, check the prior steps and try it again.
  10. Next, we will edit the “xstartup” file by typing:
    test:~# pico /root/.vnc/xstartup
    then hit the [enter] key. This will launch the NANO editor in order to edit the xstartup file. Delete everything in this file using the delete button on your keyboard. Once the page is blank, type in the following lines exactly as I have them listed below:
    #!/bin/sh
    #Uncomment the following two lines for normal desktop:
    #unset SESSION_MANAGER
    # exec /etc/X11/xinit/xinitrc [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources xsetroot -solid grey vncconfig -iconic -nowin &
    #x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
    #x-window-manager & startkde &
  11. Hold down the CTRL key and press the “X” key. This will ask you if you want to save the file. If you have finished these edits press the “Y” key.
  12. You will then be prompted to enter a path to save the file. Leave the default path and file in place and hit the [enter] key. You will then be returned to the # command prompt.
  13. Congratulations, Your Debian System is now Running vnc4server!
  14. If you know how to create scripts and you want to make your vnc4server run as a service that starts with the system when it is turned on, you can complete the next “OPTIONAL” identified step. Otherwise skip past the “OPTIONAL” step to continue.
  15. BEGINNING OF OPTIONAL STEP: You may want to make your vnc4server start up with you server automatically, each time you have to reboot it. You can do this by creating a script “/etc/init.d/vnc4server” as shown below:
    test:~# update-rc.d vnc4server defaults 20
    to add to the startup commands.
    test:~# shutdown now –r
    then hit the [enter] key, telling your system to reboot. Once the system reboots the Debian/GNU w/ KDE Welcome Screen. You need to switch back to the console mode and log in as the “root” user. ENDING OF OPTIONAL STEP
  16. At the console # command prompt…
    test:~# vnc4server –geometry 1024x768 –depth 24 –name test
    then hit the [enter] key. This will re-launch a VNC session called “test”.
  17. Once the new vnc4server session has been launched you will be sent back to the # command prompt. Type:
    test:~# exit
    then hit the [enter] key to log out of the console.

Additional information, codes and commands can be found at https://www.vnc.com/products/free/4.1/

You may want to read the article found here for more information related to configuring vnc4server to start automatically.


UPDATE: This post is old and has been modified for use in new WordPress Theme Designs. In some cases, Categories, Tags and/or the actual Content has been modified. Content found in this post may be dated and irrelevant and should be used with caution. This post may be original to this site or may have come from one of many other WordPress-powered websites I’ve run since 2008. All previous websites have been shuttered; though new ones may pop up in the future.