安裝 LTSP 瘦客戶端系統

在真正開始實施 Linux 瘦客戶端之前需要先理解以下幾個基本概念:

PXE (Preboot Execute Environment) 是由 Intel 公司開發的最新技術,工作於Client/Server的網絡模式,支持工作站通過網絡從遠端服務器下載映像,並由此支持來自網絡的操作系統的啓動過程,其啓動過程中,終端要求服務器分配IP地址,再用TFTP(trivial file transfer protocol)或MTFTP(multicast trivial file transfer protocol)協議下載一個啓動軟件包到本機內存中並執行,由這個啓動軟件包完成終端基本軟件設置,從而引導預先安裝在服務器中的終端操作系統。PXE可以引導多種操作系統,如:Windows95/98/2000,linux等。

LTSP (Linux Terminal Server Project) 是著名的Linux終端服務器項目。官方解釋:LTSP is a Thin Client Solution for Linux operating systems.

有了以上的概念之後,要在 ubuntu 環境上部署其實是非常容易的。

1 Installing on top of an already running desktop system

You need to set up one static network interface where you will attach the thin client, install two packages and run one command.

$ sudo apt-get install ltsp-server-standalone

Now create your Thin Client environment on the server with.

$ sudo ltsp-build-client --mirror http://mirrors.163.com/ubuntu/

這裏面的 –mirror http://mirrors.163.com/ubuntu/ 處選擇離你最近的鏡像點,這樣下載速度會快一點。否則默認會連接到http://archive.ubuntu.com/ubuntu/ 鏡像,這國內的速度可真是不是開玩笑的,慢得跟龜速一樣。

2 Configuration

修改 /etc/network/interfaces 文件將服務器地址設爲固定地址,以下是我機器的配置例子

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.1.24
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 202.96.128.166 202.96.134.133

修改 /etc/ltsp/dhcpd.conf 文件將默認的所有的 192.168.0.0 網段修改成你實際的網段,在我家裏的網絡是192.168.1.0 網段,所以修改後的文件看起來就像以下這樣子:

#
# Default LTSP dhcpd.conf config file.
#

authoritative;

subnet 192.168.1.0 netmask 255.255.255.0 {
    range 192.168.1.30 192.168.1.99;
    option domain-name "example.com";
    option domain-name-servers 192.168.1.1;
    option broadcast-address 192.168.1.255;
    option routers 192.168.1.1;
#    next-server 192.168.0.1;
#    get-lease-hostnames true;
    option subnet-mask 255.255.255.0;
    option root-path "/opt/ltsp/i386";
    if substring( option vendor-class-identifier, 0, 9 ) = "PXEClient" {
        filename "/ltsp/i386/pxelinux.0";
    } else {
        filename "/ltsp/i386/nbi.img";
    }
}

根據情況將所有的 *.0. 修改成 *.1. 。然後重啓機器讓服務生效。

3 Enjoy your experience of LTSP

啓動客戶端機器,客戶機無需硬盤支持,在 BIOS 裏設置網絡引導即可使用服務器上的賬號密碼進行登錄。

注意在進系統之前要使用非 3D 的桌面環境,也即是登錄的時候 session 模式選擇如 ubuntu 2D 的模式。原因是ssh -X 傳輸不了 3D 界面導致登錄失敗(對此,我已經有過非常痛苦的經歷了)。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章