安装方法参见:
https://help.ubuntu.com/community/UbuntuLTSP/LTSPQuickInstall
或者除Ubuntu其它版本参见:
http://wiki.ltsp.org/twiki/bin/view/Ltsp/DownLoads
桌面版本安装:
运行:
sudo apt-get install ltsp-server-standalone openssh-server然后运行下面命令编译客户端image:
sudo ltsp-build-client执行上面第一步时,遇到错误:
正在设置 dhcp3-server (3.1.2-1ubuntu7) ...
Generating /etc/default/dhcp3-server...
* Starting DHCP server dhcpd3 [fail]
* check syslog for diagnostics.
invoke-rc.d: initscript dhcp3-server, action "start" failed.
正在设置 libpulse0 (1:0.9.19-0ubuntu4) ...
正在设置 gstreamer0.10-pulseaudio (0.10.16-1ubuntu3) ...
正在设置 openbsd-inetd (0.20080125-2ubuntu1) ...
* Stopping internet superserver inetd [ OK ]
* Not starting internet superserver: no services enabled
正在设置 ldm-server (2:2.0.48-0ubuntu1) ...
正在设置 libasound2-plugins (1.0.20-1ubuntu8) ...
正在设置 libpulse-browse0 (1:0.9.19-0ubuntu4) ...
正在设置 libspeexdsp1 (1.2~rc1-1) ...
正在设置 libtdb1 (1.1.5-1) ...
正在设置 debootstrap (1.0.20) ...
正在设置 tftpd-hpa (0.49-1) ...
tftpd-hpa disabled in /etc/default/tftpd-hpa
正在设置 nbd-server (1:2.9.11-2ubuntu1) ...
正在添加系统用户"nbd" (UID 112)...
正在添加新组"nbd" (GID 120)...
正在将新用户"nbd" (UID 112)添加到组"nbd"...
无法创建主目录"/etc/nbd-server"
** (process:3236): WARNING **: Could not parse config file: Could not open config file.
** Message: Nothing to do! Bye!
nbd-server.
正在设置 squashfs-tools (1:4.0-1) ...
正在设置 ltsp-server (5.1.90-0ubuntu3) ...
正在设置 ltspfs (0.5.13-1) ...
正在设置 openssh-server (1:5.1p1-6ubuntu2) ...
Creating SSH2 RSA key; this may take some time ...
Creating SSH2 DSA key; this may take some time ...
* Restarting OpenBSD Secure Shell server sshd [ OK ]
正在设置 xbase-clients (1:7.4+3ubuntu7) ...
正在设置 ltsp-server-standalone (5.1.90-0ubuntu3) ...
* Stopping DHCP server dhcpd3 [fail]
* Starting DHCP server dhcpd3 [fail]
* check syslog for diagnostics.
invoke-rc.d: initscript dhcp3-server, action "force-reload" failed.
正在设置 pulseaudio-utils (1:0.9.19-0ubuntu4) ...
正在设置 pulseaudio-module-udev (1:0.9.19-0ubuntu4) ...
正在设置 pulseaudio (1:0.9.19-0ubuntu4) ...
Adding user pulse to group audio
* PulseAudio configured for per-user sessions
正在设置 pulseaudio-esound-compat (1:0.9.19-0ubuntu4) ...
正在设置 pulseaudio-module-x11 (1:0.9.19-0ubuntu4) ...
正在处理用于 libc-bin 的触发器...
ldconfig deferred processing now taking place
jelly@jelly-kubuntu9:~$
查看syslog:
jelly@jelly-kubuntu9:~$ more /var/log/syslog
Oct 28 23:01:16 jelly-kubuntu9 anacron[838]: Job `cron.daily' terminated
Oct 28 23:01:16 jelly-kubuntu9 anacron[838]: Normal exit (1 job run)
Oct 28 23:17:02 jelly-kubuntu9 CRON[2397]: (root) CMD ( cd / && run-parts --re
port /etc/cron.hourly)
Oct 28 23:20:48 jelly-kubuntu9 kernel: [ 1712.285787] type=1505 audit(1256743248
.788:16): operation="profile_load" pid=2987 name=/usr/sbin/dhcpd3
Oct 28 23:20:48 jelly-kubuntu9 dhcpd: Internet Systems Consortium DHCP Server V3
.1.2
Oct 28 23:20:48 jelly-kubuntu9 dhcpd: Copyright 2004-2008 Internet Systems Conso
rtium.
Oct 28 23:20:48 jelly-kubuntu9 dhcpd: All rights reserved.
Oct 28 23:20:48 jelly-kubuntu9 dhcpd: For info, please visit http://www.isc.org/
sw/dhcp/
Oct 28 23:20:49 jelly-kubuntu9 dhcpd: Internet Systems Consortium DHCP Server V3
.1.2
Oct 28 23:20:49 jelly-kubuntu9 dhcpd: Copyright 2004-2008 Internet Systems Conso
rtium.
Oct 28 23:20:49 jelly-kubuntu9 dhcpd: All rights reserved.
Oct 28 23:20:49 jelly-kubuntu9 dhcpd: For info, please visit http://www.isc.org/
sw/dhcp/
Oct 28 23:20:49 jelly-kubuntu9 dhcpd: Wrote 0 leases to leases file.
Oct 28 23:20:49 jelly-kubuntu9 dhcpd:
Oct 28 23:20:49 jelly-kubuntu9 dhcpd: No subnet declaration for eth0 (192.168.2.
103).
Oct 28 23:20:49 jelly-kubuntu9 dhcpd: ** Ignoring requests on eth0. If this is
not what
Oct 28 23:20:49 jelly-kubuntu9 dhcpd: you want, please write a subnet declara
tion
Oct 28 23:20:49 jelly-kubuntu9 dhcpd: in your dhcpd.conf file for the network
segment
Oct 28 23:20:49 jelly-kubuntu9 dhcpd: to which interface eth0 is attached. **
Oct 28 23:20:49 jelly-kubuntu9 dhcpd:
Oct 28 23:20:49 jelly-kubuntu9 dhcpd:
Oct 28 23:20:49 jelly-kubuntu9 dhcpd: Not configured to listen on any interfaces
!
Oct 28 23:21:00 jelly-kubuntu9 dhcpd: Wrote 0 leases to leases file.
Oct 28 23:21:00 jelly-kubuntu9 dhcpd:
Oct 28 23:21:00 jelly-kubuntu9 dhcpd: No subnet declaration for eth0 (192.168.2.
103).
Oct 28 23:21:00 jelly-kubuntu9 dhcpd: ** Ignoring requests on eth0. If this is
not what
Oct 28 23:21:00 jelly-kubuntu9 dhcpd: you want, please write a subnet declara
tion
Oct 28 23:21:00 jelly-kubuntu9 dhcpd: in your dhcpd.conf file for the network
segment
Oct 28 23:21:00 jelly-kubuntu9 dhcpd: to which interface eth0 is attached. **
Oct 28 23:21:00 jelly-kubuntu9 dhcpd:
Oct 28 23:21:00 jelly-kubuntu9 dhcpd:
Oct 28 23:21:00 jelly-kubuntu9 dhcpd: Not configured to listen on any interfaces
!
jelly@jelly-kubuntu9:~$
jelly@jelly-kubuntu9:~$
从下面这句话:
Oct 28 23:20:49 jelly-kubuntu9 dhcpd: No subnet declaration for eth0 (192.168.2.查看该配置文件:
jelly@jelly-kubuntu9:~$ cat /etc/ltsp/dhcpd.conf
#
# Default LTSP dhcpd.conf config file.
#
authoritative;
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.20 192.168.0.250;
option domain-name "example.com";
option domain-name-servers 192.168.0.1;
option broadcast-address 192.168.0.255;
option routers 192.168.0.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";
}
}
实际上电脑的IP是:
jelly@jelly-kubuntu9:~$ ifconfig
eth0 Link encap:以太网 硬件地址 00:0c:29:6d:df:b8
inet 地址:192.168.2.103 广播:192.168.2.255 掩码:255.255.255.0
inet6 地址: fe80::20c:29ff:fe6d:dfb8/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 跃点数:1
接收数据包:9135 错误:0 丢弃:0 过载:0 帧数:0
发送数据包:5811 错误:0 丢弃:0 过载:0 载波:0
碰撞:0 发送队列长度:1000
接收字节:11777592 (11.7 MB) 发送字节:515159 (515.1 KB)
中断:18 基本地址:0x2000
应该改为192.168.2.x网段。
参考:https://help.ubuntu.com/community/LTSPServerSetup
修改后:
jelly@jelly-kubuntu9:~$ cat /etc/ltsp/dhcpd.conf
#
# Default LTSP dhcpd.conf config file.
#
authoritative;
subnet 192.168.2.0 netmask 255.255.255.0 {
range 192.168.2.20 192.168.2.50;
option domain-name "example.com";
option domain-name-servers 192.168.2.1;
option broadcast-address 192.168.2.255;
option routers 192.168.2.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";
}
}
启动DHCP服务:
jelly@jelly-kubuntu9:~$ sudo /etc/init.d/dhcp3-server start
* Starting DHCP server dhcpd3 [ OK ]
jelly@jelly-kubuntu9:~$
再创建一个虚拟机作为客户端,没有安装OS也没有启动光盘,它会尝试PXE网络启动:
从图中可以看出,获取IP地址成功,通过TFTP下载内核,打印文件未找到的错误。
查看系统日志:
jelly@jelly-kubuntu9:~$ cat /var/log/syslog
Nov 1 00:42:17 jelly-kubuntu9 dhcpd: Wrote 0 leases to leases file.
Nov 1 00:44:27 jelly-kubuntu9 dhcpd: DHCPDISCOVER from 00:0c:29:c7:e7:f4 via eth0
Nov 1 00:44:28 jelly-kubuntu9 dhcpd: DHCPOFFER on 192.168.2.20 to 00:0c:29:c7:e7:f4 via eth0
Nov 1 00:44:30 jelly-kubuntu9 dhcpd: DHCPREQUEST for 192.168.2.20 (192.168.2.103) from 00:0c:29:c7:e7:f4 via eth0
Nov 1 00:44:30 jelly-kubuntu9 dhcpd: DHCPACK on 192.168.2.20 to 00:0c:29:c7:e7:f4 via eth0
日志中并没有记录TFTP获取的是哪个文件。
突然想起来,之前安装的时候出错了,还有条很重要的命令没执行:sudo ltsp-build-client
这条命令执行起来非常慢,需要研究下它到底做了什么,简化一下客户端image。
为了让它执行完,晚上一直开机了,早上起来,执行完了:
Number of ids (unique uids + gids) 20
Number of uids 3
root (0)
jelly (1000)
libuuid (100)
Number of gids 18
root (0)
video (44)
audio (29)
tty (5)
kmem (15)
disk (6)
lpadmin (104)
shadow (42)
messagebus (106)
fuse (103)
mail (8)
crontab (107)
ssl-cert (105)
utmp (43)
staff (50)
src (40)
libuuid (101)
adm (4)
Info: updating inetd config
信息:LTSP客户端全部安装成功
jelly@jelly-kubuntu9:~$
重启客户端,果然正常了,客户端启动之后进入kubuntu登录界面。
客户端启动完成后跟服务器没什么两样,连执行ifconfig得到的结果都是服务器的IP地址: