安装VMware tools on linux

本文介绍如何在多种Linux发行版上安装VMware Tools,包括Ubuntu 7.04、Fedora 7、PCLinuxOS 2007及Debian Etch等。安装VMware Tools能提高性能、实现鼠标同步及复制粘贴功能,并提供自动启动教程。

How To Set Up VMware Tools On Various Linux Distributions

<!-- start main content -->
<script type="text/javascript"> <!-- document.write('<div style="float: right; margin: 0 0 10px 10px;">'); //--> </script>
<!-- BEGIN NetShelter Ad Tag for HowtoForge 120x600,160x600 --> <script language="JavaScript" type="text/javascript"> if (!window.netshel_ord) { netshel_ord=Math.random()*10000000000000000; } if (!window.netshel_tile) { netshel_tile=1; } document.write('<script language="JavaScript" src="http://ad.doubleclick.net/adj/ns.howtoforge/howtos;sz=120x600,160x600;tile='+netshel_tile+';ord=' + netshel_ord + '?" type="text/javascript"></scr' + 'ipt>'); netshel_tile++; </script><script language="JavaScript" src="http://ad.doubleclick.net/adj/ns.howtoforge/howtos;sz=120x600,160x600;tile=2;ord=892327748399852.6?" type="text/javascript"></script><!-- END AD TAG --><script type="text/javascript"> <!-- document.write('<div><A href="http://blog.youkuaiyun.com/membership"><img src="/themes/htf_glass/images/remove_ads.gif" border="0" alt="Remove ads"></a></div>'); //--> </script>
Remove ads
<script type="text/javascript"> <!-- document.write('</div>'); //--> </script>
<!-- begin content -->
Submitted by o.meyer ( Contact Author) ( Forums) on Sun, 2007-09-30 17:51. :: Debian | Fedora | Linux | PCLinuxOS | Ubuntu | Desktop | Virtualization

How To Set Up VMware Tools On Various Linux Distributions

Version 1.0
Author: Oliver Meyer <o [dot] meyer [at] projektfarm [dot] de>
Last edited 09/25/2007

This document explains how to set up the VMware Tools in the following guest operating systems: Ubuntu 7.04, Fedora 7, PCLinuxOS 2007 and Debian Etch. Installing VMware Tools in your guest operating systems will help maximize performance, provide mouse synchronization and copy & paste functionality. This article also shows a way of making VMware Tools start automatically when you start a guest operating system.

I used the VMware Tools v1.0.3-44356 provided by VMware Server v1.03.

This howto is meant as a practical guide; it does not cover the theoretical backgrounds. They are treated in a lot of other documents in the web.

This document comes without warranty of any kind! I want to say that this is not the only way of setting up such a system. There are many ways of achieving this goal but this is the way I take. I do not issue any guarantee that this will work for you!

<script type="text/javascript"> <!-- document.write('<div align="center">'); //--> </script>
<!-- BEGIN NetShelter Ad Tag for HowtoForge 300x250,336x280 --> <script language="JavaScript" type="text/javascript"> if (!window.netshel_ord) { netshel_ord=Math.random()*10000000000000000; } if (!window.netshel_tile) { netshel_tile=1; } document.write('<script language="JavaScript" src="http://ad.doubleclick.net/adj/ns.howtoforge/howtos;sz=300x250,336x280;tile='+netshel_tile+';ord=' + netshel_ord + '?" type="text/javascript"></scr' + 'ipt>'); netshel_tile++; </script><script language="JavaScript" src="http://ad.doubleclick.net/adj/ns.howtoforge/howtos;sz=300x250,336x280;tile=3;ord=892327748399852.6?" type="text/javascript"></script><!-- END AD TAG --><script type="text/javascript"> <!-- document.write('<div><A href="http://blog.youkuaiyun.com/membership"><img src="/themes/htf_glass/images/remove_ads.gif" border="0" alt="Remove ads"></a></div>'); //--> </script>
Remove ads
<script type="text/javascript"> <!-- document.write('</div>'); //--> </script>

1 Preparation

Set up a virtual machine of your choice. Click on VM in the top menu of the VMware Server console and select Install VMware Tools.

<noscript style="FONT-SIZE: 7pt"></noscript>

<noscript style="FONT-SIZE: 7pt"></noscript>

<noscript style="FONT-SIZE: 7pt"></noscript>

2 Ubuntu 7.04

First copy the VMware Tools from the mounted iso to the temporary folder:

cp /media/cdrom/VMwareTools-1.0.3-44356.tar.gz /tmp/

Afterwards switch to the temporary folder and unpack the VMware Tools:

cd /tmp/
tar xvfz VMwareTools-1.0.3-44356.tar.gz

Next switch to the folder with the unpacked files and execute the installer:

cd vmware-tools-distrib/
sudo ./vmware-install.pl

Now you will be asked a few questions relating to installation paths etc. Choose the default value every time (simply hit enter).

