Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
VNCServer (Linux) Setup and Client Configuration (Win)
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
MatzeOne
Guru
Guru


Joined: 07 Sep 2003
Posts: 579
Location: Hamburg, Germany

PostPosted: Sat Oct 11, 2003 4:23 pm    Post subject: VNCServer (Linux) Setup and Client Configuration (Win) Reply with quote

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:
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:
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:
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:
nmap localhost


These ports should show up:
Code:
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
Back to top
View user's profile Send private message
Malakin
Veteran
Veteran


Joined: 14 Apr 2002
Posts: 1692
Location: Victoria BC Canada

PostPosted: Sat Oct 11, 2003 7:29 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
MatzeOne
Guru
Guru


Joined: 07 Sep 2003
Posts: 579
Location: Hamburg, Germany

PostPosted: Sat Oct 11, 2003 8:39 pm    Post subject: Reply with quote

thx 4 the tip, Malakin :D

i'll try this tool l8er :)
_________________
Mit null lässt sich eine ganze Menge machen.
Sportschule Hamburg
Back to top
View user's profile Send private message
ferris5
n00b
n00b


Joined: 02 Sep 2003
Posts: 32

PostPosted: Tue Oct 21, 2003 4:54 pm    Post subject: Reply with quote

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

what am i doing wrong?
Back to top
View user's profile Send private message
MatzeOne
Guru
Guru


Joined: 07 Sep 2003
Posts: 579
Location: Hamburg, Germany

PostPosted: Wed Oct 22, 2003 5:30 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
ferris5
n00b
n00b


Joined: 02 Sep 2003
Posts: 32

PostPosted: Thu Oct 23, 2003 6:32 am    Post subject: Reply with quote

Yes, that was the answer, thanks
Back to top
View user's profile Send private message
MatzeOne
Guru
Guru


Joined: 07 Sep 2003
Posts: 579
Location: Hamburg, Germany

PostPosted: Thu Oct 23, 2003 8:28 pm    Post subject: Reply with quote

ferris5 wrote:
Yes, that was the answer, thanks


you're welcome :)
_________________
Mit null lässt sich eine ganze Menge machen.
Sportschule Hamburg
Back to top
View user's profile Send private message
Hoshimaru
Apprentice
Apprentice


Joined: 09 Nov 2003
Posts: 225
Location: Belgium

PostPosted: Wed Jan 21, 2004 10:28 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Malakin
Veteran
Veteran


Joined: 14 Apr 2002
Posts: 1692
Location: Victoria BC Canada

PostPosted: Thu Jan 22, 2004 1:13 am    Post subject: Reply with quote

Quote:
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:
/usr/kde/3.1/bin/startkde
Back to top
View user's profile Send private message
Hoshimaru
Apprentice
Apprentice


Joined: 09 Nov 2003
Posts: 225
Location: Belgium

PostPosted: Thu Jan 22, 2004 7:58 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Hoshimaru
Apprentice
Apprentice


Joined: 09 Nov 2003
Posts: 225
Location: Belgium

PostPosted: Thu Jan 22, 2004 6:40 pm    Post subject: Reply with quote

I managed to get it working.

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

Code:

#!/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
Back to top
View user's profile Send private message
HomerSimpson
l33t
l33t


Joined: 25 Jan 2003
Posts: 869
Location: Ohio, USA

PostPosted: Tue Mar 09, 2004 11:57 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
marcowave
Apprentice
Apprentice


Joined: 10 Feb 2004
Posts: 284
Location: Paris, France

PostPosted: Fri Apr 23, 2004 8:58 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
meulie
l33t
l33t


Joined: 17 Jun 2003
Posts: 845
Location: a Dutchman living in Norway

PostPosted: Tue Jun 08, 2004 7:33 pm    Post subject: Reply with quote

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:

source /etc/profile

_________________
Greetz,
Evert Meulie
Back to top
View user's profile Send private message
marcowave
Apprentice
Apprentice


Joined: 10 Feb 2004
Posts: 284
Location: Paris, France

PostPosted: Wed Jun 09, 2004 1:27 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
meulie
l33t
l33t


Joined: 17 Jun 2003
Posts: 845
Location: a Dutchman living in Norway

PostPosted: Wed Jun 09, 2004 2:40 pm    Post subject: Reply with quote

have you tried tightvnc? works pretty good on my systems here... 8)
_________________
Greetz,
Evert Meulie
Back to top
View user's profile Send private message
marcowave
Apprentice
Apprentice


Joined: 10 Feb 2004
Posts: 284
Location: Paris, France

PostPosted: Wed Jun 09, 2004 2:48 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
meulie
l33t
l33t


Joined: 17 Jun 2003
Posts: 845
Location: a Dutchman living in Norway

PostPosted: Wed Jun 09, 2004 3:32 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
marcowave
Apprentice
Apprentice


Joined: 10 Feb 2004
Posts: 284
Location: Paris, France

PostPosted: Fri Jun 25, 2004 2:24 pm    Post subject: Reply with quote

how have I to modify the file

#/home/johnny/.vnc/xstartup

Code:

#!/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
Back to top
View user's profile Send private message
Malakin
Veteran
Veteran


Joined: 14 Apr 2002
Posts: 1692
Location: Victoria BC Canada

PostPosted: Fri Jun 25, 2004 6:50 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
marcowave
Apprentice
Apprentice


Joined: 10 Feb 2004
Posts: 284
Location: Paris, France

PostPosted: Fri Jun 25, 2004 7:10 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
x20vmk4x
n00b
n00b


Joined: 23 Aug 2003
Posts: 40

PostPosted: Fri Jun 25, 2004 8:14 pm    Post subject: Reply with quote

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:
twm&
to
Code:
fluxbox&
Back to top
View user's profile Send private message
pele_smk
Tux's lil' helper
Tux's lil' helper


Joined: 06 Mar 2004
Posts: 94
Location: Phoenix, AZ

PostPosted: Mon Nov 01, 2004 5:33 am    Post subject: *fixed* vncserver error Reply with quote

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......
Back to top
View user's profile Send private message
wesblake
n00b
n00b


Joined: 25 Jun 2004
Posts: 52
Location: Sacramento

PostPosted: Sat Nov 06, 2004 12:22 am    Post subject: Any ideas? Reply with quote

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."
Back to top
View user's profile Send private message
wesblake
n00b
n00b


Joined: 25 Jun 2004
Posts: 52
Location: Sacramento

PostPosted: Sat Nov 06, 2004 12:25 am    Post subject: One more thing.... Reply with quote

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:
https://forums.gentoo.org/viewtopic.php?t=72893&highlight=vnc
_________________
<kow`> "There are 10 types of people in the world... those who understand binary and those who don't."
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum