简介

VirtualBox 是一款开源虚拟机软件。VirtualBox 是由德国 Innotek 公司开发,由Sun Microsystems公司出品的软件,使用Qt编写,在 Sun 被 Oracle 收购后正式更名成 Oracle VM VirtualBox。Innotek 以 GNU General Public License (GPL) 释出 VirtualBox,并提供二进制版本及 OSE 版本的代码。使用者可以在VirtualBox上安装并且执行SolarisWindowsDOSLinux、OS/2 Warp、BSD等系统作为客户端操作系统。现在则由甲骨文公司进行开发,是甲骨文公司xVM虚拟化平台技术的一部份。

VirtualBox号称是最强的免费虚拟机软件,它不仅具有丰富的特色,而且性能也很优异!它简单易用,可虚拟的系统包括Windows(从Windows 3.1到Windows10、Windows Server 2012,所有的Windows系统都支持)、Mac OS X、Linux、OpenBSDSolaris、IBM OS2甚至Android等操作系统!使用者可以在VirtualBox上安装并且运行上述的这些操作系统! 与同性质的VMware及Virtual PC比较下,VirtualBox独到之处包括远端桌面协定(RDP)、iSCSI及USB的支持,VirtualBox在客户端操作系统上已可以支持USB 2.0的硬件装置,不过要安装 VirtualBox Extension Pack。

-- 来自百度百科

centos 6.x 安装 virtual box

整个安装过程主要是参考如下博客。

https://tecadmin.net/install-oracle-virtualbox-on-centos-redhat-and-fedora/

Oracle VirtualBox is a cross-platform virtualization application. It installs on your existing Intel or AMD-based computers, whether they are running Windows, Mac, Linux or Solaris operating systems. It extends the capabilities of your existing computer so that it can run multiple operating systems at the same time. Click hereto read more about VirtualBox

Oracle has released its new major version VirtualBox 6.0.4 . In this release VirtualBox has improves stability and fixes regressions. To read more about this release read changelog. This article will help you to install Oracle VirtualBox 6.0 on CentOS and Redhat systems using Yum.

Step 1 – Add Required Yum Repositories

Firstly you are required to add VirtualBox yum repository in your system. Download repository file from its official site and place it under at /etc/yum.repos.d/virtualbox.repo .First navigate to /etc/yum.repos.d/ directory and use one of below commands as per your operating system.

cd /etc/yum.repos.d/
wget http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo

The CentOS and RedHat users also required to add EPEL yum repository using one of the following commands.

### On CentOS/RHEL 7 ###
rpm -Uvh http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm ### On CentOS/RHEL 6 ###
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

Step 2 – Install Required Packages

Before installing VirtualBox make sure to install all required packages to run VirtualBox like kernel-headers, kernel-devels etc. Use the following command to install the required packages.

yum install gcc make patch  dkms qt libgomp
yum install kernel-headers kernel-devel fontforge binutils glibc-headers glibc-devel

After installing latest kernel and kernel headers, let’s reboot your system and start with Latest kernel.

reboot

Step 3 – Setup Environment Variable

VirtualBox installation required kernel source code to install required modules, So we need to configure environment variable KERN_DIR to which VirtualBox get kernel source code. In my case latest kernel source is available in 2.6.32-504.3.3.el6.x86_64 directory under /usr/src/kernels/ . Make sure you are using correct source path.

export KERN_DIR=/usr/src/kernels/`uname -r`

Step 4 – Install Oracle VirtualBox and Setup

Use the following command to install VirtualBox using the yum command line tool. It will install the latest version of VirtualBox 5.2 on your system.

yum install VirtualBox-6.0

要开始重新编译 kernel 模块,还要安装下面的软件

sudo yum install kernel-devel kernel-devel-2.6.32-754.el6.x86_64

After installation, we need to rebuild kernel modules using the following command.

service vboxdrv setup

Step 5 – Launch VirtualBox

Use following command to start VirtualBox from X windows. You can switch to GUI mode using init 5 or startx commands from terminal.

virtualbox

virtual box 中安装 centos 6 minimum 镜像

安装镜像

镜像地址: https://mirror.tuna.tsinghua.edu.cn/#

我选的是 centos 6.10 minimum

https://mirror.tuna.tsinghua.edu.cn/centos/6.10/isos/x86_64/CentOS-6.10-x86_64-minimal.iso

在安装时,网络模式,我选择的是桥接模式

网络设置

在 virtualbox 中安装好 centos minium 后,默认是没有开启网络的,需要自己设置。

开启网络的操作,主要是参考下面链接

https://unix.stackexchange.com/questions/78295/centos-no-network-interface-after-installation-in-virtualbox/78305#78305

核心操作是编辑文件 /etc/sysconfig/network-scripts/ifcfg-eth0

设置下面字段

ONBOOT="yes"
NM_CONTROLLED="no"

桥接模式,设置静态 ip

选择了桥接模式,但是每次启动 centos 后 ip 地址老变,需要将 ip 地址固定住。

参考链接如下 https://blog.csdn.net/qq_25166683/article/details/83211617

当前 nn02 上的网络配置如下。 文件/etc/sysconfig/network-scripts/ifcfg-eth0

BOOTPROTO=static
IPADDR=192.168.1.222
NETMASK=255.255.255.0
GATEWAY=192.168.1.255
DNS1=114.114.114.114 DEVICE=eth0
HWADDR=08:00:27:5E:74:AE
TYPE=Ethernet
UUID=1ee603a9-d6dd-460c-86c2-a74e739193be
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=static
NAME=eth0

重启网络服务后,就会发现 ip 地址固定为 192.168.1.222 了。

最新文章

  1. PAT 1050. 螺旋矩阵(25)
  2. jquery.nicescroll完美滚动条使用方法
  3. HTML5图片旋转
  4. jdbc连接集合
  5. Linux下用rpm方式安装MySQL
  6. 工程和界面—Webstorm入门指南 Webstorm中的工程-备
  7. Cocos2d-x C++调用Android弹出提示框
  8. mysql_MYSQL远程登录权限设置
  9. AngularJS复习------表单验证
  10. C#/AutoCAD 2018/ObjectArx/二次开发再说实体(六)
  11. 嵌入页面的几种方法(转载自萤火虫小Q)
  12. IDL打包发布exe(包含ENVI环境)
  13. [转帖]前端-chromeF12 谷歌开发者工具详解 Sources篇
  14. AI 玩法整理
  15. fcn+caffe+siftflow实验记录
  16. element-ui <el-input> +<el-tree>使用
  17. 二维数组转化为一维数组 contact 与apply 的结合
  18. Linux启动报:UNEXPECTED INCONSISTENCY: RUN fsck MANUALLY问题解决
  19. Centos7安装配置Apache+PHP+Mysql+phpmyadmin
  20. 差值的再议-Hermite差值

热门文章

  1. 什么是uni-app?
  2. P3396 哈希冲突(思维+方块)
  3. Node.js之删除文件夹(含递归删除)
  4. git之fatal: Could not read from remote repository
  5. Spring的异步方法
  6. Nginx简单配置几个基于端口的虚拟主机
  7. vi中使用删除键(backspace)只能删除到行首不能跳到上一行怎么处理?
  8. PHP 发送 POST 值到任意 url
  9. Spring 整合 myBatis
  10. Mac删除自带的abc输入法