Build guest vmware kernel modules: Difference between revisions

From VI-Toolkit
Jump to navigation Jump to search
Line 17: Line 17:
go into sub folder to build the tools
go into sub folder to build the tools
     cd vmware-tools-distrib/   
     cd vmware-tools-distrib/   
    sudo apt-get install build-essential linux-headers-`uname -r` 
check and run pre-requisites from next paragraph if needed and then run:
     sudo ./vmware-install.pl   
     sudo ./vmware-install.pl   
Press <enter> on any questions asked.
Press <enter> on any questions asked.

Revision as of 20:26, 5 December 2014

Pre built modules are sometimes not enough

When you select "install VMware Tools" then your VMware product will try to install the available vmware modules. If you run linux then sometimes the kernel will not match up with the prebuilt modules as are supplied with your vmware product. You can unzip the vmware tools .tar.gz bundle from the attached virtual CDrom and run the perl script, but if you just supply defaults you might still miss out on some modules as it will fail silently.

eg running:

./vmware-install.pl --default

is great as long as you have provided the VM with the right prerequisites.

The solution

Present the linux vmware tools virtual cd-rom to the VM and mount as a CDRom.

   mount /dev/sr0 /mnt/cdrom  

Copy the files to your home folder

   cd ~  
   cp /cdrom/VMwareTools-*.tar.gz .  

unzip

   tar xfz VMwareTools-*.tar.gz  

go into sub folder to build the tools

   cd vmware-tools-distrib/  

check and run pre-requisites from next paragraph if needed and then run:

   sudo ./vmware-install.pl  

Press <enter> on any questions asked.

After you are done you can remove the vmware-tool-distrib folder as it is only needed before the install.

After installing VMware Tools you now have the possibility to run

vmware-config-tools.pl

to configure how vmware tools is supposed to work.

Please note that on linux kernels 3.3 and higher, the original vmxnet module is no longer recommended. You are advised to use a newer virtual NIC such as vmxnet3 or e1000e.

Preconditions for the script to work

If you try to run the vmware-install.pl script and you need to build new kernel modules, then the script might give you the following error:

Before you can compile modules, you need to have the following installed...

make
gcc
kernel headers of the running kernel

You will have to get your kernel-headers and a compiler and build system before hand. On Ubuntu or debian based systems execute this:

sudo apt-get install build-essential linux-headers-$(uname -r)

On fedora / Red Hat based systems:

su -c "yum install kernel-devel"

On SUSE / openSUSE use YaST to fetch the latest linux-kernel-headers

Troubleshooting

After the manual compile, you can run the lsmod command to see what modules it was able to load:

$ lsmod | grep -i vm

Alternative solution

Many Linux distributions now come with a package called open-vm-tools and while that does give you a good bases, there are still things missing. Most notable is the host guest file system integration that is provided by the vmhgfs kernel module.