zoukankan      html  css  js  c++  java
  • 使用PXE+VNC方式安装CentOS 7

    U盘坏了,用个下面的方法安装

    安装配置dhcp

    yum -y install dhcp tftp-server
    

    修改如下,网段改为你自己的网段

    vim /etc/dhcp/dhcpd.conf
     subnet 172.16.1.0 netmask 255.255.255.0 {
            range 172.16.1.100 172.16.1.200;
            option subnet-mask 255.255.255.0;
            default-lease-time 21600;
            max-lease-time 43200;
            next-server 172.16.1.61; #这里ip为tftp服务器的ip
            filename "/pxelinux.0";
    }
    

    安装httpd

    yum -y install httpd
    sed -i "277i ServerName 127.0.0.1:80" /etc/httpd/conf/httpd.conf
    

    挂在CentOS7 镜像

    mkdir /var/www/html/CentOS-7
    mount /dev/cdrom /var/www/html/CentOS-7/
    

    准备pxelinux.0文件

    yum -y install syslinux
    cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
    

    复制isolinux所有文件至tftpboot

    cp -a /var/www/html/CentOS-7/isolinux/* /var/lib/tftpboot/
    

    复制pxe配置文件

    mkdir -p /var/lib/tftpboot/pxelinux.cfg
    cp /var/www/html/CentOS-7/isolinux/isolinux.cfg /var/lib/tftpboot/pxelinux.cfg/default
    

    编辑pxe配置文件

    vim /var/lib/tftpboot/pxelinux.cfg/default
    
    default  vesamenu.c32
    prompt 0
    timeout 300
    ONTIMEOUT local
    
    menu title ----------------------- Install The Centos 7 Linux -----------------------------
    
    label 1
    menu label ^1) Install CentOS 7 x64 
      kernel vmlinuz
      append initrd=initrd.img method=http://172.16.1.1/CentOS-7 devfs=nomount
    
    label 2
    menu label ^2) Install CentOS 7 x64 with VNC
      kernel vmlinuz
      append  initrd=initrd.img method=http://172.16.1.1/CentOS-7 devfs=nomount inst.vnc
    
    label 3
    menu label ^3) Auto Install CentOS 7 x64
      kernel vmlinuz
      append initrd=initrd.img ks=http://172.16.1.1/ks/CentOS-7-ks.cfg ksdevice=em1
    
    label 4
    menu label ^4) Boot from local drive
      localboot 0xffff
    

    启动服务

    /etc/init.d/dhcpd start
    /etc/init.d/httpd start
    /etc/init.d/xinetd start
    chkconfig tftp on
    

    如果选择2使用VNC方式,进入之后,访问地址在显示器上有输出,使用VNC客户端连接 IP:1 登陆安装系统

  • 相关阅读:
    MyEclipse快捷键大全
    The type 'Microsoft.Office.Interop.Excel.ApplicationClass' has no constructors defined
    ‘Microsoft.Office.Interop.Excel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c’
    使用游标循环表的简单DEMO
    URL Records
    一步一步教你实现CTreeCtrl 自绘
    自绘按钮
    UDP文件传输的实现
    美化VC界面(用户登录界面)
    如何截取QQ密码和聊天内容、去掉QQ广告栏、添加QQ尾巴
  • 原文地址:https://www.cnblogs.com/linuxops/p/6362466.html
Copyright © 2011-2022 走看看