QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 2321|回复: 4

How to Xephyr ~ AKA Multiple, nested X sessions ZT

[复制链接]
发表于 2009-7-20 18:36:21 | 显示全部楼层 |阅读模式
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

    * run "xfwm4" in the terminal for window decorations(substitute your window manager if you are not using xfce).
    * xterm config file : http://www.xfce.org/various/Xresources.txt


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
发表于 2009-7-20 21:04:42 | 显示全部楼层
这个论坛是中文论坛还是英文论坛?
回复

使用道具 举报

 楼主| 发表于 2009-7-21 11:57:48 | 显示全部楼层
jiang总,您就不能给点赞美的文字,转贴也是很辛苦的
回复

使用道具 举报

发表于 2009-7-21 17:53:20 | 显示全部楼层
BS 两下下

最 BS 转贴不排版,不翻译,直接 ^C ^V 这种无脑转贴的人。
回复

使用道具 举报

 楼主| 发表于 2009-7-21 21:42:23 | 显示全部楼层
无脑怎么能看到别人的帖子呢。呵呵
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-11-2 00:40 , Processed in 0.071655 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表