linux虚拟机最优测试环境搭建

目标:创建一个最优的linux虚拟机环境
环境:vmware12.0
系统:centos6.5
(* 以下配置是建立在配置完成基础网络环境后创建的,用static静态IP地址)

1.关闭selinux和iptables
# sed -i 's*enforcing*disabled*g' /etc/selinux/config
# chkconfig iptables off
2.时间同步
# echo "*/10 * * * * /usr/sbin/ntpdate time-a.nist.gov 2>&1" >>/var/spool/cron/root
3.修改时区
# /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
4.安装常用包
# yum install -y vim wget lrzsz sysstat bind-utils tcpdump ntp -y
5.更换并更新yum源
# mv /etc/yum.repos.d/*.repo /tmp/
# 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
# yum makecache
开机启动项优化:
# chkconfig --list|grep 3:on|awk '{print $1}' |grep -Ev "sshd|crond|rsyslog|network|sysstat" |awk '{print "chkconfig " $1 " off"}'|bash
取消mail 邮件提醒:
# echo "unset MAILCHECK">> /etc/profile
6.删除网卡mac地址的存放文件,方便克隆使用。
# rm -f /etc/udev/rules.d/70-persistent-net.rules
7.关机后, 建立快照(这里必须确保是关机状态拍摄的快照,方便后期直接克隆)
# shutdown -h now
8.创建新虚拟机
选择链接克隆即可:
9. 虚机创建完毕之后,只需要更改一下IP地址即可。

 

posted @ 2017-03-26 13:25  谢小花❀  阅读(414)  评论(0编辑  收藏  举报