First, use the root user to log on, or obtain the root permission in the terminal. Then install the gcc compiler. By default, the gcc compiler is not installed in CentOS. If it is already installed, ignore this step.
# Yum install gcc
Install the kernel-devel of the kernel version.
# Version = 'uname-a | awk' {print $3 }''
# Yum install kernel-devel-$ {version}
After the installation is complete, click "device"> "Install enhancement" in the menu bar of VBox to install the device. As we all know the steps, I will not explain them too much here.
Allocate Data Space
Add a data space in the VBox, then go to CentOS, and enter
# Lsmod | grep vboxvfs
Check whether vboxvfs is loaded. If no information is displayed, it indicates that it has been loaded. If not, execute
# Modprobe vboxvfs
Load. If loading fails, check whether the VBox enhancement function is successfully installed.
Mount the data space as follows. The command format is "mount-t vboxsf data space name local folder". For example, I allocated the root directory of the E disk to the virtual machine, and the data space name is E_DRIVE, mount the file to the local/mnt/host folder. You can enter
# Mount-t vboxsf E_DRIVE/mnt/host
After the execution is complete, the files under/mnt/host are the files in the root directory of the allocated edisk.
If you want to access the Windows folder after the machine is restarted, mount the file automatically after CentOS is restarted. Modify/etc/fstab and add the following content at the end of the file:
E_DRIVE/mnt/host vboxsf defaults 0 0
Save it.