Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Discussion & Documentation Documentation, Tips & Tricks
  • Search

VNCServer (Linux) Setup and Client Configuration (Win)

Unofficial documentation for various parts of Gentoo Linux. Note: This is not a support forum.
Post Reply
Advanced search
26 posts
  • 1
  • 2
  • Next
Author
Message
MatzeOne
Guru
Guru
User avatar
Posts: 579
Joined: Sun Sep 07, 2003 12:44 am
Location: Hamburg, Germany
Contact:
Contact MatzeOne
Website

VNCServer (Linux) Setup and Client Configuration (Win)

  • Quote

Post by MatzeOne » Sat Oct 11, 2003 4:23 pm

This is my first tutorial and english is not my first language, so please don't hack me ;)



This tutorial should guide you trough the installation of a VNC Server on (Gentoo) Linux and the configuration for Windows Boxes. VNC stands for Virtual Network Computing. It is remote control software which allows you to view and interact with one computer (the "server") using a client on another computer. If you want to surf webpages at your work and your boss shouldn't know that, i'm your man ;)

Before we start make sure you can answer at least the first four questions with yes:
- Do you have a Linux installed on your computer which you want to use as your server?
- Do you have a Windows installed on the computer which you want to use as your client?
- Do you have root access to your Server?
- Do you have a Secure Shell Daemon installed, configured and is it started?
- Do you know why you want to follow the following instructions?

---

So we can start now with the Linux Server.
I'm using the Gentoo distribution so i can't guarantee that this works on your box. I recommend Gentoo as the best distribution around, but that's not the topic ;)

Log in as root.

Gentoo-users:
Update the portage tree with

Code: Select all

emerge sync
You make sure that you've the latest versions by updating the portage tree. Next get the vnc-package and compile it:

Code: Select all

emerge vnc
Now the server is ready :)

Non-Gentoo-Users:
You should get the package from http://www.realvnc.com manually. Follow the installation instructions.


Now start the server by typing this into the terminal, shell or whatever ;)

Code: Select all

vncserver
When vncserver is started for the first time you have to enter a password. For security reasons don't use your root password or another password you are using ;) Re-enter the password. The server should have been started and is listening to port 5901 per default.

You can check with

Code: Select all

nmap localhost
These ports should show up:

Code: Select all

PORT      STATE SERVICE
5801/tcp  open  vnc-http-1
5901/tcp  open  vnc-1
If you are behind a firewall, make sure port 5901 open. On port 5801 there is a webserver with a java-applet installed. You can access your machine by simply typing http://your-linux-server:5801 but then the data is not encrypted and the local system administrator may have some questions ;) So just don't use this ^^

---

Client setup (Windows)

We need some programs to be installed :)
Download and install Putty - It's the SSH client. We use this because of security reasons :)
Download VNC for Windows. You don't need to fill our the fields on the download side. Just click on the checkbox left of Windows 9x/2000/NT/XP (x86) and proceed. You only need the viewer.
After Installing these programs we will configure Putty.


Start Putty

Session:
___Hostname: ip of server
___Port: port on which sshd listens (default: 22)

NOTE: by accessing your computer over a hostname instead of an ip, get you an account at http://www.dyndns.org per example.

Connection:
###Proxy: if you connect through a proxy to the internet, enter the information

Connection:
###SSH
________Tunnels:
________________Disable X11 Forwarding
________________(add new lokal port): Source port: 5901
____________________________________ Destination: localhost:5901

Save your Setting! (Session, Saved sessions, enter a session name, Save)

Now Press "Open"!!!

Login to your Server as a user.
Don't close Putty.

Start the VNC Viewer on your Windows machine (maybe over the program - menu ;))

VNC Server: localhost:1 (localhost, because putty tunneled the connection)
enter the password you've given the server... you should now see your X screen with the window manager twm...

I hope i could help.

MatzeOne
Mit null lässt sich eine ganze Menge machen.
Sportschule Hamburg
Top
Malakin
Veteran
Veteran
User avatar
Posts: 1692
Joined: Sun Apr 14, 2002 4:19 am
Location: Victoria BC Canada

  • Quote

Post by Malakin » Sat Oct 11, 2003 7:29 pm

