Lutris/Wine secondary user

How do you launch gog games through lutris with multiple users?

my games are located /mnt/STORAGE/Games

When I try to launch a game on a secondary account games fail.

terminal outs something about not being the owner, I don’t have the ability to recreate the issue at the moment.

My guess is I need to input some kind of chmod for /mnt/STORAGE/Games, but I haven’t had any luck yet.
I want it to be done for directory and all sub-directories.

I thought I’ve heard some say it’s a limitation with wine, but if anyone knows a fix that would be great.

One thing beforehand: I could be evil So refer to manpages before you type random stuff into the terminal, all the commands below are in it.

You need to first create a group, e.g.:

sudo groupadd gamers

Then add all your users to that gamers group:

usermod -a -G gamers user1
usermod -a -G gamers user2
usermod -a -G gamers user3
...

You can check if your current user is in the right group(s) using:

groups

Then put the group onto the directory, you can use either chown [user]:gamers /path/to/directory or chgrp gamers /path/to/directory.

And finally actually change the permissions:

chmod -R g+rx /path/to/directory

Note that I didn’t include the w permission as presumably the games don’t write to the directory once installed (except for updaters, in which case you could add them per game). But you can also add it right away, your choice.

2 Likes

Thanks, Technically works, but I have a side issue.

When the directory is located in user1’s home directory I get this error from user2’s when trying to run a game.

[Errno13] Permission denied: '/home/user/Games/absolver/user.reg

What would be a good permission command solve that problem? Thanks

To be honest I wouldn’t start messing with permissions in home directories to begin with. IMO you should move the games outside the home directory into some shared directory you create on your own.

But either way, first you should check who the owner of the file in question is and which group it is assigned to. The chmod above should have taken care of assigning the group to every directory and file recursively due to the -R argument.

Did you run the chmod with or without w as I mentioned? I didn’t think of WINE games when I wrote that, so it turns out you probably need write permission at least on every of those reg files.

Anyway, to check permissions you can simply do:

ls -l /home/user/Games/absolver/

This should get you something like this:

[[email protected] ~]$ ls -al /home/tarulia/Games/the-witcher-3-wild-hunt/
total 2868
drwxrwxr-x.  4 user group    4096 Jan  6 01:54 .
drwxrwxr-x. 10 user group    4096 Dec 27 00:07 ..
drwxrwxr-x.  2 user group    4096 Jan  5 21:50 dosdevices
drwxrwxr-x.  8 user group    4096 Apr 15  2019 drive_c
-rw-rw-r--.  1 user group 2847008 Jan  6 01:54 system.reg
-rw-rw-r--.  1 user group      11 Apr 27  2019 .update-timestamp
-rw-rw-r--.  1 user group    3322 Apr 15  2019 userdef.reg
-rw-rw-r--.  1 user group   56571 Jan  5 21:50 user.reg
-rw-rw-r--.  1 user group      49 Apr 27  2019 winetricks.log

user would be the file owners username, while group would be the assigned primary group, which should be gamers in your case.

If the group is not correct then either something went wrong with applying the group, or that game was installed after applying the group. Though I should think the group would be applied when a new file is created as well.

If the group is correct however, then you have 2 options:

  1. Run the chmod command above, but with the w switch this time. This will apply write access to every file, which would be less headache, but everyone in the group can write (including deleting) files.
  2. You can apply permissions recursively to select files. You could do something like this (inside /home/user/Games:
find . -type f -name *.reg -exec chmod g+w "{}" +

This will find every file (-type f) with the fileextension .reg (-name *.reg) and run a chmod g+w on it, giving group write access on every file found. If it turns out more WINE files need write access then you can either do 1. or 2. again with different file names.

Thanks for the info, ya I typically plan to run games off secondary drives, I just happened to try and allow second user to run games off the main drive for a laptop.