LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   VNC starts new xwindows session (https://www.linuxquestions.org/questions/linux-newbie-8/vnc-starts-new-xwindows-session-244815/)

sephiro499 10-19-2004 05:26 PM

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?

amfoster 10-19-2004 06:46 PM

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

sephiro499 10-19-2004 07:40 PM

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?

Demonbane 10-19-2004 08:00 PM

use the remote desktop connection feature in KDE

sephiro499 10-19-2004 08:03 PM

Thanks Demon, I'll give that a try. I didn't even know such a feature existed.

JimBass 10-19-2004 08:03 PM

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

Demonbane 10-19-2004 09:37 PM

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 :)

bitpicker 10-27-2004 03:18 PM

@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

Demonbane 10-27-2004 04:08 PM

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)

bitpicker 10-28-2004 07:03 AM

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

bitpicker 10-28-2004 08:37 AM

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

PlorkZ 10-28-2004 11:39 AM

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!!

amfoster 10-28-2004 05:21 PM

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

bitpicker 10-30-2004 03:30 AM

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

PlorkZ 11-01-2004 09:20 AM

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


All times are GMT -5. The time now is 01:57 AM.