LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-19-2004, 05:26 PM   #1
sephiro499
Member
 
Registered: Sep 2003
Location: Baltimore, MD
Distribution: Fedora Core 8
Posts: 39

Rep: Reputation: 15
VNC starts new xwindows session


Alright when I starts the vncserver from my mandrake 10 linux box I hear the KDE start up sound indicating that (well I think at least) that a new X session is started. I can connect by using a vncviewer on my xp notebook but everything is missing. My open programs, and dialog boxes are gone (at least from a graphical persepctive). Is there any program that will allow me to view what is on my linux box in KDE on another computer over the network?
 
Old 10-19-2004, 06:46 PM   #2
amfoster
Member
 
Registered: Aug 2004
Distribution: debian, SuSE
Posts: 365

Rep: Reputation: 36
Your X display is number 0. The first time you start the vncserver it starts on display 1 (port 5901) If you start it again, it will be on display 2 (port 5902) etc etc. Your X session is on port 6000 and has nothing to do with VNC
 
Old 10-19-2004, 07:40 PM   #3
sephiro499
Member
 
Registered: Sep 2003
Location: Baltimore, MD
Distribution: Fedora Core 8
Posts: 39

Original Poster
Rep: Reputation: 15
Ok, so what do I have to change so that I can see what is on my current desktop? So do I have to start the program 100 times? I don't see anything in the man pages regarding changing the port for Xvnc or vncserver. Is what I'm asking not possible with vnc?
 
Old 10-19-2004, 08:00 PM   #4
Demonbane
LQ Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
use the remote desktop connection feature in KDE
 
Old 10-19-2004, 08:03 PM   #5
sephiro499
Member
 
Registered: Sep 2003
Location: Baltimore, MD
Distribution: Fedora Core 8
Posts: 39

Original Poster
Rep: Reputation: 15
Thanks Demon, I'll give that a try. I didn't even know such a feature existed.
 
Old 10-19-2004, 08:03 PM   #6
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 49
It helps to remember that linux is by nature a multi-user OS. You can't get VNC to display the "active" desktop the way it does for a windows box. There are plusses and minuses to it, I learned alot by watching my boss VNC into a windows box, but it won't happen in linux. You can be signed into your box as user1, then vnc in as user 1, and the 2 desktops will have nothing to do with one another. If you run ps -aux you'll see all the processes on both desktops, but you can't "see" or use the other ones.

JimBass
 
Old 10-19-2004, 09:37 PM   #7
Demonbane
LQ Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
I'll show you something nifty, this does not require KDE to work either.

Grab the Linux binary release of vnc from
http://www.realvnc.com/download-free.html

extract and copy vnc.so to /usr/X11R6/lib/modules/extensions/

create a vnc passwd file using vncpasswd

open up your X config file (/etc/X11/XF86config(-4) or xorg.conf)
Under Section "Module" add
Load "vnc"

Under Section "Screen" add
Option "passwordFile" "/root/.vnc/passwd"
(change the path to wherever your password file is)
if you don't want password authentication for whatever reason add this line instead:
Option "securityTypes" "none"

restart X, now you can directly control the X session using vnc
 
Old 10-27-2004, 03:18 PM   #8
bitpicker
Member
 
Registered: Jul 2003
Location: Germany
Distribution: Xubuntu, Ubuntu
Posts: 416
Blog Entries: 14

Rep: Reputation: 35
@Dragonbane:

If I may chime in, I did as you suggested, and as a result the vnc server starts when I launch my GUI (XFce4). But the drawback is, that the computer which is supposed to remote control the computer gets an XFce desktop, but not the current one. It gets its own desktop which is nice and well, but not the intended effect. I want to be able to see exactly the things on the remote controlled desktop which I see on that desktop itself. I'm led to believe that the KDE option does exactly that - in essence, it is supposed to look just as it does when you remote-control a Windows system which displays the mouse moves, programs etc. on its own screen which you start on the remote-controlling system.

Is there a solution for that one, too?

Robin
 
Old 10-27-2004, 04:08 PM   #9
Demonbane
LQ Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
The method I provided above is suppose to do just that, you control the running X session through VNC, ie when you move the mouse cursor in vncviewer on the remote computer, you see it moving on the monitor.
Make sure you're not connecting to other VNC sessions than the one started by X on display :0(you need to connect to the default port which is 5900)

Last edited by Demonbane; 10-27-2004 at 04:12 PM.
 
Old 10-28-2004, 07:03 AM   #10
bitpicker
Member
 
Registered: Jul 2003
Location: Germany
Distribution: Xubuntu, Ubuntu
Posts: 416
Blog Entries: 14

