Tuesday, February 7, 2017

Kali Linux and VMware [why you no co-operate]

setup:

Alienware Mx14 r3 its a beast, but i miss my mac for not breaking shit when i have to do something as simple as install VMware (fusion) for workstation its another B8!@3 , so lets make this short, and under lesson learnt,

I upgrade to kali linux uname -r : 4.9.0-kali1-amd64


i try to install latest vmware workstation :( trouble starts here .... vmware 12.5.2 build-4638234)

I get complains , some modules wont compile :(

(screenshots are forgotten at this point as i have a API documentation and testing to do , and i need my vmware (yes i hate vbox sue me)


error looks (something) like this:

module_/tmp/modconfig-eTZynd/vmnet-only' failed


I mean come on ..... i try all fixes from installing headers but , naaah thats not it... i mean okay lets fix this :)


  • Make a backup of /usr/lib/vmware/modules/source/vmnet.tar
  • Go to /usr/lib/vmware/modules/source
  • Extract vmnet.tar (tar xvf vmnet.tar)
  • Change to vmnet-only directory (cd vmnet-only)
  • Make a backup of /usr/lib/vmware/modules/source/vmmon.tar
  • Go to /usr/lib/vmware/modules/source
  • Extract vmnet.tar (tar xvf vmmon.tar)
  • Change to vmnet-only directory (cd vmmon-only)



As I could not find any patches for VMware – and the latest version 12.5.2 still fails to compile, I created a nasty hack myself..

Warning – This is not an official patch, and I am not an expert in kernel code, but I applied this to vmmon and vmnet, and both compile OK, and load/run, on Kernel 4.9-rc3..

In vmnet-only/userif.c, around line 113, change

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
    retval = get_user_pages(addr, 1, 1, 0, &page, NULL);
#else
    retval = get_user_pages(current, current->mm, addr,
                1, 1, 0, &page, NULL);
#endif
to

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
     retval = get_user_pages(addr, 1, 0, &page, NULL);
#else
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
     retval = get_user_pages(addr, 1, 1, 0, &page, NULL);
#else
     retval = get_user_pages(current, current->mm, addr,
                 1, 1, 0, &page, NULL);
#endif
#endif
– and in vmmon-only/linux/hostif.c, around line 1162, change

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
   retval = get_user_pages((unsigned long)uvAddr, numPages, 0, 0, ppages, NULL);
#else
   retval = get_user_pages(current, current->mm, (unsigned long)uvAddr,
                           numPages, 0, 0, ppages, NULL);
#endif
to

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
   retval = get_user_pages((unsigned long)uvAddr, numPages, 0, ppages, NULL);
#else
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
   retval = get_user_pages((unsigned long)uvAddr, numPages, 0, 0, ppages, NULL);
#else
   retval = get_user_pages(current, current->mm, (unsigned long)uvAddr,
                           numPages, 0, 0, ppages, NULL);
#endif
#endif



Recreate vmnet.tar  & vmmon.tar (tar cvf vmnet.tar vmnet-only/)
Recompile VMWare (vmware-modconfig --console --install-all)
Optionally, remove vmnet-only  && vmmon-only directory (rm -rf vmnet-only)


IT WORKS .... [SOLVED]




ARCHIVED

:) No longer posting, all articles should be treated as archived and outdated