设为首页 收藏本站
查看: 1486|回复: 0

[经验分享] VirtualBox共享文件夹失败

[复制链接]

尚未签到

发表于 2015-4-14 07:59:46 | 显示全部楼层 |阅读模式
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 将虚拟机的光驱指向安装光盘,让系统从光盘启动。
DSC0000.png
STEP02 从光盘启动后,在如下界面选择“Installation”。
DSC0001.png
STEP03 一路Next,到“Installation Mode”界面,选择安装类型。
因为我们是在已安装操作系统上补装LinuxKernel,所以选择“Update”安装模式。
DSC0002.png
STEP04 点击“Next”,进入“Installation Setting”界面。
DSC0003.png
STEP05 在上述界面中,点击“Packages”,进入安装包选择界面。选择过滤“Installation Sources”,然后右面的选择框中,选择“kernel-source”。
DSC0004.png
STEP06 点击“Accept”到如下确认界面,选择“Start Update”开始安装。
DSC0005.png
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

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-56887-1-1.html 上篇帖子: 用Windows+VirtualBox搭建嵌入式Linux开发环境 下篇帖子: VirtualBox设置NAT端口映射
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表