DDV 写了:安装增强功能需要gcc,Lubuntu默认没安装gcc,安装gcc之后,在安装增强功能,一切就都正常了,包括共享目录和剪贴板。
谢谢,问题已经解决!
以下是我的安装过程分享:
》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》
默认情况下安装增强功能,信息如下:
dxing@dxing-Vbox:/media/VBOXADDITIONS_4.0.4_70112$ sudo ./VBoxLinuxAdditions.run
[sudo] password for dxing:
Verifying archive integrity... All good.
Uncompressing VirtualBox 4.0.4 Guest Additions for Linux.........
VirtualBox Guest Additions installer
Removing installed version 4.0.4 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 ...fail!
Your system does not seem to be set up to build kernel modules.
Look at /var/log/vboxadd-install.log to find out what went wrong.
Once you have corrected it, you can run
/etc/init.d/vboxadd setup
to build them.
Doing non-kernel setup of the Guest Additions ...done.
Installing the Window System drivers
Installing X.Org Server 1.9 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.
dxing@dxing-Vbox:/media/VBOXADDITIONS_4.0.4_70112$
PS:这是我试着重装增强功能后返回的信息,如果你是第一次安装增强功能,前面的几行信息会不一样。
==================================================================================
注意上面的其中三行:
Building the VirtualBox Guest Additions kernel modules ...fail!
Your system does not seem to be set up to build kernel modules.
Look at /var/log/vboxadd-install.log to find out what went wrong.
这里是安装失败,查看日志文件/var/log/vboxadd-install.log ,信息如下:
make KBUILD_VERBOSE=1 -C /lib/modules/2.6.35-25-generic/build SUBDIRS=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 modules
/usr/src/linux-headers-2.6.35-25-generic/scripts/gcc-version.sh: line 25: gcc:找不到命令
/usr/src/linux-headers-2.6.35-25-generic/scripts/gcc-version.sh: line 26: gcc:找不到命令
/usr/src/linux-headers-2.6.35-25-generic/arch/x86/Makefile:81: stack protector enabled but no compiler support
make[1]: gcc:命令未找到
test -e include/generated/autoconf.h -a -e include/config/auto.conf || ( \
echo; \
echo " ERROR: Kernel configuration is invalid."; \
echo " include/generated/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/.test.o.d -nostdinc -isystem -I/usr/src/linux-headers-2.6.35-25-generic/arch/x86/include -Iinclude -include include/generated/autoconf.h -
Iubuntu/include -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-
delete-null-pointer-checks -O2 -msoft-float -mregparm=3 -freg-struct-return -march=i686 -ffreestanding -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -fno-omit-frame-
pointer -fno-optimize-sibling-calls -pg -I/lib/modules/2.6.35-25-generic/build/include -I/tmp/vbox.0/ -I/tmp/vbox.0/include -I/tmp/vbox.0/r0drv/linux -D__KERNEL__ -DMODULE -
DRT_OS_LINUX -DIN_RING0 -D_X86_ -DIN_RT_R0 -DIN_SUP_R0 -DVBGL_VBOXGUEST -DVBGL_HGCM -DVBOX_WITH_HGCM -DMODULE -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(test)" -
D"KBUILD_MODNAME=KBUILD_STR(vboxadd_test)" -c -o /tmp/vbox.0/.tmp_test.o /tmp/vbox.0/test.c
/bin/sh: gcc: not found
make[2]: *** [/tmp/vbox.0/test.o] 错误 127
make[1]: *** [_module_/tmp/vbox.0] 错误 2
make: *** [vboxadd_test] 错误 2
Creating user for the Guest Additions.
Creating udev rule for the Guest Additions kernel module.
==================================================================================
根据安装日志使用如下命令安装gcc
sudo apt-get install gcc
==================================================================================
重新安装增强功能,信息如下:
dxing@dxing-Vbox:/media/VBOXADDITIONS_4.0.4_70112$ sudo ./VBoxLinuxAdditions.run
Verifying archive integrity... All good.
Uncompressing VirtualBox 4.0.4 Guest Additions for Linux.........
VirtualBox Guest Additions installer
Removing installed version 4.0.4 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.
Building the OpenGL support module ...done.
Doing non-kernel setup of the Guest Additions ...done.
Starting the VirtualBox Guest Additions ...done.
Installing the Window System drivers
Installing X.Org Server 1.9 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.
dxing@dxing-Vbox:/media/VBOXADDITIONS_4.0.4_70112$
==================================================================================
从上面的结果可以清楚看到,增强功能已经成功安装!
自动调整分辨率、共享剪贴板、共享目录,已经可以正常使用。