Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using multiple users on the same machine, games are downloaded in duplicity #3942

Open
crlsgms opened this issue Jul 31, 2015 · 8 comments
Open
Labels

Comments

@crlsgms
Copy link

crlsgms commented Jul 31, 2015

Well, I came to this with a computer that have 3 users, and after I setup a gpu on it, its possible to play some games, but we all have our own users / desktop envirionments already setup, and after tf2 ran just fine, the other user logged on steam on his user, and the game started downloading from scratch.

On another computer that I build to stay on my living room, the windows users are setup so they go straight to big picture, and if some games are owned / shared between the users they are all there, on program files/steamapps/common.

Searchin arround I found some suggestions:

  • Create a brand new user, and install games only on it and make it like a public user:

    So all others can play without downloading again, since they wont be on the same time on the box. The cons are that we cant multi task on our already known environment, and the auto login feature on steam gets useless, since we would have to log on each account everytime.

  • make a simlink from "some" folder so the new users could read the /common folder from another:

    I tryed to do this but linking the steamapps folder breaks the library for the other user. even using full permissions like 777 the steam client cant find previews installed games.

  • create a new folder with public access somewhere, add as a library folder to all users:

    well, its easy to create a 777 folder somewhere like /usr/share or /opt/ or whatever, and add to a user as another library. But on the other users, isnt possible to add a non empty folder, and even adding by hand the folder on the steamapps/libraryfolders.vdf it wont appear avaiable for this user, as so the games wont be detected by the client.

Well, for me its an issue since on windows its quite simple the program_files approach, but the /home/user/.steam on linux just blocks the possibility to a multi user machine to avoid downloading the games in duplicity. Maybe there are some workarround but I didnt manage to get it working. I tried this on a 64b Linux Mint 17.1.

@kon14
Copy link

kon14 commented Aug 28, 2015

What I do is I've set up a steam slave user on my machine to handle steam (under my own user's xsession).

I'm also using a unix socket for pulseaudio so as to be capable of accessing steam's (user) audio streams through my xsession and my own user's pavucontrol. The method to follow is described here, just make sure you use a unix socket rather than a tcp one for less overhead (described in Peter Funk's comment). Using pulseaudio in system-wide mode is problematic, insecure, cpu/ram intense and disables important featrures too so stay clear from it, sockets is the way to go.

I personally don't have to worry about multiple human users accessing steam, though that should probably work in your case, unless you require multiseat (which afaik doesn't work without tricks in windows either) in which case you're going to require some kind of sandbox in order to launch multiple instances of the steam client. There are some tricks you could resort to in order to launch multiple steam instances (different users) at the same time though I doubt you're going to need multiseat anyway. right?

