注意:本文使用的爲公網源 因此重裝的機器須要能連公網,若是不能鏈接公網你須要搭建私有源
shell
本文安裝的爲centos6.5 根據不一樣版本下載不一樣的文件vim
wget http://mirrors.aliyun.com/centos/6.5/os/x86_64/images/pxeboot/vmlinuz wget http://mirrors.aliyun.com/centos/6.5/os/x86_64/images/pxeboot/initrd.img
將下載的文件複製到/boot 目錄centos
cp vmlinuz /boot/vmlinuz.centos.pxe cp initrd.img /boot/initrd.img.centos.pxe
yum install grub -y
添加安裝啓動項app
編輯啓動菜單less
vim /boot/grub/menu.lst
添加ui
title CentOS 6.5 VNC Installation root (hd0,0) kernel /vmlinuz.centos.pxe vnc vncpassword=password headless ip=127.0.0.1 netmask=255.255.255.0 gateway=127.0.0.1 dns=114.114.114.114 ksdevice=eth0 method=http://mirrors.aliyun.com/centos/6.5/os/x86_64/ lang=en_US keymap=us initrd /initrd.img.centos.pxe
更改password爲你的vnc密碼(至少6位)this
更改127.0.0.1 爲重裝系統主機的IPcentos7
更改網關127.0.0.1爲重裝系統主機的網關spa
編輯啓動順序.net
找到
default=0
若剛纔添加的title 爲第二個title 則將0改成1
若剛纔添加的title 爲第三個title 則將0改成2
以此類推
附上個人配置
# Note that you do not have to rerun grub after making changes to this file # NOTICE: You have a /boot partition. This means that # all kernel and initrd paths are relative to /boot/, eg. # root (hd0,0) # kernel /vmlinuz-version ro root=/dev/mapper/vg_openstack-lv_root # initrd /initrd-[generic-]version.img #boot=/dev/sda default=1 timeout=5 splashimage=(hd0,0)/grub/splash.xpm.gz hiddenmenu title CentOS (2.6.32-431.el6.x86_64) root (hd0,0) kernel /vmlinuz-2.6.32-431.el6.x86_64 ro root=/dev/mapper/vg_openstack-lv_root rd_LVM_LV=vg_openstack/lv_root rd_NO_LUKS.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=us rd_LVM_LV=vg_openstack/lv_swap rd_NO_DM rhgb quiet initrd /initramfs-2.6.32-431.el6.x86_64.img title CentOS 6.5 VNC Installation root (hd0,0) kernel /vmlinuz.centos.pxe vnc vncpassword=firxiao headless ip=192.168.2.254 netmask=255.255.255.0 gateway=192.168.2.1 dns=114.114.114.114 ksdevice=eth0 method=http://mirrors.aliyun.com/centos/6.5/os/x86_64/ lang=en_US keymap=us initrd /initrd.img.centos.pxe
最後仔細檢查是否有錯誤
reboot
開始安裝
參考:http://www.centosx.com/install-centos-remotely-through-vnc/
centos7 遠程重裝見 http://my.oschina.net/firxiao/blog/465691