Centos6克隆虛機的前提

Centos6克隆虛機的前提

進行以下操作時需要系統可以連外網

系統安裝好後進行兩刪除一清空

sed -ri '/HWADDR|UUID/d' /etc/sysconfig/network-scripts/ifcfg-eth*
>/etc/udev/rules.d/70-persistent-net.rules
echo ">/etc/udev/rules.d/70-persistent-net.rules" >>/etc/rc.local

修改yum源

yum -y install wget
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo
yum clean all >/dev/null
yum makecache >/dev/null

關閉iptables防火牆

/etc/init.d/iptables stop
chkconfig iptables off
chkconfig |grep iptables

關閉SELINUX

setenforce 0
sed -i 's/SELINUX=.*/SELINUX=disabled/g' /etc/selinux/config

設置時間同步

echo "*/5 * * * * /usr/sbin/ntpdate time.nist.gov >/dev/null 2>&1" >> /var/spool/cron/root

安裝常用的工具

yum install gcc gcc-c++  wget cmake curl unzip zip telnet vim tree nmap sysstat lrzsz dos2unix -y

####以上優化做完後,就可以將新建的虛機關閉,然後進行克隆

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章