After the installation/configuration finished you have to start the VMware Tools:

vmware-toolbox &

You can automatize the start of the VMware Tools - have a look at step 6 of this howto.

Note: If you close the VMware Tools window, the VMware Tools will be disabled immediately.

3 Fedora 7 (Kernel 2.6.22.5-76.fc7)

First become root and install some needed packages:

su -
%yourrootpassword%
yum install kernel-devel gcc gcc-c++

Next copy the VMware Tools from the mounted iso to the temporary folder:

cp /media/VMware/ Tools/VMwareTools-1.0.3-44356.tar.gz /tmp/

Afterwards switch to the temporary folder and unpack the VMware Tools:

cd /tmp/
tar xvfz VMwareTools-1.0.3-44356.tar.gz

Now we have to fix the vmxnet module:

cd vmware-tools-distrib/lib/modules/source
tar xf vmxnet.tar
cp vmxnet-only/vmxnet.c vmxnet-only/vmxnet.c.orig
wget http://www.thoughtpolice.co.uk/vmware/howto/patch2-vmxnet.c.patch
patch -u vmxnet-only/vmxnet.c < patch2-vmxnet.c.patch
tar cf vmxnet.tar vmxnet-only/
cd /tmp/vmware-tools-distrib
./vmware-install.pl

You will be asked a few questions relating to installation paths etc. Choose the default value every time (simply hit enter).

Next step is to fix the xorg.conf:

vi /etc/X11/xorg.conf

Add the following lines:

Section "Monitor"
   Identifier "vmware"
EndSection

After this you have to run the configuration again:

vmware-config-tools.pl

Choose the default value every time (simply hit enter) till you reach the question Do you want to change your guest X resolution? - choose yes and select your desired resolution.

The last step is to fix the integration of the vmxnet module by manually loading it (otherwise you might obtain problems with the network):

/etc/init.d/networking stop
rmmod pcnet32
rmmod vmxnet
depmod -a
modprobe vmxnet
/etc/init.d/networking start

Afterwards reboot the vm. After the vm has rebooted, you can start the VMware Tools via:

vmware-toolbox &

You can automatize the start of the VMware Tools - have a look at step 6 of this howto.

Note: If you close the VMware Tools window, the VMware Tools will be disabled immediately.

4 PCLinuxOS 2007

Become root, switch to the mounted iso and install the rpm package:

su -
%yourrootpassword%
cd /media/VMware/ Tools/
rpm -ivh VMwareTools-1.0.3-44356.i386.rpm

Afterwards run the configuration:

vmware-config-tools.pl

You will be asked a few questions relating to installation paths etc. Choose the default value every time (simply hit enter).

Afterwards reboot the vm. After the vm has rebooted, you can start the VMware Tools via:

vmware-toolbox &

You can automatize the start of the VMware Tools - have a look at step 6 of this howto.

Note: If you close the VMware Tools window, the VMware Tools will be disabled immediately.

5 Debian Etch

First install some needed pakages:

apt-get install autoconf automake binutils ccp gcc linux-headers-$(uname -r) make psmisc

Next copy the VMware Tools from the mounted iso to the temporary folder:

cp /media/cdrom/VMwareTools-1.0.3-44356.tar.gz /tmp/

Afterwards switch to the temporary folder and unpack the VMware Tools:

cd /tmp/
tar xvfz VMwareTools-1.0.3-44356.tar.gz

Next switch to the folder with the unpacked files and execute the installer:

cd vmware-tools-distrib/
./vmware-install.pl

Now you will be asked a few questions relating to installation paths etc. Choose the default value every time (simply hit enter).

Afterwards reboot the vm. After the vm has rebooted, you can start the VMware Tools via:

vmware-toolbox &

You can automatize the start of the VMware Tools - have a look at step 6 of this howto.

Note: If you close the VMware Tools window, the VMware Tools will be disabled immediately.

Submitted by o.meyer ( Contact Author) ( Forums) on Sun, 2007-09-30 17:54. ::

6 VMware Toolbox Automatic Hidden Start

We'll create two scripts (I sometimes had problems when I put all in one script). These scripts will be executed everytime when an X-session starts - they will switch to the next workspace, start the VMware Tools minimized and switch back to the previous workspace. The switching will be done with xvkbd - a virtual keyboard for the X window system.

6.1 Install Xvkbd

Ubuntu 7.04:

sudo apt-get install xvkbd

Fedora 7:

su -
%yourrootpassword%
rpm -ivh http://dag.wieers.com/rpm/packages/xvkbd/xvkbd-2.8-1.el4.rf.i386.rpm
exit

PCLinuxOS 2007:

Download the rpm-package from http://rpmseek.com/rpm/xvkbd-2.7a-2mdk.i586.html?hl=de&cs=xvkbd:PN:0:0:0:0:2800686.

