Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Advertise on LowEndTalk.com
How to Install VNC w/ GNOME on Debian VPS
New on LowEndTalk? Please read our 'Community Rules' by clicking on it in the right menu!

How to Install VNC w/ GNOME on Debian VPS

vps6netvps6net Member
edited January 2012 in Tutorials

VNC is a remote desktop sharing system that will allow you to connect your home PC to a GUI (graphical interface) hosted on your VPS, for easy remote management. This guide will walk you through the steps required to setup and access a VNC server hosted on a Debian VPS.

Before beginning, ensure you are logged in to your VPS as the root user, and run the following:

# apt-get update
# apt-get upgrade

  1. Install GNOME:

# apt-get install gnome-desktop-environment

  1. Install required fonts:

# apt-get install xfonts-100dpi
# apt-get install xfonts-100dpi-transcoded
# apt-get install xfonts-75dpi
# apt-get install xfonts-75dpi-transcoded
# apt-get install xfonts-base

  1. Install TightVNCServer:

# apt-get install tightvncserver

  1. Start TightVNCServer for the first time, it will copy config files and prompt you for a password:

# tightvncserver :1

  1. Stop the VNC server, so we can continue to configure it:

# tightvncserver -kill :1

  1. Edit the xstartup file:

# vi ~/.vnc/xstartup

Press "A" to enter edit mode. Replace the contents of the file with the following (or edit to match):

# !/bin/shxrdb $HOME/.Xresources
xsetroot -solid grey
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
# x-window-manager &
gnome-session &

Press ESC, type :wq, then press enter to save and close the file.

  1. Start the VNC server with your desired resolution:

# tightvncserver -geometry 1024x768 :1

You can now access your server's remote GNOME desktop with a desktop VNC client. Enter your server's main IP address, Port 1 (or 5901, alternately), and the password you set earlier to connect to the desktop.

Rewritten from the VPS6.NET Knowledgebase: https://vps6.net/my/knowledgebase/52/How-to-Install-VNC-wor-GNOME-on-Debian-or-Ubuntu-VPS.html

Thanked by 3yomero DanielM seikan

VPS6.NET, LP - http://vps6.net - Xen PV, HVM, Windows VPS hosting in USA, DE, RO, and TR.

