Monday, January 30, 2017

Fedora 25, kernel 4.9 and VMWare Workstation 12.5.2

Well, after upgrading Fedora 25 which included kernel 4.9.5, VMWare Workstation stopped working again! The fix is easy, even though it annoying to constantly have to patch something in VMWare. Anyway, the procedure - taken from here - is:
  1. Switch to root account.
  2. Go to /usr/lib/vmware/modules/source.
  3. Make backup of files vmmon.tar and vmnet.tar.
  4. Unpack those files using 'tar xf' command.
  5. Patch file vmnet-only/user_if.c, i.e. you have to open it in you favorite text editor and in function UserifLockPage() that's around line 113 change the following part:
    #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
    with the following:
    #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
  6. Then, in file vmmon-only/linux/hostif.c in function HostIFGetUserPages() that's around line 1158, change the following
    #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
    with
    #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
  7. Create new vmmon.tar and vmnet.tar using the following commands:
    tar cf vmnet.tar vmnet-only
    tar cf vmmon.tar vmmon-only
  8. Start vmware as you would normally start it. This will trigger module compilation and everything should work.
Note that you are doing everything at you own risk! :)

6 comments:

jeslin said...

Superb explanation & it's too clear to understand the concept as well, keep sharing admin with some updated information with right examples.Keep update more posts.

Back to Original Services Private Limited

technoviking said...

This stopped working for me in kernel 4.9.10

Stjepan Groš (sgros) said...

Strange, I'm just running VMWare on 4.9.10 after upgrading from 4.9.9 without any issue so far.

Sindhuja Ravi said...

Truly a very good article on how to handle the future technology. After reading your post,thanks for taking the time to discuss this, I feel happy about and I love learning more about this topic
SEO Company in Chennai

Abiya Carol said...

Very nice post here and thanks for latest smartphone applications it .I always like and such a super colors of phone for these post.Excellent and very cool idea and great models and different kinds of the more information's.

Digital Marketing Course in Channai

Bud Furn said...

Great information. Thanks for providing us such a useful information. Keep up the good work and continue providing us more quality information from time to time.

Modular Office Workstations

About Me

scientist, consultant, security specialist, networking guy, system administrator, philosopher ;)