Re: Multi Session login with vnc?
Quote:
Originally Posted by
prettyhatem
Also, there doesnt appear to be a ~/.vnc/xstartup file. There is if I make a vncserver -create
Yes, I think you need to run vncserver once to have it make it (BTW, vncserver doesn't have a -create option)
So if you now have a "xstartup" file made by vncserver, if it has a line in there that runs "twm" or some other lightweight window manager, you should change that line to run "gnome-session".
Quote:
but now if I do the x11vnc -create that you specified.
When I try x11vnc -create -env FD_TAG=my_gnome_1 -env FD_SESS=gnome -rfbport 5901 it says "Listening for VNC connections on TCP port 5901" but when I attempt to connect to port 5901
Code:
...
18/12/2009 15:18:09 wait_for_client: FINDCREATEDISPLAY cmd: /bin/sh /tmp/x11vnc-find_display.bDYKgj Xvfb
trying N=20 ...
18/12/2009 15:18:10 wait_for_client: read failed: /bin/sh /tmp/x11vnc-find_display.bDYKgj Xvfb
18/12/2009 15:18:10 fgets: Bad file descriptor
That doesn't look good. Did you install the xvfb package?
Re: Multi Session login with vnc?
Quote:
Originally Posted by
krunge
That's a good question. I'm worried that you might have vino running during some of your tests and not know it and that might cause confusion. So I am tempted to have you use ports 5901 and 5902 for x11vnc to avoid any collisions with vino (or anything else) on port 5900
BTW your firewall (if one is running) will need to allow incoming connections to all of these ports (nowadays this seems to happen automatically, but I mention it just in case.)
I don't think your "/usr/local/bin/sharex11vnc" startup script method will work well here because both X desktop sessions would run it. Is that scheme working well for you to access the physical display :0 ? If so maybe I can think of a way to still use it for :0 and something else for your "virtual" one.
I suggest getting things working one at a time and then trying to put them together.
Alright I will try on ports 5901 and 5902.
Dont have a firewall setup.
It doesnt really matter if we use the "/usr/local/bin/sharex11vnc" script, it works with display:0 right now, but I am only using it because that guide I linked to suggested it.
Re: Multi Session login with vnc?
Quote:
Originally Posted by
krunge
Yes, I think you need to run vncserver once to have it make it (BTW, vncserver doesn't have a -create option)
So if you now have a "xstartup" file made by vncserver, if it has a line in there that runs "twm" or some other lightweight window manager, you should change that line to run "gnome-session".
That doesn't look good. Did you install the xvfb package?
I have not installed the xvfb package. Should I have?
just a quick note: I opted to install vnc4server from the Synaptic Package Manager. I do see another choice, tightvncserver...
Re: Multi Session login with vnc?
Quote:
I have not installed the xvfb package. Should I have?
just a quick note: I opted to install vnc4server from the Synaptic Package Manager. I do see another choice, tightvncserver...
Yes, for "x11vnc -create" mode the xvfb package (/usr/bin/Xvfb program) is needed.
But before you do that (as much as I'd like you to use "x11vnc -create" !!!), the vncserver route may be simpler for you since you say you don't have much unix experience.
I don't think there will be much difference between vnc4server and tightvncserver. Both provide the "vncserver" command I believe.
So run something like: This should start up a virtual X session (with a bare-bones window manager) for you that is accessible via a VNC viewer on vnc display 5, i.e. vnc port 5905. I think you said you did something like this already.
This should create a file for you ~/.vnc/xstartup looking something like this:
Code:
#!/bin/sh
# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &
With a text editor, change that "twm" to "gnome-session". Then kill and restart vncserver:
Code:
vncserver -kill :5
vncserver :5
This should give you a virtual X session, with gnome window manager, accessible on VNC port 5905 (e.g. "vncviewer host:5" from another computer)
Let's see how that goes.
Re: Multi Session login with vnc?
Alright, I did everything just mentioned and it worked!
I did install vnc4server. I still havent installed xvfb. Is there a benefit to using xvfb over just vncserver?
now that I ran vncserver :5 and it worked perfectly is that it? Do I just create a script to make sure it has vncserver :5 after restart?
Re: Multi Session login with vnc?
Quote:
It doesnt really matter if we use the "/usr/local/bin/sharex11vnc" script, it works with display:0 right now, but I am only using it because that guide I linked to suggested it.
For your display :0 access we might just modify that script to only do its x11vnc stuff if DISPLAY is :0, e.g.:
Code:
#!/bin/sh
if echo $DISPLAY | grep :0; then
x11vnc -nap -bg -forever -rfbauth ~/.vnc/passwd -desktop "VNC${USER}@${HOSTNAME}"|grep -Eo "[0-9]{4}">~/.vnc/port.txt
zenity --info --text="Your VNC port is `cat ~/.vnc/port.txt`"
fi
That way when your vncserver gnome-session runs, it will have a $DISPLAY of :5 (see my earlier post) and will by-pass the x11vnc starting stuff.
Re: Multi Session login with vnc?
Quote:
Alright, I did everything just mentioned and it worked!
Good!
Quote:
I did install vnc4server. I still havent installed xvfb. Is there a benefit to using xvfb over just vncserver?
I don't think so; however, it might depend on the questions or features you next ask for (if any.)
Quote:
now that I ran vncserver :5 and it worked perfectly is that it? Do I just create a script to make sure it has vncserver :5 after restart?
You mean so "vncserver :5" is run when the machine reboots? Or something else? A crontab might be a good way to start it at boottime.
Re: Multi Session login with vnc?
Quote:
Originally Posted by
krunge
You mean so "vncserver :5" is run when the machine reboots? Or something else? A crontab might be a good way to start it at boottime.
Sorry, I mean will this new session be able to connect if I just reboot the server? with vncserver know to run a session on :5 automatically?
Also I noticed when I logged into the :5 I got an error window stating
"An Error occurred while loading or saving configuration information for evolution-alarm-notify. Some of your configuration settings may not work properly.
Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for information. (Details - 1: Failed to get connection to session: Failed to connect to socket /tmp/dbus-nYrKIbHNjI: Connection refused)"
Re: Multi Session login with vnc?
Quote:
Originally Posted by
krunge
For your display :0 access we might just modify that script to only do its x11vnc stuff if DISPLAY is :0, e.g.:
Code:
#!/bin/sh
if echo $DISPLAY | grep :0; then
x11vnc -nap -bg -forever -rfbauth ~/.vnc/passwd -desktop "VNC${USER}@${HOSTNAME}"|grep -Eo "[0-9]{4}">~/.vnc/port.txt
zenity --info --text="Your VNC port is `cat ~/.vnc/port.txt`"
fi
That way when your vncserver gnome-session runs, it will have a $DISPLAY of :5 (see my earlier post) and will by-pass the x11vnc starting stuff.
I guess I am confused on what this is to do? it will keep display :5 for a vnc session only and keep display :0 for the physical?
Re: Multi Session login with vnc?
Quote:
Sorry, I mean will this new session be able to connect if I just reboot the server? with vncserver know to run a session on :5 automatically?
I personally would use "crontab" to do this. This way "vncserver :5" would be run at boottime independent of anyone logging into the gui on the physical display.
You can learn about cron with these commands "man 1 crontab" and "man 5 crontab".
If you run "crontab -e" it will pop you into an editor where you can add new scheduled tasks. Boy, I hope it pops you into an editor you know how to use... Then I would add a line like:
Code:
@reboot /usr/bin/vncserver :5
and then save and exit. Do all of that as the user you want vncserver to run as. Then upon reboot vncserver should be automatically started.