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 |