1. 先建立光盘本地yum库
虚拟机挂载光盘镜像,
mount /dev/sr0 /mnt
vi /etc/yum.repos.d/local.repo
[local-base]
name=CentOS-$releasever local - Base
baseurl=file:///mnt enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
yum clean all
yum makecache yum install ftp lftp elinks gcc kernel-devel vim -y "@chinese-support"2. 虚拟机安装vbox增强功能
umount /mnt
ln -s /usr/src/kernels/2(tab键) /usr/src/linux
##然后点击虚拟机,安装增强功能
mount /dev/sr0 /mnt
#或者 !mount
sh /mnt/VBoxLinuxAdditions.run
#Building the shared folder support module[ OK ] #主要想要这个功能
3. 安装图形界面
4. 挂载主机共享文件夹
mkdir /shared
mount -t vboxsf ftp /shared5. SHELL自动补全
rpm -ivh bash-completion-1.3-7.el6.noarch.rpm
#其实在epel仓库
6. 开机自动挂载光盘和主机的共享文件夹
vim /etc/fstab:
# /dev/sr0 /mnt/cdrom iso9660 defualts,loop 0 0
ftp /shared vboxsf defaults 0 0
7. 作为模版
sys-unconfig
8. 重新建立本地yum源
vi /etc/yum.repos.d/local.rep
[local-centos]
name=CentOS-$releasever local centos - Base
baseurl=file:///shared/centos enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6[local-rhel]
name=CentOS-$releasever local rhel - Base
baseurl=file:///shared/rhel enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-69. 虚拟机端口映射
设置-网络-网络地址转换(NAT)-高级-端口转发(P)-client TCP 127.0.0.1 60016 10.0.2.15 22
10. 克隆(复制)虚拟机的网卡地址
vi /etc/udev/rules.d/70-persistent-net.rules
vim /etc/sysconfig/network-scripts/ifcfg-eth0