首页 > 代码库 > virtual box实现centos和windows共享文件夹
virtual box实现centos和windows共享文件夹
今天在要实现centos(在virtualbox中)和windows实现共享文件夹的过程中遇到诸多错误,费了一下午时间来搞这个,首先配置共享文件夹的方法就不介绍了,这里面介绍的是在配置的过程中遇到的诸多错误
- 在VirtualBox的菜单里选择“设备”->“安装增强功能包(Install Guest Additions)”
- 之后桌面会出现一个光盘,在命令行里输入:
- cd /media/VBOXADDITIONS_4.3.12_93733/
- 然后输入sudo ./VBoxLinuxAdditions.run
- 然后神奇的事情发生了,在安装增强功能包的时候,就出现了错误,如下
- Building the main Guest Additions module [FAILED]
- (Look at /var/log/vboxadd-install.log to find out what went wrong)
- 思索着难道是VirtualBox版本过旧吗?于是更新VirtualBox,依然于事无补
- 于是进入日志查看发生了什么(/var/log/vboxadd-install.log)
- 日志里面这么写着(Error: unable to find the sources of your current Linux kernel.Specify KERN_DIR=<directory> and run Make again)
- 奇怪,这个玩意居然说不知道当前的linux kernel源,在一个外文网站发现老外遇到同样的问题,搞了n久之后终于起效,哎,痛苦的一笔。
- 先是试了如下命令:
- $ sudo yum updatethen
- $ sudo yum install kernel-devel gcc
- $ echo export KERN_DIR=/usr/src/kernels/`uname -r` >> ~/.bashrc
- 然后又试了如下命令:
- yum install kernel* dkms gcc
- Then
- yum install kernel-uek-devel
- Then reboot your machine
- 之后没有重启,试着重新安装增强功能包,依然错误,重启之后又试了这两个命令:yum install kernel* dkms gcc;yum install kernel-uek-devel,完事,安装增强功能包:
终于看到绿色的ok了,真是太不容易了,然后继续mount -t vboxsf linux_share /mnt/share,linux_share是在VirtualBox中设置的共享文件名,/mnt/share是centos中新建的文件夹,注意两个文件夹名字最后不要一样,防止出现其他错误。Installing additional modules ...Removing existing VirtualBox non-DKMS kernel modules [ OK ]Building the VirtualBox Guest Additions kernel modulesBuilding the main Guest Additions module [ OK ]Building the shared folder support module [ OK ]Building the OpenGL support module [ OK ]Doing non-kernel setup of the Guest Additions [ OK ]Starting the VirtualBox Guest Additions [ OK ]Installing the Window System driversInstalling X.Org Server 1.13 modules [ OK ]Setting up the Window System to use the Guest Additions [ OK ]You may need to restart the hal service and the Window System (or just restartthe guest system) to enable the Guest Additions. - 后来在测试的时候,我使用的是xshell,发现这玩意不支持中文,真是跪了,中国人太不容易了,特别是程序员,幸好在网上发现了这个,好东西啊,就要共享啊
- http://moralistxp.blog.163.com/blog/static/1161103982013112411540183/
- http://jingyan.baidu.com/article/3ea51489eca4b452e61bbaca.html
virtual box实现centos和windows共享文件夹
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。