虚拟化环境需要克隆虚拟主机,新版RHEL7.1重新封装有些变化
下面以 “GUI服务器”环境进行
rm -rf /etc/ssh/ssh_host* rm -rf /etc/udev/rules.d/70*
删除 /etc/sysconfig/network-scripts/ifcfg-eno16777736文件中的MAC以及UUID
cat /dev/null > /etc/machine-id rm -rf /etc/hostname systemctl enable initial-setup-graphical.service systemctl enable firstboot-graphical.service cat /dev/null > /etc/sysconfig/firstboot
可以写如下脚本执行即可:(关闭防火墙,关闭SElinux)
#/!bin/bash systemctl stop firewalld.service sleep 3 systemctl disable firewalld.service sed -n 's/=enforcing/=permissive/' /etc/selinux/config setenforce 0 rm -rf /etc/ssh/ssh_host* rm -rf /etc/udev/rules.d/70* sed '/^MAC/d' "$(find /etc/ -name 'ifcfg\-eno*' -o -name 'ifcfg\-eth*')" sed '/^UUID/d' "$(find /etc/ -name 'ifcfg\-eno*' -o -name 'ifcfg\-eth*')" cat /dev/null > /etc/machine-id rm -rf /etc/hostname systemctl enable initial-setup-graphical.service systemctl enable firstboot-graphical.service cat /dev/null > /etc/sysconfig/firstboot init 0
封装完后启动如下:
转载于:https://blog.51cto.com/leoshi/1658137