本帖最后由 baodeyun 于 2018-10-22 12:51 编辑
桌面安装: 本机ip:192.168.1.20 vmareworkstation 10.0Centos6.5 桌面安装 关闭selinux和防火墙 临时关闭: service iptables stop setenforce 0 永久关闭: vim/etc/sysconfig/iptables *filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0] COMMIT vim /etc/selinux/config SELINUX=disabled reboot 安装完成后,配置本地yum源 上传 CentOS-6.5-x86_64-bin-DVD1.iso 到root目录下 mkdir /mnt/cdrom vim /etc/rc.d/rc.local /bin/mount -o loop /root/CentOS-6.5-x86_64-bin-DVD1.iso/mnt/cdrom vim /etc/yum.ropos.d/Centos-Base.repo [base] name=CentOS-$releasever - Base #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os baseurl=file:///mnt/cdrom gpgcheck=0 enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 yum clean all yum makecache 安装dhcp服务 yum install -y dhcp vim /etc/dhcp/dhcpd.conf option domain-name "test"; #指定网站域名 option domain-name-servers 8.8.8.8,114.114.114.114;#域名服务器,多个ip用逗号隔开 default-lease-time 6000;#默认租约时长,时间是秒 max-lease-time 7200;#最大租约时长 subnet 192.168.1.0 netmask 255.255.255.0{ # DHCP服务器自身网段及子网掩码 range 192.168.1.100 192.168.1.200;#地址池,动态分配ip地址的范围 option routers 192.168.1.1;#路由地址 next-server 192.168.1.20;#tftp服务器的ip地址 filename "pxelinux.0";#pxe启动引导文件 } service dhcpd configtest service dhcpd start chkconfig--level 35 on
测试:
说明dhcp服务正常。 安装tftp服务 yum install -ytftp-server tftp xinetd syslinux vim/etc/xinetd.d/tftp service tftp { socket_type = dgram protocol = udp wait = yes user = root server =/usr/sbin/in.tftpd server_args = -s/var/lib/tftpboot disable = no per_source = 11 cps = 100 2 flags = IPv4 } cp/mnt/cdrom/images/pxeboot/{vmlinuz,initrd.img} /var/lib/tftpboot/ #复制内核相关信息 cp /mnt/cdrom/isolinux/{boot.msg,splash,vesamenu.32}/var/lib/tftpboot/ #复制启动图像菜单相关文件 cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/#复制引导文件 mkdir /var/lib/tftpboot/pxelinux.cfg cp /mnt/cdrom//var/lib/tftpboot/pxelinux.cfg/default vim/var/lib/ftfpboot/pxelinux.cfg/default default vesamenu.c32 #默认加载的菜单引导程序,启动图像界面,不可修改 #prompt 1 timeout 600 #设置超时时间 display boot.msg #显示主菜单 menu background splash.jpg #设置菜单背景图片 menu title Welcome to CentOS 6.5! #设置菜单主题 menu color border 0 #ffffffff #00000000 menu color sel 7 #ffffffff #ff000000 menu color title 0 #ffffffff #00000000 menu color tabmsg 0 #ffffffff #00000000 menu color unsel 0 #ffffffff #00000000 menu color hotsel 0 #ff000000 #ffffffff menu color hotkey 7 #ffffffff #ff000000 menu color scrollbar 0 #ffffffff#00000000 label linux menu label ^Install or upgrade an existing system menu default kernel vmlinuz #设置内核文件位置 append initrd=initrd.imgks=http://192.168.1.20/ks.cfg #设置启动加载的kickstart位置 label vesa menu label Install system with ^basic video driver kernel vmlinuz append initrd=initrd.img xdriver=vesa nomodeset label rescue menu label ^Rescue installed system kernel vmlinuz append initrd=initrd.img rescue label local menu label Boot from ^local drive localboot 0xffff label memtest86 menu label ^Memory test kernel memtest append - 安装http服务 yum install -y httpd mkdir /var/www/html/cdrom mount --bind /mnt/cdrom/var/www/html/cdrom cp /root/anaconda-ks.cfg/var/www/html/ks.cfg vim /var/www/html/ks.cfg # Kickstart file automatically generatedby anaconda. #version=DEVEL ##制定安装源 install url --url=http://192.168.1.20/cdrom repo --name="CentOS" --baseurl=http://192.168.1.20/cdrom --cost=100 lang en_US.UTF-8 keyboard usauthconfig --enableshadow--passalgo=sha512 selinux --disabled timezone --utc Asia/Shanghai # The following is the partitioninformation you requested # Note that any partitions you deletedare not expressed # here so unless you clear allpartitions first, this is # not guaranteed to work #clearpart --none #part /boot --fstype=ext4 --size=200 #part swap --size=2048 #part / --fstype=ext4 --grow --size=200 #软件包 %packages # Kickstart file automatically generatedby anaconda. #version=DEVEL install url --url=http://192.168.1.20/cdrom repo --name="CentOS" --baseurl=http://192.168.1.20/cdrom --cost=100 lang en_US.UTF-8 keyboard us authconfig --enableshadow--passalgo=sha512 selinux --disabled timezone --utc Asia/Shanghai bootloader --location=mbr--driveorder=sda --append="crashkernel=auto rhgb quiet" # The following is the partitioninformation you requested # Note that any partitions you deletedare not expressed # here so unless you clear allpartitions first, this is # not guaranteed to work #clearpart --none #part /boot --fstype=ext4 --size=200 #part swap --size=2048 #part / --fstype=ext4 --grow --size=200 #软件包 %packages @base @core @debugging @basic-desktop @desktop-debugging @desktop-platform @directory-client @fonts @general-desktop @graphical-admin-tools @input-methods @internet-applications @internet-browser @java-platform 配置完成,启动httpd服务 service httpd start chkconfig httpd on 在自动化的安装过程中,出现如下错误: 原因是设置的虚拟内存太小,将内存file:///C:/Users/ADMINI~1/AppData/Local/Temp/msohtmlclip1/01/clip_image002.jpg调整大一些就可以。 全制动安装的配置: vim /etc/xinetd.d/tftp service tftp { socket_type = dgram protocol = udp wait = yes user = root server = /usr/sbin/in.tftpd server_args = -s/var/lib/tftpboot disable = no per_source = 11 cps = 100 2 flags = IPv4 } cd /var/lib/tftp file:///C:/Users/ADMINI~1/AppData/Local/Temp/msohtmlclip1/01/clip_image003.png
file:///C:/Users/ADMINI~1/AppData/Local/Temp/msohtmlclip1/01/clip_image004.png 每个操作系统的镜像的引导文件单独存放。 vim /var/lib/tftpboot/pxelinux.cfg/default default vesamenu.c32 #prompt 1 timeout 200 menu background splash.jpg menu title Welcome to PXE memu menu color border 0 #ffffffff #00000000 menu color sel 7 #ffffffff #ff000000 menu color title 0 #ffffffff #00000000 menu color tabmsg 0 #ffffffff #00000000 menu color unsel 0 #ffffffff #00000000 menu color hotsel 0 #ff000000 #ffffffff menu color hotkey 7 #ffffffff #ff000000 menu color scrollbar 0 #ffffffff #00000000 label 1 menu label ^Install or updatecentos6.5_x86_64 kernel centos6.5/vmlinuz appendinitrd=centos6.5/initrd.img ks=http://192.168.1.20/cs6.5.cfg label 2 menu label ^Install or updatecentos6.4_x86_64 kernelcentos6.4/vmlinuz appendinitrd=centos6.4/initrd.img ks=http://192.168.1.20/cs6.4.cfg label 3 menu label ^Install or updatecentos7_x86_64 kernel centos7/vmlinuz appendinitrd=centos7/initrd.img ks=http://192.168.1.20/cs7.cfg label local menu label Boot from ^local drive localboot 0xffff label memtest86 menu label ^Memory test kernel memtest append -
|