DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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 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.
-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.
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...
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]
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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.