installing and using virtual box on centos

Upload: maaaizz

Post on 06-Apr-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/3/2019 Installing and Using Virtual Box on CentOS

    1/4

    Installing and using VirtualBox on CentOS

    VirtualBox(VB) development is progressing rapidly and the information on this page may beoutdated. TheLinux Downloads pagenow has yum repo configs. Unfortunately the RPM

    packages (currently version 3.2.12 or specifically VirtualBox-3.2-3.2.12_68302_rhel5-1) do nothandle major version upgrades gracefully. The built-in update notifications when running VB arealso deficient and will only notify of minor updates (i.e. 3.2.0->3.2.4), if that, and not more

    major version upgrades (i.e. 2->3, 3.0>3.1, 3.1>3.2). For now, older versions should be

    uninstalled before installing a new major version or the package upgrade will encounter RPMconflicts. TheVB user manualshould be read carefully; however, at this writing it does not do a

    good job of addressing RPM installations. See the VB site for the latest details. The good news is

    that the new versions have significant improvements and new features, and backwards

    compatibility with existing VMs has been excellent.

    VirtualBox-4.0 (currently VirtualBox-4.0-4.0.10_72479_rhel6-1) has now been released. Toget full 4.0 functionality you may also need the VirtualBox Extension Pack which provides

    support for USB 2.0 devices, and RDP and PXE boot for Intel cards.VirtualBox-4.1 (currently VirtualBox-4.1-4.1.2_73507_rhel6-1) has been released.

    Please note that VirtualBox is a product ofOracle Corporation(which acquired theformer provider Sun Microsystems). It is not provided nor supported by CentOS,

    although questions may be answered on theForaorvirtualization mailing lists.

    Contents

    1. What is VirtualBox?2. Why use VirtualBox?3. Installing VirtualBox4. Running VirtualBox5. Making USB Work in VirtualBox

    1. What is VirtualBox?

    VirtualBoxis a set of x86 virtualization products for various OS platforms. It is a machine /

    hardware virtualization product, or hypervisor, similar in function toVMware Server,ParallelsWorkstation,QEMU,KVM, andXenand can support a variety of guest operating systems

    including but not limited to Windows (NT 4.0, 2000, XP, Server 2003, Vista), DOS/Windows

    3.x, Linux (2.4 and 2.6), Solaris and OpenSolaris, and OpenBSD. Its proponents claim it to be"the only professional solution that is freely available as Open Source Software under the termsof the GNU General Public License (GPL)"

    VirtualBox is available on a variety of platforms in "native" packages. This includes i386 andAMD64 (x86_64) RPM packages for RHEL4/RHEL5/RHEL6 that should work on CentOS-

    4/5/6 (or Scientific Linux and other RHEL derivatives); as well as .deb packages for Debian,

    Ubuntu and derivatives; Mac OS-X; Windows; Solaris and OpenSolaris; and as source.

    http://www.virtualbox.org/http://www.virtualbox.org/http://www.virtualbox.org/wiki/Linux_Downloadshttp://www.virtualbox.org/wiki/Linux_Downloadshttp://www.virtualbox.org/wiki/Linux_Downloadshttp://www.virtualbox.org/manual/UserManual.htmlhttp://www.virtualbox.org/manual/UserManual.htmlhttp://www.virtualbox.org/manual/UserManual.htmlhttp://www.oracle.com/http://www.oracle.com/http://www.oracle.com/http://www.centos.org/modules/newbb/http://www.centos.org/modules/newbb/http://www.centos.org/modules/newbb/http://www.centos.org/modules/tinycontent/index.php?id=16http://www.centos.org/modules/tinycontent/index.php?id=16http://www.centos.org/modules/tinycontent/index.php?id=16http://wiki.centos.org/HowTos/Virtualization/VirtualBox?highlight=%28virtualbox%29#head-2a2fdb21ed9045d00b03d98f5e1966ce06bb30behttp://wiki.centos.org/HowTos/Virtualization/VirtualBox?highlight=%28virtualbox%29#head-2a2fdb21ed9045d00b03d98f5e1966ce06bb30behttp://wiki.centos.org/HowTos/Virtualization/VirtualBox?highlight=%28virtualbox%29#head-2a2fdb21ed9045d00b03d98f5e1966ce06bb30behttp://wiki.centos.org/HowTos/Virtualization/VirtualBox?highlight=%28virtualbox%29#head-2a2fdb21ed9045d00b03d98f5e1966ce06bb30behttp://wiki.centos.org/HowTos/Virtualization/VirtualBox?highlight=%28virtualbox%29#head-b4cf4619fcdae295377613d03cf03499d52716dahttp://wiki.centos.org/HowTos/Virtualization/VirtualBox?highlight=%28virtualbox%29#head-b4cf4619fcdae295377613d03cf03499d52716dahttp://wiki.centos.org/HowTos/Virtualization/VirtualBox?highlight=%28virtualbox%29#head-b4cf4619fcdae295377613d03cf03499d52716dahttp://wiki.centos.org/HowTos/Virtualization/VirtualBox?highlight=%28virtualbox%29#head-b4cf4619fcdae295377613d03cf03499d52716dahttp://wiki.centos.org/HowTos/Virtualization/VirtualBox?highlight=%28virtualbox%29#head-81de410879b8e7f18a127f638160e036ab99684ehttp://wiki.centos.org/HowTos/Virtualization/VirtualBox?highlight=%28virtualbox%29#head-81de410879b8e7f18a127f638160e036ab99684ehttp://wiki.centos.org/HowTos/Virtualization/VirtualBox?highlight=%28virtualbox%29#head-81de410879b8e7f18a127f638160e036ab99684ehttp://wiki.centos.org/HowTos/Virtualization/VirtualBox?highlight=%28virtualbox%29#head-3f092911812fac788d25bd5be947ea94b88a7e47http://wiki.centos.org/HowTos/Virtualization/VirtualBox?highlight=%28virtualbox%29#head-3f092911812fac788d25bd5be947ea94b88a7e47http://wiki.centos.org/HowTos/Virtualization/VirtualBox?highlight=%28virtualbox%29#head-3f092911812fac788d25bd5be947ea94b88a7e47http://wiki.centos.org/HowTos/Virtualization/VirtualBox?highlight=%28virtualbox%29#head-dbe9c20daf036345ef3d45677d9888249adab5ebhttp://wiki.centos.org/HowTos/Virtualization/VirtualBox?highlight=%28virtualbox%29#head-dbe9c20daf036345ef3d45677d9888249adab5ebhttp://wiki.centos.org/HowTos/Virtualization/VirtualBox?highlight=%28virtualbox%29#head-dbe9c20daf036345ef3d45677d9888249adab5ebhttp://www.virtualbox.org/http://www.virtualbox.org/http://www.vmware.com/products/server/http://www.vmware.com/products/server/http://www.vmware.com/products/server/http://www.paralles.com/en/products/workstation/http://www.paralles.com/en/products/workstation/http://www.paralles.com/en/products/workstation/http://www.paralles.com/en/products/workstation/http://www.qemu.org/http://www.qemu.org/http://www.qemu.org/http://kvm.qumranet.com/http://kvm.qumranet.com/http://kvm.qumranet.com/http://en.wikipedia.org/wiki/Xenhttp://en.wikipedia.org/wiki/Xenhttp://en.wikipedia.org/wiki/Xenhttp://en.wikipedia.org/wiki/Xenhttp://kvm.qumranet.com/http://www.qemu.org/http://www.paralles.com/en/products/workstation/http://www.paralles.com/en/products/workstation/http://www.vmware.com/products/server/http://www.virtualbox.org/http://wiki.centos.org/HowTos/Virtualization/VirtualBox?highlight=%28virtualbox%29#head-dbe9c20daf036345ef3d45677d9888249adab5ebhttp://wiki.centos.org/HowTos/Virtualization/VirtualBox?highlight=%28virtualbox%29#head-3f092911812fac788d25bd5be947ea94b88a7e47http://wiki.centos.org/HowTos/Virtualization/VirtualBox?highlight=%28virtualbox%29#head-81de410879b8e7f18a127f638160e036ab99684ehttp://wiki.centos.org/HowTos/Virtualization/VirtualBox?highlight=%28virtualbox%29#head-b4cf4619fcdae295377613d03cf03499d52716dahttp://wiki.centos.org/HowTos/Virtualization/VirtualBox?highlight=%28virtualbox%29#head-2a2fdb21ed9045d00b03d98f5e1966ce06bb30behttp://www.centos.org/modules/tinycontent/index.php?id=16http://www.centos.org/modules/newbb/http://www.oracle.com/http://www.virtualbox.org/manual/UserManual.htmlhttp://www.virtualbox.org/wiki/Linux_Downloadshttp://www.virtualbox.org/
  • 8/3/2019 Installing and Using Virtual Box on CentOS

    2/4

    2. Why use VirtualBox?

    While not as efficient as operating system-level virtualization based on a modified Linux kernellikeXen,KVM,OpenVZ, orVserverit is easy to install and use. Benefits include:

    1. Available in RPM packages2. Activecommunitysupport3. Runs a variety of guest OS's4. Good access to hardware including sound, USB, and serial ports5. Available on a number of host OS's6. Allows running Redmond OSs and applications without messing up your computer or

    dual-booting

    3. Installing VirtualBox

    The (VirtualBox) website has a lot of qualitydocumentationincluding:

    End-user documentation Technical documentation Source code repository timeline List of changes (changelog)

    This article will briefly cover the installation process. Both i386 and AMD64 (x86_64) versions

    are available.

    You will need to be the root user for the following tasks. Login to a root shell or "su -" in a

    terminal window.

    DownloadtheRHEL repo config.

    Note: As an alternative, you may choose to download and install individual RPMS ratherthan configuring the repository. That procedure is documented on the VB web site and

    will not be covered here.

    cd /etc/yum.repos.d

    wget http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo

    Optionally add a line "enabled=0" if you do not want the repo enabled by default. Thiswill require adding "--enablerepo virtualbox" to yum commands to access the repo.

    The installation of VB will require the building of kernel modules. If DKMS (Dynamic KernelModule Support) is installed it will be used and will simplify kernel upgrades. Installing DKMS

    fromRPMforgeor EPEL repository is recommended before installing VirtualBox. Don't forget

    to configure theyum-prioritiesplugin. Installing DKMS will pull in required developmentdependencies.

    http://wiki.centos.org/HowTos/Xen/InstallingCentOSDomUhttp://wiki.centos.org/HowTos/Xen/InstallingCentOSDomUhttp://wiki.centos.org/HowTos/Xen/InstallingCentOSDomUhttp://wiki.centos.org/HowTos/KVMhttp://wiki.centos.org/HowTos/KVMhttp://wiki.centos.org/HowTos/KVMhttp://wiki.centos.org/HowTos/Virtualization/OpenVZhttp://wiki.centos.org/HowTos/Virtualization/OpenVZhttp://wiki.centos.org/HowTos/Virtualization/OpenVZhttp://wiki.centos.org/HowTos/Virtualization/Vserverhttp://wiki.centos.org/HowTos/Virtualization/Vserverhttp://wiki.centos.org/HowTos/Virtualization/Vserverhttp://www.virtualbox.org/wiki/Communityhttp://www.virtualbox.org/wiki/Communityhttp://www.virtualbox.org/wiki/Communityhttp://www.virtualbox.org/http://www.virtualbox.org/http://www.virtualbox.org/http://www.virtualbox.org/wiki/Documentationhttp://www.virtualbox.org/wiki/Documentationhttp://www.virtualbox.org/wiki/Documentationhttp://www.virtualbox.org/wiki/Linux_Downloadshttp://www.virtualbox.org/wiki/Linux_Downloadshttp://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repohttp://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repohttp://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repohttp://wiki.centos.org/AdditionalResources/Repositories/RPMForgehttp://wiki.centos.org/AdditionalResources/Repositories/RPMForgehttp://wiki.centos.org/AdditionalResources/Repositories/RPMForgehttp://wiki.centos.org/PackageManagement/Yum/Prioritieshttp://wiki.centos.org/PackageManagement/Yum/Prioritieshttp://wiki.centos.org/PackageManagement/Yum/Prioritieshttp://wiki.centos.org/PackageManagement/Yum/Prioritieshttp://wiki.centos.org/AdditionalResources/Repositories/RPMForgehttp://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repohttp://www.virtualbox.org/wiki/Linux_Downloadshttp://www.virtualbox.org/wiki/Documentationhttp://www.virtualbox.org/http://www.virtualbox.org/wiki/Communityhttp://wiki.centos.org/HowTos/Virtualization/Vserverhttp://wiki.centos.org/HowTos/Virtualization/OpenVZhttp://wiki.centos.org/HowTos/KVMhttp://wiki.centos.org/HowTos/Xen/InstallingCentOSDomU
  • 8/3/2019 Installing and Using Virtual Box on CentOS

    3/4

  • 8/3/2019 Installing and Using Virtual Box on CentOS

    4/4

    In GNOME or KDE run under "Applications / System Tools / Oracle VM VirtualBox"Accept the license, optionally register, and create a new VM. VMware virtual machines should

    be usable with Virtual box. Google "vmware to virtualbox" for information.

    Help is available from the menu oronline.

    5. Making USB Work in VirtualBox

    VirtualBox requires the user have write access to "usbfs" devices for USB access. As root

    perform the following:

    mkdir /vbusbfs

    echo "none /vbusbfs usbfs rw,devgid=$(awk -F : '/vboxusers/ {print $3}'

    /etc/group),devmode=664 0 0" >> /etc/fstab

    mount -a

    If running CentOS as a guest OS in a VM the same development and DKMS packagesshould be installed in the VM prior to installing VBox Guest Additions.

    Enjoy!

    http://www.virtualbox.org/wiki/Communityhttp://www.virtualbox.org/wiki/Communityhttp://www.virtualbox.org/wiki/Communityhttp://www.virtualbox.org/wiki/Community