Moving on to the how-to:

  • Create a steam user and possibly add him to a games/steam/other group if you want to have extended control over which users access what (I don't want my main account to run steam or anything related thus I don't have him in my games group and disable read-write access to Other users in those files, owned by games group)
  • Follow the pulseaudio socket method in the article above (unix sockets work fine if you too don't want the tcp overhead). This step could be left for last, it's not really important in order to test it out, though you'll need it for proper sound access from your normal user.
  • chown :games -R /home/steam/.local/share/Steam
  • optionally create a /home/steam/.bin or bin folder to place scripts etc and chown it too
  • make a /usr/bin/steam script with sudo -u steam /home/steam/bin/steam in it (this is where I store my steam user's symlink to the steam launch script in .local/share/Steam.....
  • edit the sudoers file with visudo and add this USERNAME ALL=(steam) NOPASSWD: ALL for all users that should need to execute steam (that should let them execute /usr/bin/steam which executes the steam.sh in steam slave's home as the steam user....)
  • If you feel like overloading your executables (like create a "steam" script in /home/steam/bin/steam which has the same filename with /usr/bin/steam) you will need to make sure you use absolute paths for all your scripts that might be overloaded or prepend the prefered user bin directories in their $PATH in ~/.bash_profile, that should get bash to check there first before /usr/bin/ etc (I understand this got a bit complicated, ask me and I will ellaborate)
  • I think that should be all, just login as a user and enter steam in a terminal or make a menu item, that should launch steam as the steam user, I think there must be some launch parameters for steam to help you autologin to the proper account for each user though I wouldn't know for sure.

I also have a small documentation text file I wrote concerning the setup in case I screw everything up and need to reconfigure, I'd be glad to provide it if you so desire. Hope you get this working, I understand I'm a bit late.

Apart from all the above I believe you could indeed setup a shared steam directory, yet I haven't taken the time to consider the requirements myself.

@crlsgms
Copy link
Author

crlsgms commented Sep 8, 2015

Thanks for your posting kon14, but it wont solve the issue I tryed to point for this matter.

What Im trying to achive, since steam have the family share options, indoor streaming and some other features focusing on the use of steam by multiple users / family members / friends, on the living room (suposing there would be a steam box, or a pc with steamos installed, not a bunch of pcs next to the TV)

Thinking on this path, to get an example If I have 3 kids and setup a pc on the living room for them, and each kid want his achievements in awesonauts for example, using the already mutli user big picture login, they will choose their own user to login, and play the game.

On windows it works fine. Pcs boots to big picture, the kid chooses its user, plays the game. On *nix / steamOS the game will vainly be downloaded again in duplicity, burdening the HD unnecessarily. It easily turns the focus on steamOS on the living room useless on a big family / house environment, where for now any windows install that boots into big picture seems more smart on hd usage than the linux version of steam.

@crlsgms
Copy link
Author

crlsgms commented Sep 8, 2015

After some chattin on irc, theres another point I need to documment:

  • the steamOS example isnt the better one, since there would be (preferably) only one system user, which will login into big picture, and them the user would choose his personal steam account. That said, the games would be on this system user /.steam folder.

The issue is more regarding a public computer, where users have their own system account to do all sorts of tasks on the computer, but when they would play something on steam the games they can access are only the ones on their own system folders, not only their personal configurations as on windows, that the games are all stored on the program_files/steam/common folders

@Oxalin
Copy link

Oxalin commented Dec 8, 2015

@crlsgms I may have a solution for you. What you'll need to do is to create a folder shared by the multiple Steam users. You'll have to add this folder in Steam and set it as the default installation folder. If needed, you'll be able to move your installed games to that shared folder so you don't have to download everything again.

First, you'll create a common folder, we'll call it "steam", somewhere accessible to everybody, let's say under "/opt/". So, you'll have "/opt/steam" where all the games of each of your users will be installed.

Now, for the next step, you may be faced with two different contexts:

  • *** I understand this is your context *** If each Steam users has his own Linux session, you'll have to put all these system users in a common system group, let's call this group "steam". Then, you'll have to change the group that is allowed to access the common folder to "steam" with "create and delete" permissions.
  • If all the Steam users are run from the same system session, you don't need to create a system group, associate the system users to it, than to create a folder where you'll modify the access rights for that given system group.

Finally, under each of your Steam users, you'll add the common folder as a new library folder: Steam->View->Settings->Downloads->Content Libraries, click on "STEAM LIBRARY FOLDERS" / ADD LIBRARY FOLDER / find your folder (in my example, /opt/steam).

Now, when you download a new game, a Steam user has to select the common folder and VOILA! Steam will see the content of games that are already installed and will use it; otherwise, Steam will install the game there, ready to be added for your other Steam users.

For help with your distribution on how you may create a group and so on, contact me in private with the distribution's name and version.

@thepowersgang
Copy link

I administer a large set of machines (10 desktops, with 5 currently linux and 5 windows) shared by around 60 people (active members of a university computer society).

All users have home directories served over NFS, so not only is installing games to the home directory duplicating data, it's also exceptionally slow.

The solution I've come to is to allow steam itself to be installed to ~/.steam or to ~/.local/share/Steam and set up a symbolic link to /opt/steamapps (which is kept world-writable by a cronjob).

This solution works, but often requires manual intervention for each user (when steam is newly installed, the symbolic link doesn't exist).

Idea

A preferable solution would be something similar to the steam service on windows that is in charge of installing games and managing permissions on the steamapps directory (either keeping them at world write-execute or allowing readonly access to normal users if the game allows it).

@alexbarcelo
Copy link

alexbarcelo commented May 21, 2016

As someone who has (very recently) a multi-seat (2 seats and 2 users, SO and me) and often plays Steam, I will give my two cents.

First of all, the filesystem centric idea, already commented by @thepowersgang, of (ab)using symbolic links in the steamapps folder is reasonable. Instead of doing the whole steamapps maybe I would do the common. I am not sure the purpose of all the folders and files in steamapps, and the big chunk of disk is used only by the common folder, so I thought that maybe it was safer that way. As the name indicates, I hope that the files there will be only the "common" files, wouldn't they?

Well... I have tested Talos and Battleblock. Install for two users, run them, stop, and look. Battleblock has identical common/Battleblock* folders (good!), but Talos has diverged because it uses some Log and Temp folders. That makes me cringe a little bit, because this means that maybe it is not safe to do this "common files" approach for all games and probably it is not safe to run simultaneously the game from two seats (different users, ofc).

@dottgonzo
Copy link

+1

@SuperSamus
Copy link

Related: ValveSoftware/Proton#4820.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants