After recently upgrading Ubuntu to 14.04, VMware could no longer start. Specifically, every time VMware Workstation launched, it would pop up a VMware Kernel Module Updater dialog asking to recompile several kernel modules for the current kernel version, but the network module vmnet always failed to compile.
After looking through related materials, I found that the reason was that after upgrading to Ubuntu 14.04, the current Linux kernel version became 3.13. This kernel version changed some low-level functions, while VMware's corresponding source packages had not yet updated their code in time. Since this is a problem caused by kernel interface changes, the same issue has also appeared frequently on systems such as Fedora.
Therefore, similar problems may also continue to exist in later kernel versions such as 3.14 and 3.15. The solution is to modify two pieces of code in the vmnet module source package, then repack it and compile the kernel module again.
Steps
1. Get root privileges and enter the source directory
su
cd /usr/lib/vmware/modules/source
You can also use sudo -i to get a root shell, then enter the same directory.
2. Extract the vmnet source package
After extraction, you will get a vmnet-only folder:
tar -xf vmnet.tar
3. Back up the original source package
mv vmnet.tar vmnet.tar.bak
4. Modify the source file filter.c
Edit the file:
vim vmnet-only/filter.c
Find the original function parameter, around line 206:
VNetFilterHookFn(const unsigned int hooknum // IN:
Change it to:
VNetFilterHookFn(const struct nf_hook_ops *ops, // IN:
Then find the code around line 255:
transmit = (hooknum == VMW_NF_INET_POST_ROUTING);
Change it to:
transmit = (ops->hooknum == VMW_NF_INET_POST_ROUTING);
If the line numbers do not match exactly, search directly for VNetFilterHookFn and VMW_NF_INET_POST_ROUTING in filter.c. The source locations may differ slightly between VMware or kernel versions, so use the actual file contents as the reference.
5. Repack and clean up the temporary directory
tar -uf vmnet.tar vmnet-only
rm -rf vmnet-only
6. Recompile the VMware kernel modules
You can simply click the VMware Workstation icon and let it automatically detect and compile the modules, or run the command manually:
vmware-modconfig --console --install-all
If it still fails, first confirm that the current kernel headers and build tools are fully installed. For example, on Ubuntu you can check with:
uname -r
dpkg -l | grep "linux-headers-$(uname -r)"
If necessary, install the corresponding kernel headers and basic build tools:
sudo apt-get install build-essential linux-headers-$(uname -r)
References
Thanks to Bearox and Garrett Skjelstad.
- <http://blog.csdn.net/bearox/article/details/21294609>
- <http://ping8888.com/2013/12/13/vmware-modules-kernel-3-13/>
Originally published at <http://blog.csdn.net/yanxiangtianji>.
Please cite the source when reposting.
