Saturday, December 31, 2011

How To Install VMware Tools in Linux

What are the VMware Tools?


In our article covering how to Install the VMware Tools in your Windows Guest OS, we talked about not only how to do this but the benefits of the VMware tools. The benefits of the VMware Tools are:

  • Improved video compatibility & performance

  • Mouse synchronization with the host operating system so that you don't have to keep releasing your mouse from the guest to go back to the host

  • Improved network compatibility & performance

  • Copy and paste between the host and guest


VMware tools is approximately a 6MB application (when installed, not on disk) that is installed in the GUEST OS directly. Neither the VMware console nor the host OS are required to participate in the installation.

Installing the VMware tools in a guest OS will be different for each of the different Linux OSs you might run. Installing the VMware Tools in Linux is much more unpredictable than installing them in the Windows OS.

How to Install the VMware Tools in Linux


The easiest way to know that the VMware tools are not installed is by your mouse getting stuck inside the VM when you click on the screen. To get it unstuck, you have to release it with the Alt-Ctrl keys. You will also see this at the bottom of the screen:



To install the VMware Tools, go to your VMware Server toolbar and click on VM, then Install VMware Tools, like this:



Next, you will see the following screen:



Click Install. You may see some delay. At this point, what happens in the background is that the VMware tools are mounted as an ISO CD drive on your virtual Linux machine. On your Host Computer (assuming it is running Windows) these tools are really located at:
C:\Program Files\VMware\VMware Server\linux.ISO

At this point, the you should see that the VMware Tools CD is now loaded and a windows comes up with the contents of that CDROM, like this:



To manually start this installation, right-click on the VMware Tools GZ file and click Extract To. You will see this:



Take the default of Desktop and click Extract



After the extraction, close all windows and go to your desktop. Open the vmware-tools-distrib folder.



Double-click on vmware-install.pl to execute it.



Select, Run in Terminal

The terminal window will appear. You will be asked a lot of questions. Ideally, you should be able to take all the defaults by pressing Enter. However, many times, things don't work as planned or as expected. Here is what part of this install process looks like:



When the process is done, you should should reboot your Linux system. When the system comes back up, click on the console of your Virtual Linux system and try to move your mouse out of the screen. If it gets stuck inside the screen, something went wrong (however, you may already know that from the installation process). However, hopefully, it does move out of the screen and onto your other applications. If that is the case, you know that the install went well (or at least the virtual mouse driver install went well - there are also virtual network, virtual video, and other virtual drivers that could have had install issues).

For the purposes of this demonstration, I installed the VMware Tools into SUSE Linux version 10.1. Make sure that you have the Kernel GNU C complier and Linux Kernel Sources loaded (called GCC). I loaded these with YaST. What you need loaded or the issues that you run into will vary from one Linux version to another Linux version. I have not run across a Linux yet where I didn't have to compile the VMware Tools and was able to run the simple RPM install. Thus, that is why I recommend that you not use the RPM install and go right to the .GZ file.

 

Howto disable the iptables firewall in Linux

Type the following two commands (you must login as the root user):
# /etc/init.d/iptables save
# /etc/init.d/iptables stop

Task: Enable / Turn on Linux Firewall (Red hat/CentOS/Fedora Core)


Type the following command to turn on iptables firewall:
# /etc/init.d/iptables start

Other Linux distribution


If you are using other Linux distribution such as Debian / Ubuntu / Suse Linux etc, try following generic procedure.

Save firewall rules
# iptables-save > /root/firewall.rules
OR
$ sudo iptables-save > /root/firewall.rules

Now type the following commands (login as root):
# iptables -X
# iptables -t nat -F
# iptables -t nat -X
# iptables -t mangle -F
# iptables -t mangle -X
# iptables -P INPUT ACCEPT
# iptables -P FORWARD ACCEPT
# iptables -P OUTPUT ACCEPT


To restore or turn on firewall type the following command:
# iptables-restore < /root/firewall.rules

GUI tools


If you are using GUI desktop firewall tools such as 'firestarter', use the same tool to stop firewall.
System > Administration > firestarter > Click on Stop Firewall button: