CentOS command line installation VirtualBox detailed

Source: Internet
Author: User

Add VirtualBox Source

The code is as follows Copy Code

Cd/etc/yum.repos.d
wget Http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo


Add Rpmforge Source

The code is as follows Copy Code

Cd
wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-1.el6.rf.x86_64.rpm
RPM-IVH rpmforge-release-0.5.2-1.el6.rf.x86_64.rpm

Installation dependencies

The code is as follows Copy Code

Yum--enablerepo rpmforge Install dkms
Yum Groupinstall "Development Tools"
Yum Install Kernel-devel

Install VirtualBox

The code is as follows Copy Code

Yum Install VirtualBox-4.1

The system has a bug, fix it.

error! Your kernel headers for kernel 2.6.32-71.el6.x86_64 cannot is found at
/lib/modules/2.6.32-71.el6.x86_64/build Or/lib/modules/2.6.32-71.el6.x86_64/source.
[FAILED]
(Failed, trying without dkms)
recompiling VirtualBox kernel modules [FAILED]
(Look at/var/log/vbox-install.log to find out what went wrong)

The code is as follows Copy Code
cd/lib/modules/modules/2.6.32-71.el6.x86_64/
Ln-s/usr/src/kernels/2.6.32-220.23.1.el6.x86_64/build
/ETC/INIT.D/VBOXDRV Setup

Android virtual machine Windows Server 2003
Because CentOS does not have a desktop, you need to install a Windows Server 2003 on your own computer, run it and configure it, turn off the virtual machine, copy the corresponding VDI files to the server, and the server's newly created virtual machine will use the file directly as a hard drive

The code is as follows Copy Code

Vboxmanage createvm--name server2003--ostype Windows2003--register--basefolder/mydata/vms/
Vboxmanage MODIFYVM server2003--memory--accelerate3d off--nic1 bridged--bridgeadapter1 eth0
Vboxmanage storagectl server2003--name IDE--add IDE--controller PIIX4--bootable on
Vboxmanage Storageattach server2003--storagectl IDE--type HDD--port 0--device 0--medium/mydata/vms/server2003/serve R2003.vdi

Start a virtual machine

The code is as follows Copy Code

Vboxmanage STARTVM Server2003-type Headless

Force shutdown Virtual Machine

The code is as follows Copy Code

Vboxmanage CONTROLVM server2003 Poweroff

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.