STEP02 在虚拟机上进行挂接:mount -t vboxsf MyShareE /mnt/Share。执行该语句之后出现如下错误:
/sbin/mount.vboxsf: mounting failed with the error: No such deviceSTEP03 在网上搜索之后,发现出现该问题的原因是没有正确安装增强功能包。我们可用命令“lsmod | grep vboxsf”来检测是否成功安装该增强包。
如果已经正确安装到虚拟机上,执行该命令后,将出现如下显示:
linux-rwdx:~ # lsmod | grep vboxsf vboxsf 37328 1 vboxguest 195176 2 vboxsfSTEP04 该虚拟机上没有如上显示,所以打算重新安装增强功能包(Guest Additions)。
挂接增强功能包光盘后,到/mnt/cdrom目录下执行:./VBoxLinuxAdditions.run。发现有如下的错误(红色强调部分):
linux-rwdx:/mnt/cdrom # ./VBoxLinuxAdditions.run install Verifying archive integrity... All good. Uncompressing VirtualBox 4.2.0 Guest Additions for Linux.......... VirtualBox Guest Additions installer Removing installed version 4.2.0 of VirtualBox Guest Additions... Removing existing VirtualBox DKMS kernel modules done Removing existing VirtualBox non-DKMS kernel modules done Building the VirtualBox Guest Additions kernel modules Building the main Guest Additions module failed (Look at /var/log/vboxadd-install.log to find out what went wrong) Doing non-kernel setup of the Guest Additions done Installing the Window System drivers Installing X.Org 6.9/7.0 modules done Setting up the Window System to use the Guest Additions done You may need to restart the hal service and the Window System (or just restart the guest system) to enable the Guest Additions. Installing graphics libraries and desktop services components doneSTEP05 按照错误提示,到日志文件“/var/log/vboxadd-install.log”中查找原因。该日志中有如下错误提示:
linux-rwdx:/mnt/cdrom # cat /var/log/vboxadd-install.log /tmp/vbox.0/Makefile.include.header:115: *** Error: unable to find the include directory for your current Linux kernel. Specify KERN_INCL=根据此错误提示,推断应该是没有安装内核源代码,所以决定为该虚拟机重新安装Kernel。and run Make again. Stop. Creating user for the Guest Additions. Creating udev rule for the Guest Additions kernel module.
STEP02 从光盘启动后,在如下界面选择“Installation”。
STEP03 一路Next,到“Installation Mode”界面,选择安装类型。
因为我们是在已安装操作系统上补装LinuxKernel,所以选择“Update”安装模式。
STEP04 点击“Next”,进入“Installation Setting”界面。
STEP05 在上述界面中,点击“Packages”,进入安装包选择界面。选择过滤“Installation Sources”,然后右面的选择框中,选择“kernel-source”。
STEP06 点击“Accept”到如下确认界面,选择“Start Update”开始安装。
STEP07 成功安装后,我们再安装增强包,如下提示表明成功安装。
linux-rwdx:/mnt/cdrom # ./VBoxLinuxAdditions.run Verifying archive integrity... All good. Uncompressing VirtualBox 4.2.0 Guest Additions for Linux.......... VirtualBox Guest Additions installer Removing installed version 4.2.0 of VirtualBox Guest Additions... Removing existing VirtualBox DKMS kernel modules done Removing existing VirtualBox non-DKMS kernel modules done Building the VirtualBox Guest Additions kernel modules Building the main Guest Additions module done Building the shared folder support module done Not building the VirtualBox advanced graphics driver as this Linux version is too old to use it. Doing non-kernel setup of the Guest Additions done You should restart your guest to make sure the new modules are actually used Installing the Window System drivers Installing X.Org 6.9/7.0 modules done Setting up the Window System to use the Guest Additions done You may need to restart the hal service and the Window System (or just restart the guest system) to enable the Guest Additions. Installing graphics libraries and desktop services components done