服务器内存至少 2G,否则无法安装
先在控制台把云服务器重装为 CentOS 7
下载启动文件
wget -O /boot/initrd.img https://mirrors.aliyun.com/centos/7/os/x86_64/images/pxeboot/initrd.img wget -O /boot/vmlinuz https://mirrors.aliyun.com/centos/7/os/x86_64/images/pxeboot/vmlinuz
编辑 /etc/grub.d/40_custom 文件
vi /etc/grub.d/40_custom
在后面添加
menuentry "Install CentOS 7" { set root='(hd0,msdos1)' linux /boot/vmlinuz repo=https://mirrors.aliyun.com/centos/7/os/x86_64/ ip=xxx.xxx.xxx.xxx netmask=xxx.xxx.xxx.xxx gateway=xxx.xxx.xxx.xxx nameserver=114.114.114.114 initrd /boot/initrd.img }
其中'(hd0,msdos1)'表示启动文件所在的分区位置,这里表示第一块硬盘的第一个分区
ip、netmask、gateway、nameserver按实际情况修改
编辑 /etc/default/grub 文件
vi /etc/default/grub
修改 GRUB_DEFAULT=saved 为
GRUB_DEFAULT="Install CentOS 7"
更新 GRUB2 配置文件
grub2-mkconfig --output=/boot/grub2/grub.cfg
最后重启服务器,使用控制台 VNC 连接服务器即可进入安装界面