VirtualBox共享文件夹失败

摘要:
有关安装VirtualBox和虚拟机的方法,请参阅本博客中的其他文章。1--无法安装共享文件夹并检查错误STEP01在虚拟机上的VirtualBox上设置共享文件夹的名称:STEP02钩子:发现此问题的原因是未正确安装增强功能包。检测增强包是否已成功安装。因此,决定为虚拟机重新安装内核。2-安装Linux内核源代码STEP01。将虚拟机的CD-ROM驱动器指向安装CD。
VirtualBox是个不错的虚拟机,今天打算从VMWare迁移到VirtualBox。安装VirtualBox和虚拟机的方法请参照本博客的其他文章,这里重点说下,在安装共享文件夹时的一个失败原因。
1 -- 安装共享文件夹失败现象以及查错
STEP01 在VirtualBox上设置共享文件夹名称:MyShareE,该共享文件夹指向主机的“E:/Share”目录。
STEP02 在虚拟机上进行挂接:mount -t vboxsf MyShareE /mnt/Share。执行该语句之后出现如下错误:
/sbin/mount.vboxsf: mounting failed with the error: No such device
STEP03 在网上搜索之后,发现出现该问题的原因是没有正确安装增强功能包。我们可用命令“lsmod | grep vboxsf”来检测是否成功安装该增强包。
如果已经正确安装到虚拟机上,执行该命令后,将出现如下显示:
linux-rwdx:~ # lsmod | grep vboxsf
vboxsf                 37328  1 
vboxguest             195176  2 vboxsf
STEP04 该虚拟机上没有如上显示,所以打算重新安装增强功能包(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         done
STEP05 按照错误提示,到日志文件“/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= and run Make again.  Stop.
Creating user for the Guest Additions.
Creating udev rule for the Guest Additions kernel module.
根据此错误提示,推断应该是没有安装内核源代码,所以决定为该虚拟机重新安装Kernel。
2 -- 安装Linux内核源代码
STEP01 将虚拟机的光驱指向安装光盘,让系统从光盘启动。
cc
STEP02 从光盘启动后,在如下界面选择“Installation”。
bb
STEP03 一路Next,到“Installation Mode”界面,选择安装类型。
因为我们是在已安装操作系统上补装LinuxKernel,所以选择“Update”安装模式。
2
STEP04 点击“Next”,进入“Installation Setting”界面。
3
STEP05 在上述界面中,点击“Packages”,进入安装包选择界面。选择过滤“Installation Sources”,然后右面的选择框中,选择“kernel-source”。
4
STEP06 点击“Accept”到如下确认界面,选择“Start Update”开始安装。
5
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

免责声明:文章转载自《VirtualBox共享文件夹失败》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇何为硬件设计?CSS学习:overflow:hidden解决溢出,坍塌,清除浮动下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

在CentOS下源码安装 Xen并搭建Windows虚拟机

前言首先要感谢xing的帮助,在他的指导之下才完成环境的搭建,本文档的部分内容来自他的文档。另外,还要感谢——互联网。   1.       环境介绍Linux: CentOS 6.3 Xen: Xen 4.1.3 Windows: XP 或 2003 2.       安装CentOS从官网下载CentOS 6.3镜像: http://www.cent...

虚拟化技术实现 — QEMU-KVM

目录 文章目录 目录 前文列表 KVM QEMU QEMU-KVM QEMU-KVM 调用 KVM 内核模块启动虚拟机的流程概要 前文列表 《虚拟化技术实现 — 虚拟化技术发展编年史》 KVM KVM(Kernel-based Virtual Machine,基于内核的虚拟机)是一种用于 Linux 内核中的虚拟化基础设施。本质是一个嵌入到 Lin...

virtualbox结合nat和host-only设置固定ip的环境

需求 平时在做一些实验或学习的时候,比如rocketmq、kafaka、zookeeper等,需要在虚拟机上创建几个虚拟机组成集群来做实验;一般有几个要求: 虚拟机能访问网络,需要下载安装东西 虚拟机的ip需要固定;不然在虚拟机重启或者电脑从家里拿到办公室的时候,ip变了,又要一个个进命令行去看ip,然后改代码里的配置,麻烦的很 虚拟机之间能互相访问,集...

Windows10电脑安装macOS Mojave系统的方法(最新版系统,含超详细步骤截图)

一、环境及准备工作 1、主机系统:本人系统是Windows10家庭中文版 2、虚拟机软件:VMware Workstation 14 Pro      虚拟机版本号:14.1.1 build-7528167 虚拟机下载网址:https://my.vmware.com/web/vmware/details?productId=686&rPId=254...

kali 2.0 安装VMware Tools

虽然这不是一个多么困难的,或者有技术含量的文章,但是看到身边确实有不少新手朋友会遇到这个问题来求助,我百度了一下,要么讲的太复杂,要么实施起来存在问题,清晰、简单的文章确实没看到,所以写了这么一篇文章,因为我是一个比较笨的人,别人一个地方没有写清楚,我可能就看不太懂了,所以这篇文章写的非常详尽,希望可以给需要的朋友提供一点帮助。 我的环境: 系统:kali...

虚拟机下CentOS7开启SSH连接

在虚拟机(Vmware Workstation)下,安装了CentOS7,现在想通过SSH工具连接虚拟机中的CentOS7 1、  首先,要确保CentOS7安装了  openssh-server,在终端中输入  yum list installed | grep openssh-server 此处显示已经安装了  openssh-server,如果又没...