mac下使用安装centos6.5和增强功能包

来源:互联网 发布:java default关键字 编辑:程序博客网 时间:2024/04/30 07:35

安装virtualBox:https://www.virtualbox.org/

安装扩展包:http://download.virtualbox.org/virtualbox/4.3.24/Oracle_VM_VirtualBox_Extension_Pack-4.3.24-98716.vbox-extpack

下载centos镜像CentOS-6.5-x86_64-bin-DVD1to2.iso:https://www.centos.org/download/mirrors/,我安装的是6.5,centos7是最小化安装,需要自己yum很多东西,6.5可以在安装的时候选很多预装的组件,比较方便

打开virtualBox,左上角新建-名称随便起-类型选linux-版本选其他-继续-内存1024-继续-现在创建虚拟硬盘-虚拟硬盘文件类型VDI-动态分配-8G-完成

选中新建的虚机-设置-存储-第一IDE控制器主通道-点左边的光盘小图标-弹出框选择centos的iso文件-OK

选中新建的虚机-启动-按引导安装centos

下载增强功能包:VBoxGuestAdditions_4.1.6.iso

在centos中依次执行:

yum update

yum install gcc

yum install kernel-devel

reboot

在virtualBox选中centos-设置-存储-第二IDE控制器主通道-点左边的光盘图标-弹出框选增强包的iso-确定

在centos中执行:mount -t auto /dev/cdrom /mnt

如果提示you must specify the filesystem type就把cdrom换成cdrom1重新执行

在centos中执行:

cd /mnt

sh ./VBoxLinuxAdditions.run

遇到过的问题:

1、遇到报错:Building the OpenGL support module Failed

    解决方法:export MAKE='/usr/bin/gmake -i'

2、又遇到报错:Installing the Window System drivers Failed

                           (Could not find the X.Org or XFree86 Window System.)

       on centos minimal, Xorg related errors are acceptable,所以就没管它

3、重启系统之后无法上网,解决方法:

      在virtualBox选中centos-设置-网络-桥接网卡(我觉得选网络地址转化应该也可以)

     在命令行中运行 dhclient eth0,这时将会自动分配ip给eth0,ping 百度可以ping通了。修改 /etc/sysconfig/network-scripts/ifcfg-eth0,将ONBOOT=no改为ONBOOT=yes,每次启动系统时默认分配IP

4、乱码、方块问题:yum install bitmap-fonts-cjk

0 0