Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 28

Thread: Multi Session login with vnc?

  1. #11
    Join Date
    Dec 2006
    Beans
    810

    Re: Multi Session login with vnc?

    Quote Originally Posted by prettyhatem View Post
    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".
    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?

  2. #12
    Join Date
    Nov 2009
    Beans
    12

    Re: Multi Session login with vnc?

    Quote Originally Posted by krunge View Post
    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.

  3. #13
    Join Date
    Nov 2009
    Beans
    12

    Re: Multi Session login with vnc?

    Quote Originally Posted by krunge View Post
    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...

  4. #14
    Join Date
    Dec 2006
    Beans
    810

    Re: Multi Session login with vnc?

    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:
    Code:
    vncserver :5
    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.
    Last edited by krunge; December 20th, 2009 at 01:18 AM.

  5. #15
    Join Date
    Nov 2009
    Beans
    12

    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?

  6. #16
    Join Date
    Dec 2006
    Beans
    810

    Re: Multi Session login with vnc?

    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.

  7. #17
    Join Date
    Dec 2006
    Beans
    810

    Re: Multi Session login with vnc?

    Alright, I did everything just mentioned and it worked!
    Good!
    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.)
    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.

  8. #18
    Join Date
    Nov 2009
    Beans
    12

    Re: Multi Session login with vnc?

    Quote Originally Posted by krunge View Post
    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)"

  9. #19
    Join Date
    Nov 2009
    Beans
    12

    Re: Multi Session login with vnc?

    Quote Originally Posted by krunge View Post
    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?

  10. #20
    Join Date
    Dec 2006
    Beans
    810

    Re: Multi Session login with vnc?

    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.

Page 2 of 3 FirstFirst 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •