1.2复制ks.cfg文件/var/www/Ubuntu/目录中,并保证其它机器能通过http://192.168.10.21/Ubuntu/ks.cfg能看到ks.cfg中的内容
2.安装DHCP服务器
star@Ubuntu:~$ sudo apt-get install dhcp3-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
dhcp3-server is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 277 not upgraded.
star@Ubuntu:~$ sudo apt-get remove dhcp3-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
dhcp3-server
0 upgraded, 0 newly installed, 1 to remove and 277 not upgraded.
After this operation, 872kB disk space will be freed.
Do you want to continue [Y/n]?
2.1配置DHCP,配置文件如下
subnet 192.168.10.0 netmask 255.255.255.0 {
range 192.168.10.30 192.168.10.254;
option domain-name "192.168.10.251";
option routers 192.168.10.1;
default-lease-time 600;
max-lease-time 7200;
next-server 192.168.10.21;
filename "pxelinux.0";
增加红色字体部分
3.安装TFTP服务器
注意:必须使用TFTP-HPA这个软件包,使用TFTPD会出现问题导致不能导引导系统
star@Ubuntu:/$ sudo apt-get install tftpd-hpa tftp-hpa
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
atftpd tftp
The following NEW packages will be installed:
tftp-hpa tftpd-hpa
0 upgraded, 2 newly installed, 2 to remove and 277 not upgraded.
Need to get 63.8kB of archives.
After this operation, 57.3kB disk space will be freed.
Do you want to continue [Y/n]?
3.1修改TFTP配置文件,把RUN_DAEMON=”no”改为”yes”
star@Ubuntu:/tftpboot$ sudo vim /etc/default/tftpd-hpa
#Defaults for tftpd-hpa
RUN_DAEMON="yes"
OPTIONS="-l -s /var/lib/tftpboot"
TFTP安装完成后会建立/var/lib/tftpboot目录
star@Ubuntu:~$ cd /var/lib/tftpboot/
star@Ubuntu:/var/lib/tftpboot$
3.2下载Ubuntu netboot文件(和RedHat 有区别需要下载引导文件或在Ubuntu DVD光盘中提取)
使用wget –r 命令下载
http://archive.Ubuntu.com/Ubuntu/dists/lucid/main/installer-i386/current/images/netboot/
注意安装不同的版本其netboot文件也不同,请选择正确的下载
此处下载的是10.04的netboot文件
3.3进入/var/lib/tftp/Ubuntu-installer/i386/boot-screens目录中,编辑text.cfg文件
default install
label install
menu label ^Install
menu default
kernel Ubuntu-installer/i386/linux
append ks=http://192.168.10.21/Ubuntu/ks.cfg \
vga=normal initrd=Ubuntu-installer/i386/initrd.gz -- quiet
label cli
menu label ^Command-line install
kernel Ubuntu-installer/i386/linux
append tasks=standard pkgsel/language-pack-patterns= pkgsel/install-language-support=false vga=normal initrd=Ubuntu-installer/i386/initrd.gz -- quiet
~
4.安装Apache2服务器
star@Ubuntu::~$ sudo apt-get install apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
apache2
0 upgraded, 1 newly installed, 0 to remove and 3 not upgraded.
Need to get 0B/46.8kB of archives.
After this operation, 102kB of additional disk space will be used.
Selecting previously deselected package apache2.
(Reading database ... 135440 files and directories currently installed.)
Unpacking apache2 (from .../apache2_2.2.11-2Ubuntu2.6_all.deb) ...
Setting up apache2 (2.2.11-2Ubuntu2.6) ...
安装完成后会建立/var/www/目录
在些目录中新建Ubuntu 目录
4.1挂载光盘镜像,复制光盘中的所以内容到/var/www/Ubuntu/目录下
注意:Ubuntu 光盘必须使用Alternative,desktop版本不支持,说起这个问题了,当初因为这个问题我耽误了不少时间,如果使用desktop 版本会在选择镜像地址时出现找不到镜像的提示
保证其它机器能通过http://192.168.10.21/Ubuntu/能看到/var/www/Ubuntu/目录中的内容
安装系统
在客户裸机上设为网卡启动系统,启动系统后就会出现如下图所示的界面

当出现如下界面时选择第一项就开始自动安装Ubuntu了

安装完成后重启系统进入Ubuntu,如下图

至此,Ubuntu 10.04算是顺利安装完成了.
