2009-07-08

Slitaz - Conspy / VNC / Xephyr


Xephyr

http://wiki.slitaz.org/doku.php?id=quickstart:conspy

Conspy : tiny screen or VNC

Slitaz core provides the 10Kb conspy to get remote control of Linux virtual consoles. See http://ace-host.stuart.id.au/russell/files/conspy/
....

conspy as screen (session manager)
Example:

home$ ssh tux@slitazbox
box$ su
box# openvt -c 28 /bin/ash
box# conspy 28
# some commands
...
#
box# exit
box$ exit

Later:

home$ ssh tux@slitazbox
box$ su
box# conspy 28
# more commands
...
#
box# exit
box$ exit

To close the session

home$ ssh tux@slitazbox
box$ su
box# conspy 28
# exit

box# deallocvt 28
box# exit
box$ exit

If you prefer to use screen, see http://www.gnu.org/software/screen:

# tazpkg get-install screen
$ screen -S MySession

If you prefer to share the X11 display, install x11vnc (VNC server) and x11vnc-extra (java VNC client) see http://www.karlrunge.com/x11vnc/ :

SlitazBox# tazpkg get-install x11vnc
SlitazBox# tazpkg get-install x11vnc-extra
SlitazBox# /etc/init.d/x11vnc start

home$ firefox http://SlitazBox:5800/ultrasigned.vnc


http://wiki.slitaz.org/doku.php?id=lang:en:xephyr

Xephyr
Introduction

Xephyr allows you to 「run」 a X window from a chroot environment into a host environment. Then you can run a Slitaz X window into a Slitaz… I still don't know if it's really useful, but at least it's fun LOL . Actually it's a kind of virtualbox.

You need a chroot environment. Check in the handbook how to do so : http://www.slitaz.org/en/doc/handbook/chroot-env.html
Using Xephyr

First install, enter the following in a shell :

# tazpkg get-install xorg-server-Xephyr

Then in a shell from the host environment, enter :

# Xephyr -pn -ac :1.0

It'll make a new 「X window」.
Then, in a chroot shell, enter :

# export DISPLAY=:1.0

Voila ! Easy and fun isn't it?

Now you can run graphical applications from the chroot environment as :

# openbox &
# lxpanel &
# leafpad &
... and whatever you want


http://puppy.cnbits.com/node/678

遠程登錄
SliTaz已經自帶了dropbear,一個輕量級的ssh服務器,不需要怎麼配置就能用。如果希望啟動電腦時就啟動dropbear,則將其加入/etc/rcS.conf文件中的RUN_DAEMONS變量中,其他服務程序也是同樣的做法。另外在X環境下也可以用tazctrlbox來完成。dropbear和emacs的TRAMP兼容得不好,列目錄時會出現ANSI Color Codes,原因不詳,不過架個FTP服務器就行了,也不一定非要scp來傳文件的。

SliTaz的源裡也有x11-vnc,可以提供X界面的遠程VNC訪問。但我更喜歡ssh的X11 forwarding一點。下面是我從Ubuntu中訪問那台Web服務器桌面所用的腳本,需要安裝Xephyr,這樣可以不干擾本地的桌面管理器。

1. Xephyr -ac -screen 1024x768 :5 2>/dev/null &
2. DISPLAY=:5.0 ssh -X -l tux test.cnbits.co.cc openbox-session

Xephyr -ac -screen 1024x768 :5 2>/dev/null &
DISPLAY=:5.0 ssh -X -l tux test.cnbits.co.cc openbox-session

FTP
安裝pure-ftpd。之後我修改了/etc/init.d/pure-ftpd,去掉了OPTIONS中的-A參數,這樣用普通權限用戶如tux登錄後也能訪問到除$HOME以外的目錄。