<script type="text/javascript"> <!-- document.write('<div align="center">'); //--> </script>
<!-- BEGIN NetShelter Ad Tag for HowtoForge 300x250,336x280 --> <script language="JavaScript" type="text/javascript"> if (!window.netshel_ord) { netshel_ord=Math.random()*10000000000000000; } if (!window.netshel_tile) { netshel_tile=1; } document.write('<script language="JavaScript" src="http://ad.doubleclick.net/adj/ns.howtoforge/howtos;sz=300x250,336x280;tile='+netshel_tile+';ord=' + netshel_ord + '?" type="text/javascript"></scr' + 'ipt>'); netshel_tile++; </script><script language="JavaScript" src="http://ad.doubleclick.net/adj/ns.howtoforge/howtos;sz=300x250,336x280;tile=3;ord=3115057952217503?" type="text/javascript"></script><!-- END AD TAG --><script type="text/javascript"> <!-- document.write('<div><A href="http://blog.youkuaiyun.com/membership"><img src="/themes/htf_glass/images/remove_ads.gif" border="0" alt="Remove ads"></a></div>'); //--> </script>
Remove ads
<script type="text/javascript"> <!-- document.write('</div>'); //--> </script>

Afterwards switch to the directory where you downloaded the package and install it:

su -
%yourrootpassword
rpm -ivh xvkbd-2.7a-2mdk.i586.rpm
exit

Debian Etch:

su -
%yourrootpassword%
apt-get install xvkbd
exit

Now change to your homedir:

cd ~

6.2 Scripts For Gnome

vi switcher1.sh

#! /bin/sh
sleep 2
xvkbd -text "/C/A/[Right]"
sleep 2 
vmware-toolbox --minimize &> /dev/null

vi switcher2.sh

#! /bin/sh
sleep 10
xvkbd -text "/C/A/[Left]"

Make the scripts executeable:

chmod +x switcher*

Add the scripts to the session startup programs:

<noscript style="FONT-SIZE: 7pt"></noscript>

<noscript style="FONT-SIZE: 7pt"></noscript>

Repeat these steps for "switcher2.sh"

6.3 Scripts For KDE

Note: If the panel taskbar is configured to show windows from all desktops, the VMware Toolbox will still be visible in the taskbar.

vi .kde/Autostart/switcher1.sh

#! /bin/sh
sleep 2
xvkbd -text "/C/[F2]"
sleep 2
vmware-toolbox --minimize &> /dev/null

vi .kde/Autostart/switcher2.sh

#! /bin/sh
sleep 10
xvkbd -text "/C/[F1]"

Make the scripts executeable:

chmod +x .kde/Autostart/switcher*

7 Links

Click to enlarge
Click to enlarge
Click to enlarge
Click to enlarge
Click to enlarge
### 如何在 VMware Linux 虚拟机上安装 VMware ToolsVMware 中运行的 Linux 虚拟机可以通过安装 VMware Tools 来显著提升性能并改善用户体验。以下是详细的安装步骤: #### 准备工作 确保虚拟机已启动,并且操作系统已经正确配置好基本环境,例如更新包管理器索引以及安装必要的开发工具。 #### 安装依赖项 为了成功编译和安装 VMware Tools,在开始之前需要先安装一些必需的软件包。这些通常包括构建工具、内核头文件和其他支持库。 ```bash sudo apt update && sudo apt install build-essential linux-headers-$(uname -r) dkms ``` 上述命令适用于基于 Debian 的发行版(如 Ubuntu),对于其他发行版可能需要调整相应的包管理器命令[^5]。 #### 开始安装过程 1. **挂载 VMware Tools 镜像** 在 VMware 主界面上选择 `虚拟机` -> `安装 VMware Tools` 或者按下快捷键组合触发光盘镜像加载操作。随后进入终端执行以下指令完成设备挂载: ```bash sudo mkdir /mnt/cdrom sudo mount /dev/cdrom /mnt/cdrom ``` 2. **解压与复制源码** 将 VMware 提供的 tarball 文件提取到指定目录下以便进一步处理: ```bash cd /tmp/ sudo cp /mnt/cdrom/VMwareTools*.tar.gz . sudo tar zxpf VMwareTools*.tar.gz ``` 3. **正式部署组件** 进入刚刚创建的工作区并按照提示逐步推进整个设置流程直至结束为止: ```bash cd vmware-tools-distrib/ sudo ./vmware-install.pl -d ``` 使用 `-d` 参数可以跳过大部分询问环节采用默认设定快速完成初始化;当然也可以移除该标志自行定制更多细节部分[^6]。 4. **重启系统验证效果** 当所有程序都顺利装载完毕之后记得重新引导一次实例从而激活新功能特性集: ```bash sudo reboot now ``` 至此即完成了针对当前版本号所对应的官方指南描述下的全部动作事项列表说明文档内容整理归纳总结如下所示形式呈现给各位读者朋友们参考学习借鉴之用! ```python print("VMware Tools has been successfully installed on your Linux VM.") ```
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值