VirtualBox概况 对于 VMWare、Virtual PC 这些虚拟机软件,可能大家都比较熟悉。VirtualBox也是一款虚拟机软件。VirtualBox 是一款功能强大的 x86 虚拟机软件,它不仅具有丰富的特色,而且性能也很优异。更可喜的是,VirtualBox 于数日前走向开源,成为了一个发布在 GPL 许可之下的自由软件。VirtualBox 可以在 Linux 和 Windows 主机中运行,并支持在其中安装 Windows (NT 4.0、2000、XP、Server 2003、Vista)、DOS/Windows 3.x、Linux (2.4 和 2.6)、OpenBSD 等系列的客户操作系统。
官方地址:
http://www.virtualbox.org/
Creating group 'vboxusers'. VM users must be member of that group!
No precompiled module for this kernel found -- trying to build one. Messages
emitted during module compilation will be logged to /var/log/vbox-install.log.
Success!
把打算使用的用户添加安装vboxusers用户组里
[root@xingke disk1]#sudo usermod -a -G vboxusers username
经过上述几个步骤,VirtualBox在centos5上以成功安装
添加网卡桥接功能 先安装桥接使用工具
[root@xingke ~]# yum -y install bridge-utils
Loading "fastestmirror" plugin
Loading mirror speeds from cached hostfile
* base: 192.168.3.13
* updates: 192.168.3.13
* addons: 192.168.3.13
* extras: 192.168.3.13
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package bridge-utils.i386 0:1.1-2 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
bridge-utils i386 1.1-2 base 27 k
vi /etc/sysconfig/network-scripts/ifcfg-eth0
.
//此处省略
.
BRIDGE=br0
然后重启网络
sudo /sbin/service network restart
增加桥接的主机网卡
[root@xingke ~]# VBoxAddIF vbox0 root br0 <--此处的root是网卡用户帐号,谁可以使用此网卡,这里我用了root
VirtualBox host networking interface creation utility, version 2.0.2
(C) 2005-2007 Sun Microsystems, Inc.
All rights reserved.
Creating the permanent host networking interface "vbox0" for user root.
Failed to add the interface "vbox0" to the bridge "br0".
Make sure that the bridge exists and that you currently have sufficient
permissions to do this.
[root@xingke ~]#
添加虚拟客户机
运行VirtualBox
[root@xingke ~]#VirtualBox
其他的按一般的虚拟主机设置,特别的地方是网卡,附上一截图
Attached to选择host interface
interface name填写上面新建的vbox0
才可以使用到桥接功能
安装鼠标增强组件 安装后需要安装格外的一个增强组件,可以在主机和客户机鼠标方便移动
lihaixin@lihaixin-desktop:~$ sudo /media/cdrom/VBoxLinuxAdditions-x86.run
[sudo] password for lihaixin:
Verifying archive integrity... All good.
Uncompressing VirtualBox 2.0.2 Guest Additions for Linux installation.........................................................................................................................................................................................
VirtualBox 2.0.2 Guest Additions installation
Building the VirtualBox Guest Additions kernel module...
Building the shared folder support kernel module...
Installing the VirtualBox Guest Additions...
Successfully installed the VirtualBox Guest Additions.
You must restart your guest system in order to complete the installation.
lihaixin@lihaixin-desktop:~$