Comments

  • ZettaZetta Member
    edited January 2012

    apt-get install gnome-core tightvncserver
    Wow, I've been doing it so wrong...

    When you find that perfect VPS, KEEP IT.

  • Well, maybe @Zetta is being sarcastic? :P

    Yes, gnome-core ftw

  • lxde-common

    Thanked by 1tux
  • Thanks for the guide!

    Hobby Projects: DNMin | PingBear

  • Those fonts aren't actually required. I never have a problem with any of my servers that use VNC on debian without those fonts installed.

    Stargaze - Lightspeed Beyond. Stargaze Minecraft Join Today. Vanilla Forums included.
  • @Zetta and @yomero -- Admittedly, gnome-core is probably the 'better' (more robust) package to install, but I included gnome-desktop-environment since we usually end up installing the extra packages for clients, anyway!

    VPS6.NET, LP - http://vps6.net - Xen PV, HVM, Windows VPS hosting in USA, DE, RO, and TR.

  • fanfan Member

    Well, for a high latency network like US-CN, I prefer the Windows Remote Desktop and NX over the laggy VNC. But RDP is only for Windows and it's painful to configure NX in Debian/Ubuntu. Still finding an alternative. :(

  • Why would it be painful to configure NX on Debian/Ubuntu? Just downloads the .deb files and dpkg -i them?

    -

  • fanfan Member

    @rds100 said: Why would it be painful to configure NX on Debian/Ubuntu? Just downloads the .deb files and dpkg -i them?

    That never worked for me actually, I confirmed it's running and the port is open, but I couldn't get it work like what I did in CentOS.

  • just forward the x session ? ive never had a problem with that

  • @rds100 said: Why would it be painful to configure NX on Debian/Ubuntu? Just downloads the .deb files and dpkg -i them?

    where do you find that deb? project debs from freenx seemed dead to me :(

    @exussum said: just forward the x session ? ive never had a problem with that

    how do you do that then?

    Check my blog for more cool *nix tips & tricks!

  • if your on Windows install xming
    http://sourceforge.net/projects/xming/

    on your VPS install xserver-xorg-core though the package manager

    in Putty click SSH then x11 then enable x11 forwarding.

    Now just start up the GUI app - eg firefox and you have a firefox window on the PC running putty thats being run on the server. Minimal resources needed

    if your running linux then just use -X when logging in

  • @vps6net said: VNC is a remote desktop sharing system that will allow you to connect your home PC to a GUI (graphical interface) hosted on your VPS, for easy remote management.

    I applaud the effort you made for this but I don't really understand the purpose.

    Assuming the VPS is a lowendbox, and is used for web/mail hosting, where are the GUI tools for managing:

    • Nginx, Apache
    • MySQL, PostgreSQL
    • PHP config
    • Sendmail, Exim, Postfix, Dovecot configurations & users
    • Log files - rotation, management, searching, etc.

    Now I'm a Linux GUI neophyte, but as far as I can tell those GUI tools don't exist. Or they exist in web-based format which doesn't require the overhead of a GUI on the server. Which makes me ask, what's the purpose of establishing a VNC connection to a GUI on my server?

  • @sleddog, You're right, there really wouldn't be a reason to setup VNC on a web/mail hosting server; perhaps I overlooked the most common uses of LEBs. There are many ways you could make use of a remote desktop on a small VE, though... app development, remote administration (for the less technically inclined), or running a Windows desktop client via Wine are uses I see frequently.

    VPS6.NET, LP - http://vps6.net - Xen PV, HVM, Windows VPS hosting in USA, DE, RO, and TR.

  • @vps6net: thanks for that. Honestly I wasn't being critical :) Guess I'm just focused on the hosting side of things.

    I wish you all the best with your company.

  • @sleddog Thanks! :) But you're right, VNC doesn't have many hosting applications (aside from file hosting, perhaps). It's just fun!

    VPS6.NET, LP - http://vps6.net - Xen PV, HVM, Windows VPS hosting in USA, DE, RO, and TR.

  • @vps6net said: hanks! :) But you're right, VNC doesn't have many hosting applications (aside from file hosting, perhaps). It's just fun!

    It is indeed. I use VNC to connect from my Linux desktop to a headless WinXP box that manages my webcam (bloody propriety capture card drivers).

  • @vps6net I followed the setup process (created this to run multiple times for testing https://gist.github.com/4011035) but after installation ram usage is 100MB something, after a reboot its back to 7MB; whats wrong?

    @Zetta said: apt-get install gnome-core tightvncserver

    That was easy, thanks

    @yomero said: Yes, gnome-core ftw

    true

    @karl said: lxde-common

    Ehhhh!! ????

  • @Asim Vnc isnt running when you restarted the VPS.

  • Why not use XRDP? saves you the hassle of installing a VNC client on windows / mac, since you can connect via RDP. Also, GNOME is RAM hungry, why not xfce, razor-qt or lxde?

    Quis custodiet ipsos custodes?
    https://raymii.org - https://cipherli.st
  • @Raymil any guides you know of / can recommend showing XRDP with lxde or other light weight GUI's ?

  • @vps6net
    Very nice and I appreciate your contribution to this forum.

    I can use this tutorial to create a bash script for autoinstallation?

    Dewlance
  • I prefer Xfce :)

    sudo apt-get update sudo apt-get install xfce4 xfce4-goodies vnc4server xinetd vnc4server vnc4server -kill :1 rm ~/.vnc/xstartup wget -O ~/.vnc/xstartup http://ompldr.org/vZzVzZw sudo chmod 755 /etc/X11/xinit/xinitrc vnc4server

  • akzakz Member

    complete newb here trying to learn ubuntu after I installed the vnc server and login all I see is a blank screen with an X is that normal?

  • jarjar Provider

    @akz said: complete newb here trying to learn ubuntu after I installed the vnc server and login all I see is a blank screen with an X is that normal?

    Run: vncserver - kill :1
    Run: nano ~/.vnc/xstartup
    Add without quotations: "gnome-session &"
    Press: control+x, y, enter
    Run: vncserver

    Make sure you're not using Ubuntu 12.10 also. No Unity 2D.

    MagicSpam blackmails providers into buying their software, and ServerHub is a professional spam organization.

  • akzakz Member
    edited March 2013

    @jarland said: Run: vncserver - kill :1

    Run: nano ~/.vnc/xstartup
    Add without quotations: "gnome-session &"
    Press: control+x, y, enter
    Run: vncserver
    Make sure you're not using Ubuntu 12.10 also. No Unity 2D.

    nice it works I followed the steps above and wasnt familiar with vi nano was much better I guess the changes didnt take when I did it in vi. But now it says "Failed to load session "ubuntu". Did I miss something more? Thanks jarland.

    nevermind fixed it instead of using "gnome-session &" use "gnome-session --session=gnome-classic &"

  • jarjar Provider

    @akz said: Thanks jarland.

    No problem. Let me know if you need any tips. I'm a big fan of Ubuntu over VNC on a VPS.

    MagicSpam blackmails providers into buying their software, and ServerHub is a professional spam organization.

  • I'm doing this using xrdp and standard gnome desktop. It's exceptionally laggy... Is that the xrdp or the desktop?

  • netomxnetomx Member, Moderator

    try connecting with vnc... i have seen lag with xrdp :(

  • OllieOllie Member

    @vps6net Thanks for this, really good instructions.

  • NeoonNeoon Member
    edited August 2013
Sign In or Register to comment.