CentOS7 Installation VirtualBox Auxiliary Kit
Transfer from https://segmentfault.com/a/1190000006233585 to manually load vboxguestadditions CD image
In the VirtualBox package, there is a Vboxguestadditions.iso file, the previous step of the Devices menu click Insert is to load the image, but do not know why the failure, so I was ready to manually load him.
First, find VirtualBox in the Finder-application, right-click, and select Display package content. Go to contents/macos/, find the Vboxguestadditions.iso, and copy it to the desktop.
You can also copy to the desktop at the end of the terminal with the command below.
Mount this image to the VirtualBox virtual CD drive, and if you have started the system, you can load it in the following way.
Perhaps you will appear the following error, click Details, you can see the mount is unsuccessful. Then click Force unmount ignore him.
Of course, we still have to click on that disc to confirm that the ISO has been put into the virtual drive device.
At this point, I figured out why the default menu installation for VirtualBox would fail because, in the VirtualBox setting, we put the optical drive under the IDE controller, as shown below
IDE devices in the Linux system, the default should be HD-led devices, such as hda,hdb ..., but the CentOS7 for most of the server devices, the server is generally not using the IDE controller, but the use of more advanced SCSI as a hard disk and other peripheral interfaces. Because it is a virtual machine, CentOS is also recognized as a SCSI device on the IDE device, so it appears as sr0 in the system. We can view it with the LSSCSI command to see the virtual device we are connected to.
Because we hang the optical drive under the IDE controller, the VirtualBox default mount command should be mount/dev/hda/media/cdrom this type, and the HDA device cannot be found, and the mount fails. Below, we modify the Mount command as follows (requires root permission):
Mkdir/media/cdrom
Mount/dev/sr0/media/cdrom
The following prompts indicate that the mount was successful. Enter the/media/cdrom directory to view the relevant files.
Perform the following command to install the Vboxguestadditions enhancement pack
./vboxlinuxadditions.run
After successful operation, the screenshot is as follows:
Perhaps, you may run into an unsuccessful situation, especially if you install by default the CentOS 7 mini version.
So before you execute./vboxlinuxadditions.run, you need to do the following. vboxguestadditions Dependency Pack installation
Because Vboxguestadditions compilation will have a lot of package dependencies, you need to install those package dependencies first.
In particular, the support package requires the Linux kernel to provide some functionality, which requires the kernel C header to compile the program, that is, the need to install the Linux-devel tool. Of course, Kernel-devel is not just a C Header file, it has kernel configuration files, and other development data.
If you are have installed new setup of CentOS minimal or you haven ' t installed yet, for your need make, GCC, kernel-devel in order To Install VirtualBox Guest Additions installation script.
On centos/red Hat (RHEL) 6/5, Epel repo is needed
# # CentOS 6 and Red Hat (RHEL) 6 # #
RPM-UVH http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# # CentOS 5 and Red Hat (RHEL) 5 # #
RPM-UVH http://dl.fedoraproject.org/pub/epel/5/i386/ epel-release-5-4.noarch.rpm
CentOS7 can be upgraded directly to install the following packages
Yum update
yum install gcc kernel-devel kernel-headers dkms make bzip2
reboot
Next, like the previous steps, hang the CDROM and execute the installer (run Install command requires root permissions):
CD media
mkdir cdrom
mount/dev/sr0/media/cdrom
cd/media/cdrom
./vboxlinuxadditions.run
If you do not want to appear xrog warning reminders, you can add parameters--nox11
./vboxlinuxadditions.run--nox11
If there are other errors, see the error message after the command is executed. If you only want to run under CentOS minimal, because there is no graphical component, Xorg can be accepted.
Then, reboot the device and the enhanced package is installed successfully.
Reboot
Reproduced above for the content.
If there is still a problem, it may be the missing reason for ncurses Ncurses-devel and the # yum install kernel kernel-devel (yum kernel-devel files are not actually compiled).
I've been looking for this for one hours before I found out.
# yum Install ncurses ncurses-devel
# yum Install kernel Kernel-devel