Rep: Reputation: 35
When I tried the method yesterday, on the Win98 system running the viewer I could only see my usual XFce desktop, but not with the current windows open. Instead there was a terminal window open on the desktop, which in turn wasn't on the actual XFce screen, and the mouse movements were not replicated in either window.

The connection was to the display :1; :0 doesn't work at all, it gives an error 'no contact to server' or something to that effect. Where do I put that port? My vncviewer is the Windows version.

Robin
 
Old 10-28-2004, 08:37 AM   #11
bitpicker
Member
 
Registered: Jul 2003
Location: Germany
Distribution: Xubuntu, Ubuntu
Posts: 416
Blog Entries: 14

Rep: Reputation: 35
Addendum: It might be possible that the VNC session I actually did connect to yesterday was not one triggered by the setup you suggested but an older one I had started by hand. Today, when I tried it again, I could not make any connection at all with the module supposedly started by the lines in XF86config.

Let me describe what I did:

VNC was already installed on my system, and vnc.so was in /usr/X11R6/lib/modules, so I just made a symlink in the subdirectory /extensions.

I made a password as the user rather than root, and let the path point to the appropriate user directory rather than that of root. I also added the line which loads vnc. I restarted X and even tried rebooting, but vnc doesn't seem to start.

How can I verify whether vnc is actually running? On which display is it supposed to run? When I entered vncviewer in a terminal I got one I could connect to on :1, but there wasn't any other. this one of course was a new desktop with a very basic window manager only.

Robin
 
Old 10-28-2004, 11:39 AM   #12
PlorkZ
Member
 
Registered: Aug 2004
Posts: 32

Rep: Reputation: 15
Thank you to all who made contributions to this thread. I had the exact same question as the originator of the thread, and I was able to set up VNC based onthe information taht was provided. I have a couple new questions though:
1. Is it possible to have a VNC viewer use a SSH connection if you want to connect remotely? I have looked around for information on that but haven't found anything yet. Or is it using SSH and I just don't know it??
2. When you are ready to close your VNC connection, how can you stop the various processes that were started by VNC? If I do a ps ax after loggin out of my VNC connection I still see many of the X processes running. Here are a few lines returned by ps ax:

15098 ? S 0:00 xscreensaver -nosplash
15109 ? S 0:00 gnome-panel --sm-client-id default2
15111 ? S 0:00 nautilus --no-default-window --sm-client-id default3
15113 ? S 0:00 magicdev --sm-client-id default4
15116 ? S 0:00 eggcups --sm-client-id default6
15118 ? S 0:00 pam-panel-icon --sm-client-id default0

How do I close those programs when I'm done with VNC?

Thanks a million!!
 
Old 10-28-2004, 05:21 PM   #13
amfoster
Member
 
Registered: Aug 2004
Distribution: debian, SuSE
Posts: 365

Rep: Reputation: 36
You can do port forwarding with ssh as such.

in 1 terminal type
ssh -L 5910:127.0.0.1:5901 222.222.222.222

In that statement you created an arbitrary port ( i simply used 5910) on your localhost machine that will bind to the vnc port 5901 on the remote machine. Substitute the right IP for the 222's

That establishes a tunnel.

In a second terminal do the
vncviewer 127.0.0.1:10

Thus when you use the viewer on your own machine, you are really looking at the remotes machine. All data is encrypted in a tunnel
 
Old 10-30-2004, 03:30 AM   #14
bitpicker
Member
 
Registered: Jul 2003
Location: Germany
Distribution: Xubuntu, Ubuntu
Posts: 416
Blog Entries: 14

Rep: Reputation: 35
I have been directed towards the perfect solution for my problem (I wanted to have the current X session displayed rather than a new one on a remote machine). The solution is x11vnc, and it can be downloaded and easily installed and run via the instructions found here:

http://www.karlrunge.com/x11vnc/

Robin
 
Old 11-01-2004, 09:20 AM   #15
PlorkZ
Member
 
Registered: Aug 2004
Posts: 32

Rep: Reputation: 15
Thumbs up

Thanks for the suggestions, I'll give those a try!!
 
  


Reply



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
xwindows in ssh session ravneetsoin Linux - Software 2 08-12-2004 04:59 PM
Xwindows starts automatically at start up How can I stop that? Wolfy Linux - Newbie 8 06-29-2004 05:51 AM
how do you bypass xwindows before it starts AmdMhz Linux - Software 4 02-07-2004 07:04 PM
Start programs when Xwindows starts? ksun Linux - Newbie 3 10-13-2003 04:40 PM
Everything freezes when XWindows starts shaun_bakker Linux - General 4 02-17-2003 11:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:55 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration