Saturday, May 4, 2024
 Popular · Latest · Hot · Upcoming
8
rated 0 times [  8] [ 0]  / answers: 1 / hits: 15058  / 3 Years ago, tue, june 15, 2021, 4:54:23

Because this answer is only for kernel 3.13, so I'd like to share a solution for the problem Failed to build vmnet for kernel 3.19 and earlier versions. Thus this is not my actual problem and is only intended to help future readers.



Question



When I want to run VMware Workstation or VMware Player for the first time, it needs to deploy some packages at kernel level but it fails with this line of error.




Failed to build vmnet. Failed to execute the build command.




What should I do to resolve this problem?


More From » kernel

 Answers
5

Solution




  1. Change directory into the vmware module source directory. [1]



    cd /usr/lib/vmware/modules/source

  2. Untar the vmnet modules. [1]



    sudo tar -xvf vmnet.tar

  3. Open vmnet-only/driver.c with your favorite text editor.



    sudo gedit vmnet-only/driver.c

  4. Around line 267, change the following [2]



    if (filp && filp->f_op && filp->f_op->ioctl == VNetFileOpIoctl) {
    ret = VNetFileOpIoctl(filp->f_dentry->d_inode, filp, iocmd, ioarg);
    }
    return ret;


    to



    #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
    if (filp && filp->f_op && filp->f_op->ioctl == VNetFileOpIoctl) {
    ret = VNetFileOpIoctl(filp->f_dentry->d_inode, filp, iocmd, ioarg);
    }
    return ret;
    #else
    if (filp && filp->f_op && filp->f_op->ioctl == VNetFileOpIoctl) {
    ret = VNetFileOpIoctl(filp->f_path.dentry->d_inode, filp, iocmd, ioarg);
    }
    return ret;
    #endif

  5. Around line 1194, change the following [2]



    if (filp && filp->f_dentry) {
    inode = filp->f_dentry->d_inode;
    }
    err = VNetFileOpIoctl(inode, filp, iocmd, ioarg);
    return err;


    to



    #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
    if (filp && filp->f_dentry) {
    inode = filp->f_dentry->d_inode;
    }
    err = VNetFileOpIoctl(inode, filp, iocmd, ioarg);
    return err;
    #else
    if (filp && filp->f_path.dentry) {
    inode = filp->f_path.dentry->d_inode;
    }
    err = VNetFileOpIoctl(inode, filp, iocmd, ioarg);
    return err;
    #endif

  6. Save this file and then open file vmnet-only/userif.c



    sudo gedit vmnet-only/userif.c

  7. Around line 526, change the following [2]



    return skb_copy_datagram_iovec(skb, 0, &iov, len);


    to



    #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
    return skb_copy_datagram_iovec(skb, 0, &iov, len);
    #else
    struct iov_iter to;
    iov_iter_init(&to, READ, &iov, 1, len);
    return skb_copy_datagram_iter(skb, 0, &to, len);
    #endif

  8. Save this file and then re-tar the modules. [1]



    sudo tar -uvf vmnet.tar vmnet-only

  9. Delete the previous working directory. [1]



    sudo rm -r vmnet-only

  10. Run the GUI (Workstation or Player) again and let it to build the modules.




References



[1] : An answer from nonsleepr.

[2] : A write-up from Robert Gadsdon.


[#20197] Wednesday, June 16, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ardingiba

Total Points: 497
Total Questions: 95
Total Answers: 109

Location: Gabon
Member since Sat, Jan 15, 2022
2 Years ago
;