If you want a more responsive connection this is what I use to connect from a windows box:

tightvncviewer.exe /encodings tight /compresslevel 9 /quality 5 /nocursorshape -normalcursor -noremotecursor whatever.dyndns.org:1

I use tightvnc instead of the standard vnc, it has quite a few additional features and it's rock solid. jpeg support is one of the tightvnc features and it's much faster using it.

This enables jpeg compression and cranks up the cpu usage for compression although it's still very low on my systems. nocursorshape stops the cursor shape updates, normalcursor gives you a normal arrow cursor to work with and noremotecursor prevents the real cursor from being drawn.
Top
MatzeOne
Guru
Guru
User avatar
Posts: 579
Joined: Sun Sep 07, 2003 12:44 am
Location: Hamburg, Germany
Contact:
Contact MatzeOne
Website

  • Quote

Post by MatzeOne » Sat Oct 11, 2003 8:39 pm

thx 4 the tip, Malakin :D

i'll try this tool l8er :)
Mit null lässt sich eine ganze Menge machen.
Sportschule Hamburg
Top
ferris5
n00b
n00b
Posts: 32
Joined: Tue Sep 02, 2003 11:59 am

  • Quote

Post by ferris5 » Tue Oct 21, 2003 4:54 pm

When i start vncserver i get the following : couldn't find "xauth" on your PATH.

what am i doing wrong?
Top
MatzeOne
Guru
Guru
User avatar
Posts: 579
Joined: Sun Sep 07, 2003 12:44 am
Location: Hamburg, Germany
Contact:
Contact MatzeOne
Website

  • Quote

Post by MatzeOne » Wed Oct 22, 2003 5:30 pm

ferris5 wrote:When i start vncserver i get the following : couldn't find "xauth" on your PATH.

what am i doing wrong?
did you start the server as root?
so did i (yes... i know... i shouldn't do this...) and it worked for me
Mit null lässt sich eine ganze Menge machen.
Sportschule Hamburg
Top
ferris5
n00b
n00b
Posts: 32
Joined: Tue Sep 02, 2003 11:59 am

  • Quote

Post by ferris5 » Thu Oct 23, 2003 6:32 am

Yes, that was the answer, thanks
Top
MatzeOne
Guru
Guru
User avatar
Posts: 579
Joined: Sun Sep 07, 2003 12:44 am
Location: Hamburg, Germany
Contact:
Contact MatzeOne
Website

  • Quote

Post by MatzeOne » Thu Oct 23, 2003 8:28 pm

ferris5 wrote:Yes, that was the answer, thanks
you're welcome :)
Mit null lässt sich eine ganze Menge machen.
Sportschule Hamburg
Top
Hoshimaru
Apprentice
Apprentice
Posts: 225
Joined: Sun Nov 09, 2003 10:05 am
Location: Belgium
Contact:
Contact Hoshimaru
Website

  • Quote

Post by Hoshimaru » Wed Jan 21, 2004 10:28 pm

Very interesting ^^

However I only see a X shell window on a gray background.

I logged in using SSH.

# vncserver

# startx

Wether I run startx or not, I get the same gray bg with a shell window. Any idea ?

Edit: Screenshot
Top
Malakin
Veteran
Veteran
User avatar
Posts: 1692
Joined: Sun Apr 14, 2002 4:19 am
Location: Victoria BC Canada

  • Quote

Post by Malakin » Thu Jan 22, 2004 1:13 am

Wether I run startx or not, I get the same gray bg with a shell window. Any idea ?
I think you need to edit your ~/.xinitrc file and add a line for a desktop.

Mine looks like this:

Code: Select all

/usr/kde/3.1/bin/startkde
Top
Hoshimaru
Apprentice
Apprentice
Posts: 225
Joined: Sun Nov 09, 2003 10:05 am
Location: Belgium
Contact:
Contact Hoshimaru
Website

  • Quote

Post by Hoshimaru » Thu Jan 22, 2004 7:58 am

Ok ^^
I'm going to find out what command is needed for Gnome :)

Edit: Screenshot - Direct access on the Gentoo box, without VNC and SSH
Top
Hoshimaru
Apprentice
Apprentice
Posts: 225
Joined: Sun Nov 09, 2003 10:05 am
Location: Belgium
Contact:
Contact Hoshimaru
Website

  • Quote

Post by Hoshimaru » Thu Jan 22, 2004 6:40 pm

I managed to get it working.

I commented everything in ~/.vnc/xstartup and wrote:

Code: Select all

#!/bin/sh
xset fp+ unix/:-1
/etc/X11/Sessions/Gnome
I found this on the gentoo forums during my coffee break at work, but I can't remember which thread it was.

Maybe this can help someone else too ?

Screenshot
Top
HomerSimpson
l33t
l33t
User avatar
Posts: 869
Joined: Sat Jan 25, 2003 3:37 pm
Location: Ohio, USA

  • Quote

Post by HomerSimpson » Tue Mar 09, 2004 11:57 am

MatzeOne, if we are tunneling through ssh then why do we have to open 5901 in the firewall?

I ask this because I can't get this to work outside my lan. I am assuming that port 5901 needs to be open but I don't understand why and I don't want to open it if I don't have to.

Thx for the tutorial. :)
The strong must protect the Sweet.
Top
marcowave
Apprentice
Apprentice
User avatar
Posts: 284
Joined: Tue Feb 10, 2004 9:11 am
Location: Paris, France
Contact:
Contact marcowave
Website

  • Quote

