设为首页 收藏本站
查看: 1121|回复: 0

[经验分享] PXE KICKSTART Ubuntu12.04 实战

[复制链接]

尚未签到

发表于 2018-5-6 13:49:44 | 显示全部楼层 |阅读模式
  操作系统版本
# cat /etc/issue
CentOS release 6.3 (Final)

1.配置DHCP
# yum -y install dhcp dhcp-common

# cat  /etc/dhcp/dhcpd.conf
# dhcpd.conf
#
# Sample configuration file for ISC dhcpd

ddns-update-style interim;
ignore client-updates;

option domain-name "openvps.com";

default-lease-time 21600;
max-lease-time 43200;

authoritative;
allow booting;
allow bootp;

log-facility local7;

subnet 192.168.2.0 netmask 255.255.255.0 {
  range 192.168.2.26 192.168.2.56;
  option routers 192.168.2.254;
  option subnet-mask 255.255.255.0;
  option domain-name-servers 192.168.2.25;
  option broadcast-address 192.168.2.255;
  default-lease-time 21600;
  max-lease-time 43200;
  server-name "192.168.2.25";
  next-server 192.168.2.25;
  filename "/pxelinux.0";
}

# chkconfig --levels 35 dhcpd  on
# chkconfig --list |grep dhcpd
dhcpd           0:off   1:off   2:off   3:on    4:off   5:on    6:off
# service dhcpd restart

2.配置Apache
# yum -y install httpd
# cd /usr/local/games
# wget http://mirrors.163.com/ubuntu-releases/12.04/ubuntu-12.04-alternate-amd64.iso
# mount -o loop /usr/local/games/ubuntu-12.04-alternate-amd64.iso /var/www/html/ubuntu1204/
# service httpd restart
# chkconfig --levels 35 httpd on

3.配置tftp
# yum -y install tftp-server tftp

# cat /etc/xinetd.d/tftp
# default: off
# description: The tftp server serves files using the trivial file transfer \
#       protocol.  The tftp protocol is often used to boot diskless \
#       workstations, download configuration files to network-aware printers, \
#       and to start the installation process for some operating systems.
service tftp
{
        socket_type             = dgram
        protocol                = udp
        wait                    = yes
        user                    = root
        server                  = /usr/sbin/in.tftpd
        server_args             = -s /var/lib/tftpboot
        disable                 = no                      #"yes"改为"no"
        per_source              = 11
        cps                     = 100 2
        flags                   = IPv4
}
# cp -rf /var/www/html/ubuntu1204/install/netboot/*  /var/lib/tftpboot/
# service xinetd restart

4.修改配置
增加ks=http://192.168.2.25/ks.cfg
# cat  /var/lib/tftpboot/ubuntu-installer/amd64/boot-screens/txt.cfg
default install
label install
        menu label ^Install
        menu default
        kernel ubuntu-installer/amd64/linux
        append ks=http://192.168.2.25/ks.cfg vga=788 initrd=ubuntu-installer/amd64/initrd.gz -- quiet
label cli
        menu label ^Command-line install
        kernel ubuntu-installer/amd64/linux
        append tasks=standard pkgsel/language-pack-patterns= pkgsel/install-language-support=false vga=788 initrd=ubuntu-

installer/amd64/initrd.gz -- quiet

5.配置ks文件
通过system-config-kickstart界面生成ks.cfg文件
# apt-get install system-config-kickstart
# scp ks.cfg root@192.168.2.25:/var/www/html

附ks.cfg
#Generated by Kickstart Configurator
#platform=x86

#System language
lang en_US
#Language modules to install
langsupport en_US
#System keyboard
keyboard us
#System mouse
mouse
#System timezone
timezone Asia/Shanghai
#Root password
rootpw --iscrypted $1$J0eYtxji$hzWrjxysHMaxAYPAEfwUp.
#Initial user
user --disabled
#Reboot after installation
reboot
#Use text mode install
text
#Install OS instead of upgrade
install
#Use Web installation
url --url http://192.168.2.25/ubuntu1204
#System bootloader configuration
bootloader --location=mbr
#Clear the Master Boot Record
zerombr yes
#Partition clearing information
clearpart --all --initlabel
#Disk partitioning information
part /boot --fstype ext4 --size 200
part swap --size 1600
part / --fstype ext4 --size 10000
part /opt --fstype ext4 --size 1 --grow
#System authorization infomation
auth  --useshadow  --enablemd5
#Network information
network --bootproto=dhcp --device=eth0
#Firewall configuration
firewall --disabled
#Do not configure the X Window System
skipx

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-456618-1-1.html 上篇帖子: Linnux: Skype ubuntu 10.04 amd64 下篇帖子: Ubuntu启动中Grub Rescue的修复方法
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

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