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

Thread: How to Xephyr ~ AKA Multiple, nested X sessions

Hybrid View

  1. #1
    Join Date
    Apr 2006
    Location
    Montana
    Beans
    Hidden!
    Distro
    Kubuntu Development Release

    Thumbs down How to Xephyr ~ AKA Multiple, nested X sessions

    How to Xephyr



    Click to enlarge

    What is Xephyr ?

    Xephyr is a X server that runs as a small window within your current X session.

    What is it good for ?

    There are multiple potential uses for Xephyr:
    • Development. You can ssh into a chroot and forward X sessions.
    • Forward X over ssh without VNC.


    Example: Normally if you ssh -X you can forward x applications. This is not a problem if you are forwarding a single application from a single server. But if you forward multiple applications from multiple servers or a whole desktop, it gets messy (to say the least). You can start a new X session ( Virtual X ), but then you have to Ctl-Al-F7 and Ctrl-Alt-F8 between them.

    1. Install Xephyr

    Code:
    sudo apt-get install xserver-xephyr
    2. Start Xephyr

    Code:
    Xephyr -ac -screen 1280x1024 -br -reset -terminate 2> /dev/null :1 &
    • The ":1" = your display (displays are numbered starting with 0)
    • -ac = disable access control restrictions= allow you to forward X
    • -screen 1280x1024 = screen size
    • -br = black background
    • -reset -terminate= Xephyr should automatically close when the last X client is killed, does not always work.
    • 2> /dev/null redirects error messages.


    3. Set your display (for X)

    Code:
    DISPLAY=:1.0
    • Don't forget to set it back after you establish a ssh connection ( DISPLAY=0.0 )


    =========================


    4. Forward single apps / separate window for each server.

    Start Xephyr

    Code:
    Xephyr -ac -screen 1280x1024 -br -reset -terminate 2> /dev/null :1 &
    Change your $Display

    Code:
    DISPLAY=:1.0
    Forward a xterm:

    Code:
    ssh -XfC -c blowfish user@server xterm
    • -X = forward X
    • -f = puts your ssh session into the background
    • -C = use compression -c blowfish = use blowfish (I am told this is the fastest)



    Click to enlarge



    Any X apps for that server will start in that window.


    =========================


    5. Desktop:

    Start Xephyr

    Code:
    Xephyr -ac -screen 1280x1024 -br -reset -terminate 2> /dev/null :2 &
    2. ssh into the chroot/server

    Code:
    ssh -XfC -c blowfish user@server xfce4-session
    • Substitute your window manager for "xfce4-session"



    =========================


    Enjoy,

    bodhi.zazen
    Last edited by bodhi.zazen; November 24th, 2007 at 06:13 AM. Reason: Added re-direct for error messages
    There are two mistakes one can make along the road to truth...not going all the way, and not starting.
    --Prince Gautama Siddharta

    #ubuntuforums web interface

  2. #2
    Join Date
    Nov 2006
    Location
    40.31996,-80.607213
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: How to Xephyr ~ AKA Multiple, nested X sessions

    Works good so far. I can't test out ssh yet, since I don't have openssh-server installed on my sisters system yet, but I will try that out soon.

    Also, a small fix:
    Back where you said:
    Forward a xterm:

    Code:
    ssh -Xfc -c blowfish user@server xterm
    That should be a capital C after -Xfc. Example:
    Code:
    ssh -XfC -c blowfish
    Because I was getting an error with c because of unknown cipher type.
    Good job, this really makes things simpler yet

    Great howto!

    Edit:
    A screenshot of icewm-session running through Xephyr at 800x600.
    http://ubuntuforums.org/attachment.p...1&d=1195779441

    Dr Small
    Attached Images Attached Images
    Last edited by Dr Small; November 23rd, 2007 at 01:58 AM.
    "Security lies within the user of who runs the system. Think smart, live safe." - Dr Small
    Linux User #441960 | Wiki: DrSmall

  3. #3
    Join Date
    Nov 2006
    Location
    40.31996,-80.607213
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: How to Xephyr ~ AKA Multiple, nested X sessions

    Gtk-Xephyr
    Allows you to run Xephyr in a Gtk environment, eliminating the use of starting it all with terminals. You must first download the script below, and give it executable permissions, and copy it to your /usr/bin directory.

    Download from here:
    Dr Small's Blog
    Or Ubuntu Forums (1)
    Chmod it with executable permissions:
    Code:
    chmod +x gtk-xephyr
    Copy it to /usr/bin:
    Code:
    sudo cp gtk-xephyr /usr/bin
    Open it with the Run Dialog (ALT + F2):
    Code:
    gtk-xephyr
    Or make a launcher that points to that command.


    I originally wrote this script, after disliking the fact that I needed to open multiple terminals to get this to work, and then Bodhi.Zazen fixed my bugs and made it better

    You can find the original source of this from here:
    http://php.8ez.com/drsmall/blog/?p=175

    (1: If you downloaded the file from the attachment that I uploaded to Ubuntu Forums, please rename it to "gtk-xephyr" instead of "gtk-xephyr.sh". Ubuntu Forums required that I have a file type within their allow list.)


    Dr Small
    Attached Files Attached Files
    Last edited by Dr Small; November 25th, 2007 at 12:22 AM.
    "Security lies within the user of who runs the system. Think smart, live safe." - Dr Small
    Linux User #441960 | Wiki: DrSmall

  4. #4
    Join Date
    May 2006
    Location
    Switzerland
    Beans
    2,907
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: How to Xephyr ~ AKA Multiple, nested X sessions

    Quote Originally Posted by Dr Small View Post
    Gtk-Xephyr ... Allows you to run Xephyr in a Gtk environment, eliminating the use of starting it all with terminals. I originally wrote this script, after disliking the fact that I needed to open multiple terminals to get this to work, and then Bodhi.Zazen fixed my bugs and made it better
    Niiiiice!!

  5. #5
    Join Date
    Sep 2008
    Location
    Lyon, France
    Beans
    1
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: How to Xephyr ~ AKA Multiple, nested X sessions

    Thanks for this great script for Xephyr. I still have a (noob?) question though : how do I specify in my xorg.conf file that I want the display associated to Xephyr to be outputted on a outer screen or video projector plugged to my laptop ? I both tried to configure this editing xorg.conf manually and using Nvidia X server settings but did not manage to find a solution.

    Thanks in advance for your help.

  6. #6
    Join Date
    Apr 2006
    Location
    Montana
    Beans
    Hidden!
    Distro
    Kubuntu Development Release

    Re: How to Xephyr ~ AKA Multiple, nested X sessions

    Quote Originally Posted by Dratop View Post
    Thanks for this great script for Xephyr. I still have a (noob?) question though : how do I specify in my xorg.conf file that I want the display associated to Xephyr to be outputted on a outer screen or video projector plugged to my laptop ? I both tried to configure this editing xorg.conf manually and using Nvidia X server settings but did not manage to find a solution.

    Thanks in advance for your help.
    I am not sure what you are trying to do exactly, but Xephyr does not run the way you envision. It runs within an existing X session and is not configured through xorg.conf or nvidia-settings.

    So you run xephyr on the same screen / x session that is already outputting to your video projector.
    There are two mistakes one can make along the road to truth...not going all the way, and not starting.
    --Prince Gautama Siddharta

    #ubuntuforums web interface

  7. #7
    Join Date
    Mar 2005
    Beans
    19

    Re: How to Xephyr ~ AKA Multiple, nested X sessions

    On a more popular level, can Xephyr be used to watch ABC.com TV programs, as some have tried to use Xnest to do? See http://ubuntuforums.org/showpost.php...3&postcount=12

  8. #8
    Join Date
    Nov 2006
    Beans
    66

    Re: How to Xephyr ~ AKA Multiple, nested X sessions

    Tnnx

  9. #9
    Join Date
    Feb 2008
    Beans
    41
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: How to Xephyr ~ AKA Multiple, nested X sessions

    Yes!! I figured it out! This is super cool! Thank you bunches bodhi.zazen! METTA

  10. #10
    Join Date
    Dec 2006
    Location
    Austin , TX.
    Beans
    1,406
    Distro
    Ubuntu Development Release

    Re: How to Xephyr ~ AKA Multiple, nested X sessions

    This is freaking amazing!

    Thanks!
    "The arc of the moral universe is long, but it bends toward justice."
    -Dr. Martin Luther King, Jr.

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
  •