LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices

Reply
 
Search this Thread
Old 09-09-2005, 08:24 AM   #1
tyranus
LQ Newbie
 
Registered: Aug 2005
Posts: 22

Rep: Reputation: 15
Exclamation vnc4server doesn`t work!


I installed vnc4server from a debian mirror:
apt-get install vnc4server

But when I try to access it from a linux PC I just canīt see nothing at all, the image has no resolution but at least it asks for user and pass.... and when I try to access it from Windows XP PC it posts... Impossible to conect to server, server not found....

So, I need some help with that īcause I donīt know if there is a configuration mistake or something like that.....

Iīm working with Debian Sarge....

Regards,
 
Old 09-09-2005, 09:05 AM   #2
yanik
Member
 
Registered: Oct 2003
Location: Montreal Beach
Distribution: Debian Unstable
Posts: 368

Rep: Reputation: 30
I don't know about your specific problem, but I personnally use x11vnc, which is a desktop sharing app, it does not start another x session like most vnc.

apt-get install x11vnc

to create a password:

x11vnc --storepasswd xxxxxx /home/youruser/.myvncpass

to start it I use

x11vnc -forever -q -bg -rfbauth /home/youruser/.myvncpass -scale 1/2:n4 -display :0

-forever = do not stop after the client disconnect
-q = quiet
-bg = process go in background
-rfbauth = use a password
-scale = downscale my huge 1600x1200 display
-display = which screen to use

simple as that. make sure your firewall accept incoming connection to port 5900 tho.
 
Old 09-09-2005, 10:28 AM   #3
tyranus
LQ Newbie
 
Registered: Aug 2005
Posts: 22

Original Poster
Rep: Reputation: 15
Iīve done everything you said but now I donīt konw how to access that server from another computer....
 
Old 09-09-2005, 11:52 AM   #4
yanik
Member
 
Registered: Oct 2003
Location: Montreal Beach
Distribution: Debian Unstable
Posts: 368

Rep: Reputation: 30
you need a vnc client for your OS. there are plenty out there. I use tightvnc
 
Old 06-02-2006, 06:08 PM   #5
jpmythic
LQ Newbie
 
Registered: Sep 2003
Posts: 2

Rep: Reputation: 0
vncserver and xinetd and gdm fix

Everytime I switch distro's I run into this similar problem, and usually it's so easy, but vncserver and (gdm/xdm/kdm) combo is not!

Okay, so heres the Proper fix:

To get vncserver to allow users to login from either inetd or xinetd....
Were going to use with xinetd
Debian stable does not install xinetd by default...

---------------------------------------------------

Simplest to do this as Root or su root...

Recommended:
vncserver: vnc4server (fairly newish)
(any) vncviewer that uses protocol 3.3 or higher
vnc4server will do up to 3.8 at this time.

1:) apt-get install vnc4server
2:) apt-get install xvncviewer
3:) apt-get install xinetd

now create the following files:
===============================
/etc/X0.hosts
-----------------
localhost
(any pingable host you want to allow)
(still testing, the below probably not necessary)
(as it's vnc talking locally...)
(Examples)
192.168.1.25
192.168.1.30

-----------------

/etc/xinetd.d/vncservers
-----------------
vnc-800x600
{
disable = no
protocol = tcp
socket_type = stream
wait = no
user = nobody
server = /usr/bin/Xvnc
server_args = -desktop LinOneX -inetd -query localhost -geometry 800x600 -depth 8 -once -securitytypes none
port = 5901
type = unlisted
}

vnc-mythic
{
disable = no
protocol = tcp
socket_type = stream
wait = yes
user = mythic
server = /usr/bin/Xvnc
server_args = -desktop MythicX -inetd -query localhost -geometry 1024x768 -depth 16 -once -rfbauth /home/mythic/.vnc/passwd
port = 5902
type = unlisted
}
-----------------
==============================
Remarks:
--------
vnc-800x600

will bring up the gdm login screen
this session will CLOSE when disconnected or user logouts
it is NOT persistant!!

----------
vnc-mythic

will FIRST request correct password from file /home/mythic/.vnc/passwd

will bring up the gdm login screen
this session will NOT CLOSE when disconnected, it IS PERSISTANT!!
ANY attempt to reconnect will ask for password
and return to last state.
If you logout in vnc Xwindow as you would normally, then
vnc will close it and start fresh

TAKE CLOSE NOTE....
You have to give your Xvnc args correctly!!!
Any wrong space or wrong parameter and that one will NOT
run.

AND unless you get your logfile settings correct, no reason why!!

example:
---------------------------------------------------
[Correct format for Xvnc that comes with vnc4server]

server_args = -desktop MythicX -inetd -query localhost -geometry 1024x768 -depth 16 -once -rfbauth /home/mythic/.vnc/passwd

[InCorrect one]

server_args = -name MythicX -inetd -query localhost -geometry 1024x768 -depth 16 -once -rfbauth /home/mythic/.vnc/passwd

in the incorrect one we used [-name] instead of [-desktop]
the best check is do (in a console) "Xvnc --help"
This will return the Correct Args and format...

You can get a variety of failures depending on where a
bad argment is in the line before or after -inetd.

Now we just need a couple of more changes....
---------------------------------------------

Allow the following in your firewall:
----------------------
For EACH VncServer you setup in /etc/xinetd.d/vncserver
you allow a port for it..

(so for our example --- )
ports 5800 - 5802
ports 5900 - 5902

(... ONLY vnc will talk to XServer)
port 177 -- localhost
----------------------

login as the user you want a persitant vncserver for...
(using the above example: mythic)

Run vncserver once...
---------------------------
mythic@linone: vncserver :1
(asks for password, enter one twice)
---------------------------

Run vncserver again...
---------------------------
mythic@linone: vncserver :1
<snip several messages...>
---------------------------

as long as it runs without exiting, you need to connect
to it with a viewer and get a wonderful Grey screen...
Don't worry, we'll fix that next.

Run vncviewer once...
---------------------------
mythic@linone: vncviewer :1
(asks for password, then a grey screen)
(exit vncviewer)
---------------------------

exit from VNC. If you did not get a basic Grey window,
then something is not right with the basic vncserver setup

Run vncserver again...
---------------------------
mythic@linone: vncserver -kill :1
<snip several messages...>
---------------------------

Now edit the file created by vncserver
(Im too lazy to write it)
--------------------------
/home/mythic/.vnc/xstartup

change the last line too...
-----------
startkde &
-----------
Or whatever XWindows you want...
Too be honest this file isn't necessary, but a good backup
and test of your basic vnc connectivity.

Okay, now just to test...
Run vncserver/viewer again...
-----------------------------
vncserver :1
<messages>
vncviewer :1
(password)
(your kde desktop, no GDM yet!!)
(Close vncviewer)
(Kill server)
vncserver -kill :1
--------------------------------
If the above works on the Box were setting up vncserver on,
the basics are almost done...

Now to get Gdm to handle requests from vncserver, we
have to change the XDMCP settings...
Can be done from XWindows with gdmconfig
or manually editing the file gdm.conf...

==============================================
editing the file manually:
-------------------------
(in my case its in: /etc/gdm/gdm.conf )
(basically the same for xdm/kdm, but different locations)

(Greeter and Remote greeter)
(Greeter affects local logins)
(Remotegreeter affects vnc)
(use the basic one for speed/bandwidth usage)
RemoteGreeter=/usr/bin/gdmlogin

(comment out)
#KillInitClients=true

(security section)
(This is a risk, but up to you!!)
AllowRemoteRoot=true

(Very important one here!!!)
(This must be False to work!!!)
DisallowTCP=false

(The rest until we get too XDMCP is fine as is)
(These TWO MUST BE DONE TO WORK)
******************************
[xdmcp]
Enable=true
Port=177
******************************

(ONCE you have it ALL Working you can turn this OFF)
(just comment out [ # 0=Standard ] and poof!!!)
(The main memory is a bit lighter as no standard Xwindows)
(Just vnc Xwindows)

[servers]
0=Standard
------------------------------------
Were done with gdm.conf, save it.. Remember it.
Cross our fingers, *grin*
==============================================

Now we need to modify vnc.conf...
You'll generally find it in /etc/vnc.conf
Change the following... or add it.
----------------------------------
$XFConfigPath = "/etc/X11/XF86Config";
$vncUserDir = "ENV{HOME}/.vnc";
$vncPasswdFile = $vncUserDir . "/passwd";
$vncStartUp = "/etc/X11/Xsession";
----------------------------------
You don't need to modify the rest, matter of fact,
I have everything else commented out.

You can copy this to your home Dir and rename it
to .vncrc, this will only affect your own servers run
from the command line.

The above changes to that file, "/etc/vnc.conf"
most likely our NOT neccessary, but I'm still looking
for any glitches as I test it further.
And this setup does work so far, so I'm letting you knw.

==============================================
Now the last touch ...
edit your services file to add any vncservers you've
created in xinted.d/vncserver...
--------------
/etc/services
-------------
(Add the following)
vnc-800x600 5901/tcp vnc800 #General Vnc gdm Login
vnc-mythic 5902/tcp vncmythic #Private Persistant login for mythic
-------------
==============================================

This should do it. With this setup you will have two
servers you can connect to by vnc:

vnc-800x600
No Password
GDM Login Window

vnc-mythic
Password to connect
GDM Login Window
persistance until you logout of Xwindows


Your best thing to do is Reboot, then test from a console
on the box with vncserver running on it.
if your able to connect to both vncservers :1/:2
your ready to try from a remote..
If you only have to change the /etc/xinetd.d/vncserver
file, you can just use:

/etc/inet.d/xinetd stop

[edit files as needed
/etc/xinetd.d/vncserver
and
/etc/services (for new servers)]

/etc/inet.d/xinetd start

Then try, try again...

Good luck. Alot of this info came from this link...
But some things were missed...
One major part was multiple different sites forgot to
mention that different versions of the servers expected
different argument formats, NONE of these servers were
ever nice in how they failed and reported problem.

Just putting:

[ -securitytypes=none ]

will crash the vncserver...

IT MUST be
[ -securitytypes(SPC)none ]

for it too work with the two servers I've tried.

and none would accept this setup:
---------------
[/etc/xinetd.d/vncserver]
vnc-800x600
{
<snip..>
server_args = -desktop MythicX <snip..>
SecurityTypes = None
port = 5902
<snip..>
}
---------------
ran into that format for the Xinetd serverice file

So watch closely what you put in the file, and check it with your version of Xvnc by use the --help option
to double check any args...

(A good starting point)
forums.fedoraforum.org (do a search vnc gdm)

(The main original Man Page at )
real vnc dot com Xvnc


Best of luck

Oh and to run this from inetd instead...
with no xinetd or just ignoring it,

add the lines like so to the end of /etc/inetd.conf
--------------------
vnc-800x600 stream tcp nowait nobody /usr/bin/Xvnc -desktop LinOneX -inetd -query localhost -geometry 1024x768 -depth 16 -once -securitytypes none

vnc-mythic stream tcp wait mythic /usr/bin/Xvnc -desktop MythicX -inetd -query localhost -geometry 1024x768 -depth 16 -once -rfbauth /home/mythic/.vnc/passwd

-------------------------

Plus do the above as well (Just drop the bits for xinetd)
and you shld have the same setup as with xinetd.

Also watch out for Word Wrap!!!!

One major thing I noticed in my trials....

Most problems were in the /etc/xinetd.d/vncserver file.

Most problems were caused by incorrect format of the Args...

Most of the problems could have been avoided if I hadn't
run into these
formats all over the web that didn't MATCH the Xvnc server I was currently running!!!!

No one ever seemed to notice that different formats were
appearing all over.

Last edited by jpmythic; 06-02-2006 at 06:29 PM.
 
  


Reply

Tags
article, complete, debian, entry, etch, make, replace, still, works


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
sshd doesn`t work TiCkO Linux - Networking 12 02-11-2006 05:00 PM
Wi-Fi doesn;t work on Suse 9.3 hackerarchangel Linux - Hardware 2 10-18-2005 12:59 PM
Microphone doesn' work Lars79 Slackware 20 08-30-2005 09:24 AM
PS/2 mouse doesnīt work :( teekaay Slackware 7 01-08-2004 02:22 AM
kopete doesnīt work maZ Linux - Software 1 07-31-2003 03:51 PM


All times are GMT -5. The time now is 05:56 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration