Parallels tools 18.0.1 fail to build on RHEL 9.0

Discussion in 'Linux Virtual Machine' started by ThierryL4, Sep 4, 2022.

  1. ThierryL4

    ThierryL4 Bit poster

    Messages:
    7
    Hello,
    I just upgraded to Parallels 18.0.1 and the tools fail to build on RHEL 9.
    The actual system is Alma Linux 9.0, an exact RHEL clone. The kernel is 5.14.0-70.22.1.el9_0.x86_64

    Disclaimer: this is NOT the same issue as https://forum.parallels.com/threads/parallels-tools-do-not-install-on-rhel9.357546/ which applied to Parallels 17. I had this one with Parallels 17 and I had to apply the patch. With Parallels 18, this is another error.

    In the build log file, the error is now:
    CC [M] /usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.o
    In file included from /usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_common.h:25,
    from /usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c:19:
    /usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c: In function 'prl_tg_write':
    /usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_compat.h:123:29: error: implicit declaration of function 'pde_data' [-Werror=implicit-function-declaration]
    123 | #define prl_pde_data(inode) pde_data(inode)
    | ^~~~~~~~
    /usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c:248:30: note: in expansion of macro 'prl_pde_data'
    248 | struct tg_dev *dev = prl_pde_data(FILE_DENTRY(filp)->d_inode);
    | ^~~~~~~~~~~~
    /usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_compat.h:123:29: warning: initialization of 'struct tg_dev *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
    123 | #define prl_pde_data(inode) pde_data(inode)
    | ^~~~~~~~
    /usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c:248:30: note: in expansion of macro 'prl_pde_data'
    248 | struct tg_dev *dev = prl_pde_data(FILE_DENTRY(filp)->d_inode);
    | ^~~~~~~~~~~~

    It seems that RHEL kernels are always specific (the installation is correct on Fedora 36 with a more recent kernel).
    Any fix?
    Thanks
     
  2. ThierryL4

    ThierryL4 Bit poster

    Messages:
    7
    The problem seems fixed in version 18.0.2.
     
  3. ThierryL4

    ThierryL4 Bit poster

    Messages:
    7
    The previous response is incorrect (I booted the wrong VM by mistake).
    The problem still exists in 18.0.2.
     
  4. JamesR57

    JamesR57 Bit poster

    Messages:
    1
    I have the same error on RHEL 9.0 ( kernel:5.14.0-70.26.1.el9_0.x86_64) on Parallels Version 18.0.2 (53077)

    I get the same compile issues:

    /usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c: In function 'prl_tg_write':
    /usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_compat.h:123:29: error: implicit declaration of function 'pde_data' [-Werror=implicit-function-declaration]
    123 | #define prl_pde_data(inode) pde_data(inode)
    | ^~~~~~~~
    /usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c:248:30: note: in expansion of macro 'prl_pde_data'
    248 | struct tg_dev *dev = prl_pde_data(FILE_DENTRY(filp)->d_inode);
    | ^~~~~~~~~~~~
    /usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_compat.h:123:29: warning: initialization of 'struct tg_dev *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
    123 | #define prl_pde_data(inode) pde_data(inode)
    | ^~~~~~~~
    /usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c:248:30: note: in expansion of macro 'prl_pde_data'
    248 | struct tg_dev *dev = prl_pde_data(FILE_DENTRY(filp)->d_inode);
    | ^~~~~~~~~~~~

    # cat /etc/redhat-release
    Red Hat Enterprise Linux release 9.0 (Plow)


    If there's any additional information that I can provide to help resolve this please ask.
     
  5. DamienS4

    DamienS4 Bit poster

    Messages:
    2
    This patch worked for me on 18.0.3 (and the previous version).

    ---- Start of patch----
    diff -Nurb ../work-orig/prl_eth/pvmnet/pvmnet.c ./prl_eth/pvmnet/pvmnet.c
    --- ../work-orig/prl_eth/pvmnet/pvmnet.c 2022-08-25 13:03:30.000000000 -0400
    +++ ./prl_eth/pvmnet/pvmnet.c 2022-09-05 11:20:43.240351842 -0400
    @@ -424,6 +424,8 @@

    #ifdef RHEL_CHANGE_MTU_EXTENDED
    .extended.ndo_change_mtu = eth_change_mtu,
    +#elif RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9, 0)
    + .ndo_change_mtu = dev_set_mtu,
    #elif LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
    .ndo_change_mtu = pvmnet_change_mtu,
    #else
    diff -Nurb ../work-orig/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c ./prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c
    --- ../work-orig/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c 2022-08-25 13:03:31.000000000 -0400
    +++ ./prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c 2022-09-05 11:30:17.681845578 -0400
    @@ -374,7 +374,11 @@
    }
    #endif
    /* Set DMA ability. Only lower 4G is possible to address */
    +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,18,0)
    + rc = dma_set_mask(&pdev->dev, DMA_BIT_MASK(64));
    +#else
    rc = prl_set_dma_mask(pdev, DMA_BIT_MASK(64));
    +#endif
    if (rc) {
    printk(KERN_ERR "no usable DMA configuration\n");
    goto err_out;
    diff -Nurb ../work-orig/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_compat.h ./prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_compat.h
    --- ../work-orig/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_compat.h 2022-08-25 13:03:31.000000000 -0400
    +++ ./prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_compat.h 2022-09-05 11:32:38.723948920 -0400
    @@ -119,10 +119,10 @@
    #define prl_set_dma_mask(pdev, mask) pci_set_dma_mask(pdev, mask)
    #endif

    -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0) || defined(PRLTG_RHEL_9_0_GE)
    -#define prl_pde_data(inode) pde_data(inode)
    -#else
    +//#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0) || defined(PRLTG_RHEL_9_0_GE)
    +//#define prl_pde_data(inode) pde_data(inode)
    +//#else
    #define prl_pde_data(inode) PDE_DATA(inode)
    -#endif
    +//#endif

    #endif /* __PRL_TG_COMPAT_H__ */

    ----End of patch----
     
  6. AlanS18

    AlanS18 Bit poster

    Messages:
    5
    DUmb question here ... what's the procedure to apply this patch? Is it intended to be applied to the contents of the image downloaded by parallels that gets mounted as a CD/DVD image in Parallels when you select the "Instal Parallels Tools" menu option? Do we need to make a copy of the files from that image somewhere for patching before you apply the patch? What's the exact syntax of the patch command to be used?

     
  7. DamienS4

    DamienS4 Bit poster

    Messages:
    2
    Here is a more detailed step-by-step for applying the my patch.
    Take the patch I posted above and save it to a file (i.e. /tmp/pt-kmods-almalinux9-patch.diff).
    # Make a working directory and cd into it...
    mkdir pt_temp
    cd pt_temp
    # Copy the parallels tools files from the directory on which it is mounted.
    # For instance "/run/media/<my-user-name>/Parallels Tools"
    cp -a "/run/media/<my-user-name>/Parallels Tools/*" .
    # Now we need to cd into the kmods directory, make it, and the
    # prl_mod.tar.gz file writable
    cd kmods
    chmod 755 .
    chmod 644 prl_mod.tar.gz
    # Create a tmp directory to work in so we can untar the "prl_mod.tar.gz" file.
    # The resulting unpacked directories contain the files that need to be patched.
    mkdir tmp
    cd tmp
    tar xzf ../prl_mod.tar.gz
    # Now we can apply the patch. While still in the tmp working directory,
    # Run the following patch command. This example assumes the patch file
    # is "/tmp/pt-kmods-almalinux9-patch.diff". Use the location of your
    # patch file.
    patch -p0 < /tmp/pt-kmods-almalinux9-patch.diff
    # You should see output like this:
    patching file ./prl_eth/pvmnet/pvmnet.c
    patching file ./prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c
    patching file ./prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_compat.h
    # If there were no errors, you can now recreate the prl_mod.tar.gz file
    # using the patched files.
    tar czf ../prl_mod.tar.gz
    # With the patched prl_mod.tar.gz, we can now go to the top of the pt_temp
    # working directory and run the Parallels Tools command-line installer.
    cd ../..
    sudo ./install
    # Follow the prompts to complete the Parallels Tools installation.

    Good luck...
     
  8. AlanS18

    AlanS18 Bit poster

    Messages:
    5
    When using this on Rocky Linux 9.0, kernel 5.14 I get the following. Any idea waht's going wrong? Or if this is still a problem with the latest Parallels Tools?

    patching file ./prl_eth/pvmnet/pvmnet.c
    patch: **** malformed patch at line 8: .extended.ndo_change_mtu = eth_change_mtu,
     
  9. AlanS18

    AlanS18 Bit poster

    Messages:
    5
    I can confirm that the latest Parallels Tools install without error now for me on Rocky Linux 9.0 with the latest versions in all cases.
     

Share This Page