Page 1 of 3 123 LastLast
Results 1 to 10 of 28

Thread: Multi Session login with vnc?

  1. #1
    Join Date
    Nov 2009
    Beans
    12

    Multi Session login with vnc?

    Hey I am pretty new with linux and ubuntu. But I decided to create a fileserver/media center machine for my living room. So far it has been a fantastic experience that I wouldn't be able to do without the search function on these forums!

    But now I want to do something that I am not sure is possible.

    I have my machine hooked up to a TV via DVI. On that screen I have it logged into a user and it is running XBMC.

    What I would like to do is be able to VNC into that same computer and log into another user in gnome. So I can see the desktop and such with out effecting the screen that is currently hooked up to the DVI. So basicly have to desktop "sessions" running at once and one being connected to DVI while the other is just connected via VNC.

    It is Ubuntu 9.10 and I am using x11vnc for my vnc viewer right now because of the compiz issue with my nvidia drivers.

    I have searched and searched and have yet to find an answer to this....

    thanks!

  2. #2
    Join Date
    Dec 2006
    Beans
    810

    Re: Multi Session login with vnc?

    By default x11vnc will connect to the X display on the physical graphics hardware. So you probably want the "vncserver" package instead (virtual desktop sessions.)

    BTW, if you install the "xvfb" package and then use "x11vnc -create" it can create virtual (i.e. RAM-only) desktops as well. If you go that route, ask if you have any questions.

  3. #3
    Join Date
    Nov 2009
    Beans
    12

    Re: Multi Session login with vnc?

    wow that sounds easy, will it conflict with my current x11vnc service running if I install "xvfb"?

    I installed x11vnc using this guide, http://ubuntuforums.org/showthread.php?t=45565

  4. #4
    Join Date
    Nov 2009
    Beans
    12

    Re: Multi Session login with vnc?

    Also I should note a couple things, I want to be able to keep he "virtual gnome session" logged in even if I close my VNC connection. I am testing this all out on in a VM before I commit anything to my fileserver..

    It is possible to have two "gnome" desktops running though correct? I tried the vncserver just now and it vnc'd into a very slim black and white windows thingy....
    Last edited by prettyhatem; December 18th, 2009 at 08:12 PM.

  5. #5
    Join Date
    Nov 2009
    Beans
    12

    Re: Multi Session login with vnc?

    Last question, Will I be able to still VNC into the original physically connected desktop?

  6. #6
    Join Date
    Dec 2006
    Beans
    810

    Re: Multi Session login with vnc?

    Quote Originally Posted by prettyhatem View Post
    wow that sounds easy, will it conflict with my current x11vnc service running if I install "xvfb"?
    No, the Xvfb program will not be set up as a service. It will just be a program sitting on your hard disk waiting for other programs (i.e. x11vnc -create) to run it.
    I installed x11vnc using this guide,
    http://ubuntuforums.org/showthread.php?t=45565
    No, it won't conflict with that. I assume you understand that TCP ports 5900, 5901, 5902, ... etc are used by the VNC servers, so, if you run multiple ones at the same time, you will have to deal with knowing which port belongs to which VNC server (your above link tries to inform you which port is being used by x11vnc.)

  7. #7
    Join Date
    Dec 2006
    Beans
    810

    Re: Multi Session login with vnc?

    Also I should note a couple things, I want to be able to keep the "virtual gnome session" logged in even if I close my VNC connection.
    Yes, that will work.
    It is possible to have two "gnome" desktops running though correct?
    Yes, as many as you want. One important note though: the "x11vnc -create" mechanism will first try to FIND any existing desktop session you have, and connect to that instead of creating a new one. This "finding" applies to both the desktop session on the physical h/w or a virtual one (x11vnc can't really tell the difference.)

    So to have multiple virtual gnome desktops all with the same user you could run multiple commands like this:
    Code:
    x11vnc -create -env FD_TAG=my_gnome_1 -env FD_SESS=gnome -rfbport 5901
    x11vnc -create -env FD_TAG=my_gnome_2 -env FD_SESS=gnome -rfbport 5902
    Well, there are fancier, cleaner ways to have multiple ones for the same user, but I hold off those details for now to avoid confusion.
    I tried the vncserver just now and it vnc'd into a very slim black and white windows thingy....
    Yes, I think you need to edit ~/.vnc/xstartup and put in the "gnome-session" command for the window manager instead of the default they put in there.
    Last question, Will I be able to still VNC into the original physically connected desktop?
    Yes. An -rfbport example like the above would work (replacing "-create" with "-display :0") but as I say there are fancier ways to manage this.
    Last edited by krunge; December 19th, 2009 at 03:51 AM.

  8. #8
    Join Date
    Nov 2009
    Beans
    12

    Re: Multi Session login with vnc?

    Wow fantastic info! thanks soooo much. Though I am running into some more newbie issues.

    I do have vnc currently setup with the port 5900 being connected to the current display. So if I just want to create an additional session, I would do this?

    x11vnc -display :0 -env FD_TAG=my_gnome_1 -env FD_SESS=gnome -rfbport 5900
    x11vnc -create -env FD_TAG=my_gnome_2 -env FD_SESS=gnome -rfbport 5901

    Would I put these commands in "/usr/local/bin/sharex11vnc"?

    I really appreciate your help!

  9. #9
    Join Date
    Nov 2009
    Beans
    12

    Re: Multi Session login with vnc?

    Also, there doesnt appear to be a ~/.vnc/xstartup file. There is if I make a vncserver -create, 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 Got connection from client 10.118.204.108
    18/12/2009 15:18:09   other clients:
    18/12/2009 15:18:09 wait_for_client: got client
    18/12/2009 15:18:09 wait_for_client: running: env X11VNC_SKIP_DISPLAY='' /bin/sh /tmp/x11vnc-find_display.bDYKgj
    18/12/2009 15:18:09 wait_for_client: find display cmd failed
    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
    And closes the connection.

  10. #10
    Join Date
    Dec 2006
    Beans
    810

    Re: Multi Session login with vnc?

    I do have vnc currently setup with the port 5900 being connected to the current display. So if I just want to create an additional session, I would do this?
    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.

Page 1 of 3 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
  •