虚拟机安装优化
虚拟机安装
按tab键
net.ifnames=0 biosdevname=0
系统初始化
1、上传脚本
[root@localhost ~]# ll
total 12
-rwxr-xr-x. 1 root root 4544 Jun 29 15:23 init.sh
2、对脚本授权
[root@localhost ~]# chmod +x init.sh
3、执行初始化脚本
[root@localhost ~]# ./init.sh
4、关机,拍摄快照
系统安装后的优化
1、根据经验,选择安装包时应该按最小化原则,即不需要的或者不确定是否需要的就不安装,这样可以最大程度上确保系统安全。
2、如果安装过程落了部分包组或者其他伙伴安装时没选,再安装后可以按如下方式补上安装时未安装的包组:
yum groupinstall "Compatibility libraries" "Base" "Development tools"
yum groupinstall "debugging Tools" "Dial-up Networking Support"
```
# 可以通过yum groupinfo包组查看具体安装的组件。
3、可以查看选包的情况:yum grouplist
可以看到除了我们选择的外,系统还是默认安装了一些额外的软件包组。
注意:不要使用yum的删除功能删除软件,会删除相关依赖,导致意外问题。
4、安装系统补装工具命令
安装系统后还会有一些基本的工具没装,这时可以根据需求yum来安装下,啥时用啥时装也可。例如:
[root@egon ~]# yum -y install tree nmap sysstat lrzsz dos2unix telnet bash-completion bash-completion-extras vim lsof net-tools rsync ntpdate nfs-utils
如果需要更新补丁则执行
[root@egon ~]# yum update
5、配置网络
setup命令→Network configuration→Device configuration→eth0→配置完依次点击“ok” →“save” →Save&Quit→Quit,这样就退出到命令行界面了。
```
该配置实质就是修改网卡的配置文件/etc/sysconfig/network-scripts/ifcfg-eth0内容。
6、创建快照
远程连接 xshell