Post by marcowave » Fri Apr 23, 2004 8:58 pm

MatzeOne wrote:
ferris5 wrote:When i start vncserver i get the following : couldn't find "xauth" on your PATH.

what am i doing wrong?
did you start the server as root?
so did i (yes... i know... i shouldn't do this...) and it worked for me
it doesn't work for me...

I am root but I when I type vncserver I get this error:

couldn't find "xauth" on your PATH

:(
Linux User #351189 --->A.K.A. "Johnny"<---
Acer TM292LMi: PentiumM 1,5 GHz - 1 GB ram - Radeon 9700M 64MB - Intel 802.11b/g WLAN - DVD-RW - Gentoo Linux - KDE 3.5.2
GentooServer: AMD Athlon 700 MHz - 512 MB ram - HD 80 GB - Kernel 2.6 - Fluxbox
Top
meulie
l33t
l33t
User avatar
Posts: 845
Joined: Tue Jun 17, 2003 12:07 pm
Location: a Dutchman living in Norway
Contact:
Contact meulie
Website

  • Quote

Post by meulie » Tue Jun 08, 2004 7:33 pm

marcowave wrote:
MatzeOne wrote:
ferris5 wrote:When i start vncserver i get the following : couldn't find "xauth" on your PATH.

what am i doing wrong?
did you start the server as root?
so did i (yes... i know... i shouldn't do this...) and it worked for me
it doesn't work for me...

I am root but I when I type vncserver I get this error:

couldn't find "xauth" on your PATH

:(

I had that as well. The following command solved it for me:

Code: Select all

source /etc/profile
Greetz,
Evert Meulie
Top
marcowave
Apprentice
Apprentice
User avatar
Posts: 284
Joined: Tue Feb 10, 2004 9:11 am
Location: Paris, France
Contact:
Contact marcowave
Website

  • Quote

Post by marcowave » Wed Jun 09, 2004 1:27 pm

ok, now I have VNC working..

but it's too slow... I can't control my remote PC server with a Linux VNC server.. so I reinstalled win2000..

is there some other programs faster than VNC or is there a way to make VNC for linux faster?
Linux User #351189 --->A.K.A. "Johnny"<---
Acer TM292LMi: PentiumM 1,5 GHz - 1 GB ram - Radeon 9700M 64MB - Intel 802.11b/g WLAN - DVD-RW - Gentoo Linux - KDE 3.5.2
GentooServer: AMD Athlon 700 MHz - 512 MB ram - HD 80 GB - Kernel 2.6 - Fluxbox
Top
meulie
l33t
l33t
User avatar
Posts: 845
Joined: Tue Jun 17, 2003 12:07 pm
Location: a Dutchman living in Norway
Contact:
Contact meulie
Website

  • Quote

Post by meulie » Wed Jun 09, 2004 2:40 pm

have you tried tightvnc? works pretty good on my systems here... 8)
Greetz,
Evert Meulie
Top
marcowave
Apprentice
Apprentice
User avatar
Posts: 284
Joined: Tue Feb 10, 2004 9:11 am
Location: Paris, France
Contact:
Contact marcowave
Website

  • Quote

Post by marcowave » Wed Jun 09, 2004 2:48 pm

yep I try it...

it works well with a normal X session...

but if I use KDE it's very slow....

Are u using KDE?
Linux User #351189 --->A.K.A. "Johnny"<---
Acer TM292LMi: PentiumM 1,5 GHz - 1 GB ram - Radeon 9700M 64MB - Intel 802.11b/g WLAN - DVD-RW - Gentoo Linux - KDE 3.5.2
GentooServer: AMD Athlon 700 MHz - 512 MB ram - HD 80 GB - Kernel 2.6 - Fluxbox
Top
meulie
l33t
l33t
User avatar
Posts: 845
Joined: Tue Jun 17, 2003 12:07 pm
Location: a Dutchman living in Norway
Contact:
Contact meulie
Website

  • Quote

Post by meulie » Wed Jun 09, 2004 3:32 pm

Yup. I use both Gnome & KDE.

My linux box is a 2.4G Celeron & my winXP is a Athlon XP 2000+. I've set tightvnc to max compression.
Greetz,
Evert Meulie
Top
marcowave
Apprentice
Apprentice
User avatar
Posts: 284
Joined: Tue Feb 10, 2004 9:11 am
Location: Paris, France
Contact:
Contact marcowave
Website

  • Quote

Post by marcowave » Fri Jun 25, 2004 2:24 pm

how have I to modify the file

#/home/johnny/.vnc/xstartup

Code: Select all

#!/bin/sh

xrdb $HOME/.Xresources
xsetroot -solid grey
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &

to make KDE starts up in a VNC session?
Linux User #351189 --->A.K.A. "Johnny"<---
Acer TM292LMi: PentiumM 1,5 GHz - 1 GB ram - Radeon 9700M 64MB - Intel 802.11b/g WLAN - DVD-RW - Gentoo Linux - KDE 3.5.2
GentooServer: AMD Athlon 700 MHz - 512 MB ram - HD 80 GB - Kernel 2.6 - Fluxbox
Top
Malakin
Veteran
Veteran
User avatar
Posts: 1692
Joined: Sun Apr 14, 2002 4:19 am
Location: Victoria BC Canada

  • Quote

Post by Malakin » Fri Jun 25, 2004 6:50 pm

KDE has support for vnc. Control Center -> Internet & Network -> Desktop Sharing. From here you can tick "allow uninvited connections" and give it a password.

Not sure how fast KDE's built-in vnc support is, it may be a lot slower then tightvnc but I don't know since I haven't used it recently.
Top
marcowave
Apprentice
Apprentice
User avatar
Posts: 284
Joined: Tue Feb 10, 2004 9:11 am
Location: Paris, France
Contact:
Contact marcowave
Website

  • Quote

Post by marcowave » Fri Jun 25, 2004 7:10 pm

Malakin wrote:KDE has support for vnc. Control Center -> Internet & Network -> Desktop Sharing. From here you can tick "allow uninvited connections" and give it a password.

Not sure how fast KDE's built-in vnc support is, it may be a lot slower then tightvnc but I don't know since I haven't used it recently.
yes I know.. but it is too slow..

and for fluxbox? what I have to change?
Linux User #351189 --->A.K.A. "Johnny"<---
Acer TM292LMi: PentiumM 1,5 GHz - 1 GB ram - Radeon 9700M 64MB - Intel 802.11b/g WLAN - DVD-RW - Gentoo Linux - KDE 3.5.2
GentooServer: AMD Athlon 700 MHz - 512 MB ram - HD 80 GB - Kernel 2.6 - Fluxbox
Top
x20vmk4x
n00b
n00b
Posts: 40
Joined: Sat Aug 23, 2003 2:51 pm

  • Quote

Post by x20vmk4x » Fri Jun 25, 2004 8:14 pm

marcowave wrote:
Malakin wrote:KDE has support for vnc. Control Center -> Internet & Network -> Desktop Sharing. From here you can tick "allow uninvited connections" and give it a password.

Not sure how fast KDE's built-in vnc support is, it may be a lot slower then tightvnc but I don't know since I haven't used it recently.
yes I know.. but it is too slow..

and for fluxbox? what I have to change?
just change the

Code: Select all

twm&
to

Code: Select all

fluxbox&
Top
pele_smk
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 94
Joined: Sat Mar 06, 2004 6:21 am
Location: Phoenix, AZ
Contact:
Contact pele_smk
Website

*fixed* vncserver error

  • Quote

Post by pele_smk » Mon Nov 01, 2004 5:33 am

ok I'm getting the error:
vncserver: Could not create /home/pelesmk/.vnc.

Any suggestions?

*FIXED* Wow an intersting one. Simple yet weird, It ended up being an ownership problem. As basic as not being allowed to write to /home/pelesmk/. Must have been a late night and I messed something up. All is well now.
AMD64 3000+
Chaintech ZNF3-150
Chaintech ti4200 SE
WD 120gb && Maxtor 250gb && Maxtor 250gb,
Lite-On DVD+-RW
Coolermaster ATC-210
Thermalright slk & Tornado 92mm
It's still hot......
Top
wesblake
n00b
n00b
User avatar
Posts: 52
Joined: Fri Jun 25, 2004 2:10 am
Location: Sacramento
Contact:
Contact wesblake
Website

Any ideas?

  • Quote

Post by wesblake » Sat Nov 06, 2004 12:22 am

Ok guys, this is the first time I've set up vncserver. I followed this guide, and my comp is at home behind a Wireless router. I set up the router to forward port requests for 5801 and 5901 to my box under "virtual server" tab.

I then started server (as normal user, not root) and got this:

bash-2.05b$ vncserver

You will require a password to access your desktops.

Password:
Verify:
xauth: (argv):1: bad display name "tux:1" in "add" command

New 'X' desktop is tux:1

Creating default startup script /home/daho/.vnc/xstartup
Starting applications specified in /home/daho/.vnc/xstartup
Log file is /home/daho/.vnc/tux:1.log

bash-2.05b$ nmap localhost
bash: nmap: command not found
bash-2.05b$ /sbin/nmap localhost
bash: /sbin/nmap: No such file or directory
bash-2.05b$ su
Password:
bash-2.05b# nmap localhost
bash: nmap: command not found
bash-2.05b# exit
exit

Well, I got on my Windows (laptop) and grabbed TightVNC, started it up, and entered my.ip.here:5901 and clicked ok, it says "Failed to connect to server"
So...I went to IE and put in http://my.ip.here:5801
The Java application comes up, I type in my password and click ok, it gives me a shell. I type startx, and it says "Server is already active for display 0", I'm assuming because I'm on it right now. But in the above output it said:
New 'X' desktop is tux:1
Doesn't this mean the VNC will use display 1?
Thanks for any help, I don't really want to use the web one, I'd like to use TightVNC. Also, what's the best way to connect from another linux box?
Thanks peeps.
<kow`> "There are 10 types of people in the world... those who understand binary and those who don't."
Top
wesblake
n00b
n00b
User avatar
Posts: 52
Joined: Fri Jun 25, 2004 2:10 am
Location: Sacramento
Contact:
Contact wesblake
Website

One more thing....

  • Quote

Post by wesblake » Sat Nov 06, 2004 12:25 am

Oh, and I'm assuming since I started the server under my login, and it asked me for a password then, it's only running the server for me to connect to? Basically, I want to get this thing set up so that I and one other user on my computer can both connect to it. Thanks again.

***edit***
Ok, so I got it to connect, I had to do my.ip.here:1
So it comes up on my TightVNC (Windows) but it's just a grey background with the X mouse icon I can move around, and a console. When I VNC into school, I get the login prompt and can login to an X-session. I'd like to use KDE as it's what I have installed on my linux box, how can I do that? Thanks.

***edit***
Sorry peeps, guess I asked the questions before looking for the answers, go figure. I think this is what I was looking for:
http://forums.gentoo.org/viewtopic.php? ... hlight=vnc
<kow`> "There are 10 types of people in the world... those who understand binary and those who don't."
Top
Post Reply

26 posts
  • 1
  • 2
  • Next

Return to “Documentation, Tips & Tricks”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic