Skip to content

Instantly share code, notes, and snippets.

@mag911
Last active July 14, 2023 20:56
Show Gist options
  • Star 67 You must be signed in to star a gist
  • Fork 12 You must be signed in to fork a gist
  • Save mag911/1a5583a766467d6023584d738cee0d98 to your computer and use it in GitHub Desktop.
Save mag911/1a5583a766467d6023584d738cee0d98 to your computer and use it in GitHub Desktop.
Parallel Tools fix for Ubuntu 20.04, 19.04, 19.10, 18.04

Update 25 April 2020:

Many thanks to @KZL1992 @tomslominski @ptrofi @n-thumann for recent comments on their experiences with 20.04 and Parallels 13/14/15, especially the subsitution of the latest prl-tools-lin.iso for older Parallels to get it going.


First off, credit goes to github.com/rudolfratusinski for leading the way here.

https://gist.github.com/rudolfratusinski/a4d9e3caff11a4d9d81d2e84abc9afbf

In a very similar approach, copy the files from the Parallels installation media and drop them in a folder somewhere (eg. ~/parallels_fixed)

Go to the kmods directory (cd ~/parallels_fixed/kmods) and extract the files (tar -xzf prl_mod.tar.gz)

Remove prl_mod.tar.gz file from that directory (rm prl_mod.tar.gz)

Find this file: ~/<your-folder-goes-here>/kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/prlfs.h

Modify the file by going to line 16 and inserting a new line. Add this text: #include <uapi/linux/mount.h>

The file should now look like this. Save and exit.

..
#include <linux/fs.h>
#include <uapi/linux/mount.h>
#include <linux/types.h>
..

Go to the kmods directory (cd ~/parallels_fixed/kmods) and re-zip the files: tar -zcvf prl_mod.tar.gz . dkms.conf Makefile.kmods In case you missed it, yes that is a period(.) sitting there by itself and necessary.

Go to the installer directory cd ~/parallels_fixed/installer

Sudo chmod the script files: install-cli.sh (and others) to be executable eg. sudo chmod 777 *.sh

( @7feilee reports that if drag and drop is not working, then also try sudo chmod 777 prl* as the next step after chmod'ing the above script files ).

Then run that file with: sudo ./install-cli.sh -i --verbose

Reboot when it's finished.

@andyrudoff and @katter - many thanks for highlighting the file name correction.

@VirtualL - many thanks for highlighting it works on Ubuntu Mate 19.10 as well.

@Koongcen - many thanks for highlighting it works on Ubuntu 18.04 as well.

@BarryDeng - many thanks for highlighting it works on Ubuntu 20.04 as well.

mag@bloss.io www.bloss.io

@xkzl
Copy link

xkzl commented Jun 1, 2020

In case someone gets the crazy idea of updating Ubuntu with the most recent kernel (currently 5.7 while I am writing).
Here are the additional commands to fix issues for kernel > 5.5.
(from the root of the copied directory "~/parallels_fixed" )

FILELIST="./kmods/prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze/prlfs_freeze_compat.h"
FILELIST="./kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_common.h $FILELIST"
FILELIST="./kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/prlfs_compat.h $FILELIST"
FILELIST="./kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c $FILELIST"
FILELIST="./kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/super.c $FILELIST"
FILELIST="./kmods/prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze/prl_fs_freeze.c $FILELIST"

for FILE in $FILELIST; do
sed "s/file_operations/proc_ops/g" -i $FILE
sed "s/.write/.proc_write/g" -i $FILE
sed "s/.unlocked_ioctl/.proc_ioctl/g" -i $FILE
sed "s/.open/.proc_open/g" -i $FILE
sed "s/.read/.proc_read/g" -i $FILE
sed "s/.release/.proc_release/g" -i $FILE
sed "s/.mmap/.proc_mmap/g" -i $FILE
sed "s/.llseek/.proc_lseek/g" -i $FILE
sed "/.*.owner.THIS.MODULE./Id" -i $FILE
done

sed '25iKBUILD_EXTRA_SYMBOLS := $(DRIVER_DIR)/../../../../../prl_tg/Toolgate/Guest/Linux/prl_tg/Module.symvers' -i ./kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/Makefile

NB: The main issue is due to a change in a structure of the kernel "file_operations --> proc_ops"
(commit:3dfa92633af3; git diff -w 9ef20389622d 30745068fb39)

Cheers

@CarlBye
Copy link

CarlBye commented Nov 16, 2020

Additionally, I had to modify the following files:
./kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/Makefile:20
DRIVER_DIR ?= $(shell pwd)
./kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/Makefile.v26:18
$(MAKE) -C $(SRC) M=$(shell pwd) SUBDIRS=$(shell pwd) SRCROOT=$(shell pwd) CC=$(CC) modules

NB: That is for Ubuntu 20.04 "kernel 5.4.0-21" and Parallels: 14.1.3 (45485).

thx, it works!!!

@johnZYW
Copy link

johnZYW commented Dec 2, 2020

Wonder if anyone has the same error message as i after run sudo ./install-cli.sh -i --verbose

[
Screenshot from 2020-12-02 16-20-14

@mag911
Copy link
Author

mag911 commented Dec 2, 2020

Wonder if anyone has the same error message as i after run sudo ./install-cli.sh -i --verbose

[
Screenshot from 2020-12-02 16-20-14

What Ubuntu version are you trying to put Parallels 14.0.1.45154 client tools on?

@johnZYW
Copy link

johnZYW commented Dec 2, 2020

Wonder if anyone has the same error message as i after run sudo ./install-cli.sh -i --verbose
[
Screenshot from 2020-12-02 16-20-14

What Ubuntu version are you trying to put Parallels 14.0.1.45154 client tools on?

ubuntu 20.04

@mag911
Copy link
Author

mag911 commented Dec 2, 2020

What Ubuntu version are you trying to put Parallels 14.0.1.45154 client tools on?

ubuntu 20.04
And you didn't miss any steps in the instructions? Maybe delete the folder and start clean?

@johnZYW
Copy link

johnZYW commented Dec 2, 2020

What Ubuntu version are you trying to put Parallels 14.0.1.45154 client tools on?

ubuntu 20.04
And you didn't miss any steps in the instructions? Maybe delete the folder and start clean?

yes, i have tried multiple times and all gave the same error. I actually found an instruction that did solve the error https://forum.parallels.com/threads/parallels-vm-tools-on-gentoo-vm-gcc-install-error.346287/. But an new error comes out.

try2

@johnZYW
Copy link

johnZYW commented Dec 2, 2020

What Ubuntu version are you trying to put Parallels 14.0.1.45154 client tools on?

ubuntu 20.04
And you didn't miss any steps in the instructions? Maybe delete the folder and start clean?

yes, i have tried multiple times and all gave the same error. I actually found an instruction that did solve the error https://forum.parallels.com/threads/parallels-vm-tools-on-gentoo-vm-gcc-install-error.346287/. But an new error comes out.

try2

I made extra modification following @swchiow and now it worked !

Additionally, I had to modify the following files:
./kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/Makefile:20
DRIVER_DIR ?= $(shell pwd)
./kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/Makefile.v26:18
$(MAKE) -C $(SRC) M=$(shell pwd) SUBDIRS=$(shell pwd) SRCROOT=$(shell pwd) CC=$(CC) modules

NB: That is for Ubuntu 20.04 "kernel 5.4.0-21" and Parallels: 14.1.3 (45485).

@Shvitel
Copy link

Shvitel commented Dec 16, 2020

hey! I have a new approach,Just load the prl-tools-lin.iso of parallels desktop to ubuntu can worked !
Here is the download link => Google Driver
QQ20201216-230059@2x
QQ20201216-225835
E96276FA656E0D403CED863FAEADAC00

@OptimusGREEN
Copy link

This post above worked a treat, thanks.!

@holiday-sunrise
Copy link

holiday-sunrise commented May 21, 2021

I got the following error:

`Error:

Started installation of Parallels Guest Tools version '15.1.4.47270'
Error during report about start installation of parallels tools.

Fri May 21 13:14:50 CEST 2021
Start installation or upgrade of Guest Tools
new version of parallels tools
Installed Guest Tools were not found
Register service to install new Guest Tools
Perform installation into the /usr/lib/parallels-tools directory
make: Entering directory '/usr/lib/parallels-tools/kmods'
Will use compiler CC="cc".
Compiler version "cc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0"
cd prl_eth/pvmnet && make CC=cc
make[1]: Entering directory '/usr/lib/parallels-tools/kmods/prl_eth/pvmnet'
make -C /lib/modules/5.8.0-53-generic/build M=/usr/lib/parallels-tools/kmods/prl_eth/pvmnet CC=cc
make[2]: Entering directory '/usr/src/linux-headers-5.8.0-53-generic'
AR /usr/lib/parallels-tools/kmods/prl_eth/pvmnet/built-in.a
CC [M] /usr/lib/parallels-tools/kmods/prl_eth/pvmnet/pvmnet.o
LD [M] /usr/lib/parallels-tools/kmods/prl_eth/pvmnet/prl_eth.o
MODPOST /usr/lib/parallels-tools/kmods/prl_eth/pvmnet/Module.symvers
CC [M] /usr/lib/parallels-tools/kmods/prl_eth/pvmnet/prl_eth.mod.o
LD [M] /usr/lib/parallels-tools/kmods/prl_eth/pvmnet/prl_eth.ko
make[2]: Leaving directory '/usr/src/linux-headers-5.8.0-53-generic'
make[1]: Leaving directory '/usr/lib/parallels-tools/kmods/prl_eth/pvmnet'
cd prl_tg/Toolgate/Guest/Linux/prl_tg && make CC=cc
make[1]: Entering directory '/usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg'
1: /lib/modules/5.8.0-53-generic/build
2: /usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg
3: 20210521
4: 1.7.0
Start compile prl_tg...
make -C /lib/modules/5.8.0-53-generic/build M=/usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg SRCROOT=/usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg CC=cc modules
make[2]: Entering directory '/usr/src/linux-headers-5.8.0-53-generic'
1: /lib/modules/5.8.0-53-generic/build
2: /usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg
3: 20210521
4: 1.7.0
CC [M] /usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.o
/usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c: In function 'prltg_proc_create_data':
/usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c:405:46: error: passing argument 4 of 'proc_create_data' from incompatible pointer type [-Werror=incompatible-pointer-types]
405 | return proc_create_data(name, mode, parent, fops, data);
| ^~~~
| |
| struct file_operations *
In file included from /usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c:10:
./include/linux/proc_fs.h:103:31: note: expected 'const struct proc_ops *' but argument is of type 'struct file_operations *'
103 | extern struct proc_dir_entry *proc_create_data(const char *, umode_t,
| ^~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[3]: *** [scripts/Makefile.build:286: /usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.o] Error 1
make[2]: *** [Makefile:1777: /usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg] Error 2
make[2]: Leaving directory '/usr/src/linux-headers-5.8.0-53-generic'
make[1]: *** [Makefile:42: prl_tg] Error 2
make[1]: Leaving directory '/usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg'
make: *** [Makefile.kmods:31: compile] Error 2
make: Leaving directory '/usr/lib/parallels-tools/kmods'
Error: could not build kernel modules
Error during report about failed installation of parallels tools.
Error: failed to install Parallels Guest Tools!

`

What can i do.

@varette
Copy link

varette commented Jul 27, 2021

The Parallels Guest Tools from version 15 aren't compatible with linux 5.6 and above. I wrote a quick and dirty patch to update the kernel modules. The instructions are mostly the same as above. Use at your own risk, I am not an experienced kernel developer and mistakes in kernel modules could potentially corrupt data inside the VM. (you'll know if something's wrong when ubuntu pops a dialog about an "internal error")

Here are summarized instructions for the preparatory steps, there are more details above:

  1. Download Parallels Desktop 15
  2. Inside the dmg file, find prl-tools-lin.iso (inside of the .app directory) and move it out
  3. Connect the ISO image in your linux VM
  4. Inside the VM, copy the entire content of the guest tools disk into a directory in your home directory
  5. In the directory you have copied, find prl_mod.tar.gz in the kmods directory, extract it.
  6. If not already done, open a terminal shell in the directory into which you have extracted prl_mod.tar.gz

We're now ready to apply the patch. Here the instructions diverge from those above:

  1. Download the patch. Save it in the same directory where you extracted the tar archive
  2. Apply the patch from the command line by running patch -p1 < parallels-15-guest-tools-patch-for-linux-5-6.patch
  3. You can now re-compress the files back into the tar archive
  4. And now run the installer

I have tested it on ubuntu 20.04 (focal) and the modules load without error. The graphic drivers work. Clipboard sharing might not be working, and I haven't tested folder sharing.

@Yensan
Copy link

Yensan commented Jun 18, 2022

I use paralels desktop 14.0.1 (45154), Arch/Alpine/openSUSE...(they are all 5.15.x), then, failed. Parallels installer can't find path of linux-headers.
parallels sucks in Linux. I must say it is annoying.
I give it up.
Although higher version have more function, but old version save RAM, this is why I use parallels 14.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment