最近一直想在Linux中开发S1mp3项目,可是我在VMware中装上 Debian/Linux后就是装不上VMware-tools,在网上搜集了一下资料没有一个适合我的,而且讲的都是很简单就装上来,没办法,只能自己 下手,经过几个小时的努力终于解决了,现在把自己的方法公布给大家,防止大家走弯路。
用到了以下几个命令apt-get、apt-cache、uname-a
首先检查的Debian在安装时,根本就没有安装gcc、内核头文件也没有。
执行步骤如下:
1.在vmware的菜单中选择Vm->install vmware-tools,这个时候vmware就会把安装文件映射到你的cdrom。
2.进入你的cdrom,点右键复制VMwareTools-5.5.0-18463.tar.gz到/tmp目录下,右键单击选择解压。当然这两步你也可以使用命令行方式,我对命令行不熟悉。详细的命令行方式,大家自己在网上就能搜到资料。
3.安装c编译器(前提没有安装gcc,可以通过which gcc命令来查看是否已安装)。
a.在命令行中键入:su (进入root进行程序安装,普通用户不能使用apt-get install),输入root的密码即可此时命令行从qinfengling@debian:$变为debian:/home/qinfengling#
b:接着在命令行中键入apt-get install gcc,选择默认就可顺利装上著名的gcc编译器
4.安装kernel-header (主要是为了解决What is the location of the directory of C header files that match your running kernel?问题),步骤如下:
a.在命令行中键入:uname -a 查看版本我的版本是:Linux debian 2.6.18-4-686
b.接着键入:apt-cache search headers 2.6.18-4-686(然后搜一下内核的头文件)
c.键入命令安装:apt-get install Linux-headers-2.6.18-2-686
5.之后你就顺利了,首先在命令行中进入/tmp/vmware-tools-distrib文件夹下,之后输入./vmware-install.pl,选择默认安装就行了,遇到[yes]就输入yes或者y。
dddddddddddddddddddddddddddddddddddddddddddddd
http://techguru.cn/tag/linux
dddddddddddddddddddddddddddddddddddddddddddddd
Posted in linux on 03/01/2009 09:03 下午 by tunpishuang
为了达到更好的显示效果,需安装Vmware Tools,VM->Install Vmware Tools,然后Guest OS以CD的形式自动挂载到/media/cdrom0
Alt+F2 输入gnome-terminal ,
$cd /media/cdrom
$ cp *.tar.gz /home/tps/
$cd /home/tps
$tar zxvf *.tar.gz
$su 输入root密码
#apt-get -y install binutils kernel-package linux-headers-2.6.26-1-amd64
#./vmware-tools-distrib/vmware-install.pl
接下来运行Vmware公司为咋们提供的傻瓜perl安装脚本,一路敲Enter,输入yes
当出现”What is the location of the directory of C header files that match your running kernel?” 输入/usr/src/linux-headers-2.6.26-1-amd64/include/
(kernel版本可以通过uname -a得到),接下来到了这样的提示:
None of the pre-built vmmemctl modules for VMware Tools is suitable for your
running kernel. Do you want this program to try to build the vmmemctl module
for your system (you need to have a C compiler installed on your system)?
[yes]
Using compiler “/usr/bin/gcc”. Use environment variable CC to override.
Your kernel was built with “gcc” version “4.1.3″, while you are trying to use
“/usr/bin/gcc” version “4.3.2″. This configuration is not recommended and
VMware Tools may crash if you’ll continue. Please try to use exactly same
compiler as one used for building your kernel. Do you want to go with compiler
“/usr/bin/gcc” version “4.3.2″ anyway? [no]
大概意思就是说没有找到适合俺们2.6.26-1-amd64内核的vmmemctl模块,需要自己编译,但是编译内核的gcc版本必须要和编译这个模块的版本符合,2.6.26-1-amd64用的是gcc 4.1.3编译的,而当前系统默认使用4.3.2,因为/usr/bin/gcc 是/usr/bin/gcc-4.3的软链接:
stiff-cock:/usr/bin# file /usr/bin/gcc
/usr/bin/gcc: symbolic link to `gcc-4.3′
在这里找到解决办法:
http://yuanfarn.blogspot.com/2008/10/debian-testing-on-vmware-workstation.html
所以不要使用4.3强制编译,因为我尝试了,会出现两个make的错误,所以运行这个先定义CC变量:
#CC=/usr/bin/gcc-4.1 ./vmware-tools-distrib/vmware-install.pl
接下来自动编译vmmemctl ,vmhgfs,vmxnet modules,然后更新initramfs:
update-initramfs: Generating /boot/initrd.img-2.6.26-1-amd64
然后系统再编译了一个叫vmblock.o的非内核模块~
然后:
[EXPERIMENTAL] The VMware FileSystem Sync Driver (vmsync) is a new feature that
creates backups of virtual machines. Please refer to the VMware Knowledge Base
for more details on this capability. Do you wish to enable this feature?
[yes]
Vmware文件系统同步驱动,实验性的东西,可以尝试,yes~
接下来vmci,vsock。
None of the pre-built vsock modules for VMware Tools is suitable for your
running kernel. Do you want this program to try to build the vsock module for
your system (you need to have a C compiler installed on your system)? [yes]
Extracting the sources of the vsock module.
Building the vsock module.
Using 2.6.x kernel build system.
make: Entering directory `/tmp/vmware-config0/vsock-only’
make -C /lib/modules/2.6.26-1-amd64/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.26-1-amd64′
CC [M] /tmp/vmware-config0/vsock-only/linux/af_vsock.o
CC [M] /tmp/vmware-config0/vsock-only/linux/driverLog.o
CC [M] /tmp/vmware-config0/vsock-only/linux/util.o
CC [M] /tmp/vmware-config0/vsock-only/linux/vsockAddr.o
LD [M] /tmp/vmware-config0/vsock-only/vsock.o
Building modules, stage 2.
MODPOST 1 modules
WARNING: “VMCIDatagram_CreateHnd” [/tmp/vmware-config0/vsock-only/vsock.ko] undefined!
WARNING: “VMCIDatagram_DestroyHnd” [/tmp/vmware-config0/vsock-only/vsock.ko] undefined!
WARNING: “VMCIEvent_Subscribe” [/tmp/vmware-config0/vsock-only/vsock.ko] undefined!
WARNING: “VMCI_DeviceGet” [/tmp/vmware-config0/vsock-only/vsock.ko] undefined!
WARNING: “VMCIMemcpyFromQueueV” [/tmp/vmware-config0/vsock-only/vsock.ko] undefined!
WARNING: “VMCIQueuePair_Detach” [/tmp/vmware-config0/vsock-only/vsock.ko] undefined!
WARNING: “VMCI_GetContextID” [/tmp/vmware-config0/vsock-only/vsock.ko] undefined!
WARNING: “VMCIDatagram_Send” [/tmp/vmware-config0/vsock-only/vsock.ko] undefined!
WARNING: “VMCIQueuePair_Alloc” [/tmp/vmware-config0/vsock-only/vsock.ko] undefined!
WARNING: “VMCIEvent_Unsubscribe” [/tmp/vmware-config0/vsock-only/vsock.ko] undefined!
WARNING: “VMCIMemcpyToQueueV” [/tmp/vmware-config0/vsock-only/vsock.ko] undefined!
CC /tmp/vmware-config0/vsock-only/vsock.mod.o
LD [M] /tmp/vmware-config0/vsock-only/vsock.ko
make[1]: Leaving directory `/usr/src/linux-headers-2.6.26-1-amd64′
cp -f vsock.ko ./../vsock.o
make: Leaving directory `/tmp/vmware-config0/vsock-only’
Unable to make a vsock module that can be loaded in the running kernel:
insmod: error inserting ‘/tmp/vmware-config0/vsock.o’: -1 Unknown symbol in module
There is probably a slight difference in the kernel configuration between the
set of C header files you specified and your running kernel. You may want to
rebuild a kernel based on that directory, or specify another directory.
The VM communication interface socket family is used in conjunction with the VM
communication interface to provide a new communication path among guests and
host. The rest of this software provided by VMware Tools is designed to work
independently of this feature. If you wish to have the VSOCK feature you can
install the driver by running vmware-config-tools.pl again after making sure
that gcc, binutils, make and the kernel sources for your running kernel are
installed on your machine. These packages are available on your distribution’s
installation CD.
[ Press the Enter key to continue.]
接下来选择分辨率”[19] 1440×900″(19寸宽屏最佳resolution)
然后自动重启动X,使用这个config:”/tmp/vmware-config1/XF86ConfigLog.5435″