Chinaunix首页 | 论坛 | 博客
  • 博客访问: 939963
  • 博文数量: 109
  • 博客积分: 554
  • 博客等级: 中士
  • 技术积分: 2577
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-04 12:49









分类: 嵌入式

2013-08-21 19:27:37

一. 安装vmware-tools
1. 安装依赖文件
    aptitude install make gcc-4.3 linux-headers-`uname -r` libglib2.0-0

由于编译vmware-tools 需要和编译内核使用相同版本的gcc
# cat /proc/version
Linux version 2.6.32-5-amd64 (Debian 2.6.32-45) ( (gcc version 4.3.5 (Debian 4.3.5-4) ) #1 SMP Sun May 6 04:00:17 UTC 2012
2. 将vmware解压到/tmp,进入到vmware文件夹
sudo ./

What is the location of the gcc program on your machine? /usr/bin/gcc

The path "/usr/bin/gcc" is not valid path to the gcc binary.
Would you like to change it? [yes]
我们编译内核是用的是gcc-4.3, 我的系统上有gcc-4.3和gcc-4.4
ln -s /usr/bin/gcc-4.3 /usr/bin/gcc

3. 装完后需要重启一下有的功能才能生效
可以复制,直接拖文件到虚拟机, 可以共享文件/mnt/hgfs
二. 另一台电脑,安装vmware-tools时出现和内核头文件冲突的情况,环境
Linux version 2.6.32-5-686 (Debian 2.6.32-31) ( (gcc version 4.3.5 (Debian 4.3.5-4) ) #1 SMP Tue Mar 8 21:36:00 UTC 2011
Installing Open Virtual Machine Tools is a nice alternative to managing and installing the vmware toolspackage that comes with Vmware’s hypervisor products.  It allows you to use APT to manage all the dependencies and updates. Module assistant will recompile the kernel modules for you automatically when you update kernels too.

I have verified that this configuration works under ESXi 4.1.0, 260247 and a new Squeeze install. All of the essential functions like being able to see guest OS information on the Vsphere summary page and performing “Shut Down Guest” and “Restart Guest” all work as expected. If your experiences vary, please leave a comment

This should all be performed by the root user (otherwise prepend ‘sudo’ to the commands if you must use sudo). 
The first thing you need to do is add the ‘contrib’ archive to your apt sources config:

nano /etc/apt/sources.list
Add the ‘contrib’ to the end of these source lines. I use the repository, so mine look like this on a new install:

deb squeeze main contrib
deb-src squeeze main contrib
After you save changes to the file, simply update your package list and perform the install:

apt-get update
apt-get install open-vm-tools open-vm-source
You might see an error that looks like this:

Loading open-vm-tools modules: vmhgfsFATAL: Module vmhgfs not found.
 vmmemctlFATAL: Module vmmemctl not found.
 vmsyncFATAL: Module vmsync not found.
Don’t worry, this is because we have not installed the kernel modules for some of the more advanced VMware functions like the vmhgfs file system, Memory Balloon (vmmemctl) Driver, and vmsync, which helps freeze the VM while taking snapshots.
To install these kernel modules, we’re going to use module-assistant. It will compile the modules for your kernel:

module-assistant auto-install open-vm -i
The ‘-i’ puts module assistant into non-interactive mode. It wont ask you to confirm any additional package installs necesarry to set up the build environment.
If you’re running a server without a Graphical environment, you’re finished. If you want features such as automatically adjusting the VM’s monitor resolution or allowing your mouse to seamlessly move between your host system and the VM, you need to install one more package:

apt-get install open-vm-toolbox
Now you won’t need to use CTRL+ALT to switch back and forth.

阅读(6047) | 评论(0) | 转发(0) |