看了很多文章,都没找到真正原因,一片文章诠释了一切。
http://blog.163.com/xhy_cy/blog/static/1049762320113167205787/
共享设置步骤:
1.安装vitualBox增强包,注意,这里,我的主机的windows,虚拟机是RHEL5.5,在window下通过虚拟光驱将C盘virtualbox下面的增强包iso文件载入镜像,RHEL下会自动挂在镜像,复制镜像文件,修改权限 chmod a+x X.run文件,安装。
2.安装过程出现如下错误:
注意上图中的失败选项,查看日志,日志文件如下:
-------------------------------------------------------------------------------------------------------------------------------------------------
/tmp/vbox.0/Makefile.include.header:94:*** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again。 停止。
Creating user for the Guest Additions.
Creating udev rule for the Guest Additions kernel module.
-------------------------------------------------------------------------------------------------------------------------------------------------
到REHE5.5的镜像盘Server目录下,安装相关的kernel文件,继续上个步骤,还是有问题。日志文件报出没有找到gcc,日志信息如下:
----------------------------------------------------------------------------------------------------------------------------------------------------
make KBUILD_VERBOSE=1 -C /lib/modules/2.6.18-194.el5/build SUBDIRS=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 modules
/usr/src/kernels/2.6.18-194.el5-i686/scripts/gcc-version.sh: line 11: gcc: command not found
/usr/src/kernels/2.6.18-194.el5-i686/scripts/gcc-version.sh: line 12: gcc: command not found
make[1]: gcc:命令未找到
test -e include/linux/autoconf.h -a -e include/config/auto.conf || ( \
echo; \
echo " ERROR: Kernel configuration is invalid."; \
echo " include/linux/autoconf.h or include/config/auto.conf are missing."; \
echo " Run 'make oldconfig && make prepare' on kernel src to fix it."; \
echo; \
/bin/false)
mkdir -p /tmp/vbox.0/.tmp_versions
rm -f /tmp/vbox.0/.tmp_versions/*
make -f scripts/Makefile.build obj=/tmp/vbox.0
gcc -Wp,-MD,/tmp/vbox.0/.VBoxGuest-linux.o.d -nostdinc -isystem -D__KERNEL__ -Iinclude -include include/linux/autoconf.h -Wall -Wundef-Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Wstrict-prototypes -Wundef -Werror-implicit-function-declaration -fno-delete-null-pointer-checks -Os -pipe -msoft-float -fno-builtin-sprintf -fno-builtin-log2 -fno-builtin-puts -march=i686 -mregparm=3 -ffreestanding -Iinclude/asm-i386/mach-generic-Iinclude/asm-i386/mach-default -fomit-frame-pointer -g -include /tmp/vbox.0/include/VBox/VBoxGuestMangling.h -I/lib/modules/2.6.18-194.el5/build/include -I/tmp/vbox.0/ -I/tmp/vbox.0/include -I/tmp/vbox.0/r0drv/linux -I/tmp/vbox.0/vboxguest/-I/tmp/vbox.0/vboxguest/include -I/tmp/vbox.0/vboxguest/r0drv/linux -D__KERNEL__ -DMODULE -DVBOX -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_GUEST -DIN_GUEST_R0 -DIN_MODULE -DRT_WITH_VBOX -DVBGL_VBOXGUEST -DVBOX_WITH_HGCM -DRT_ARCH_X86 -DMODULE -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(VBoxGuest_linux)" -D"KBUILD_MODNAME=KBUILD_STR(vboxguest)" -c -o /tmp/vbox.0/.tmp_VBoxGuest-linux.o /tmp/vbox.0/VBoxGuest-linux.c
/bin/sh: gcc: command not found
make[2]: *** [/tmp/vbox.0/VBoxGuest-linux.o] 错误 127
make[1]: *** [_module_/tmp/vbox.0] 错误 2
make: *** [vboxguest] 错误 2
Creating user for the Guest Additions.
Creating udev rule for the Guest Additions kernel module.
-------------------------------------------------------------------------------------------------------------------------------
3, 在RHEL5.5镜像盘的Server目录下安装gcc相关的包(请参考上面的网址)
4.在virtualbox的“设置”--> "数据空间"设置需要共享的目录,
5.挂在命令如下:
共享E:\Linux下的所有内容,使用命令
mount -t vboxsf Linux /mnt/share
Linux是共享的文件夹名称,\mnt\share\是挂在点,share是新建的目录
一切Ok。(注意,每次重启之后都需要重新挂在,当然,我们可以编辑文件实现挂在一直生效).
运维网声明
1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网 享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com