Sharing Steam Games on Two Different Linux Distributions
// File #5
// Date: 2014-03-15
// By: junktext (William Paul Liggett)
// FYI: See the 'Boring Legal Footnote' for warranty and attribution notices.
// Questions? E-mail: firstname.lastname@example.org
Here is a tip for the Linux nerds out there who want to be able to have multiple distributions (like Fedora, Ubuntu, and Slackware) installed on their computer, on different partitions of their computer's hard-drive, but would also like the freedom and simplicity of only using one storage location for their Steam games. (If you're unaware of what Steam is, please see this link. I'll also be the word "distro" to refer to a 'Linux distribution', which is used interchangeable in practice.)
The good news is that this is quite easy to do. I have tested and confirmed this myself, and this document reflects my actual set up on my PC, so I know it should generally work for most people's situations running multiple Linux distros on the same computer.
However, be aware: I am not quite sure if doing what I am about to suggest would work well for sharing the same Steam game data between a Linux and Windows partition (which may be problematic, since they use two different types of disk file formats, such as NTFS/FAT vs. ext4/ext3). So, if this is your goal, then please stop reading and look elsewhere. Sorry.
Okay, back to the Linux-to-Linux sharing of Steam files... But, please understand, the best way to accomplish this goal is to install the Steam client separately on both of your Linux distributions, then you will later share the actual game files (which takes up the most space). Yes, you'll have two copies of the Steam client (one on each Linux distro), but this is because each distro typically has variations on how to properly build/run the Steam client (because of different directory structures and so forth).
Therefore, with this in mind, you need to do the following (and I will repeat myself again):
- Install the Steam client on both of your Linux distributions. If you're unsure of how to do this, please first try searching your distro's software repositories for "steam". For example, for Ubuntu, all you need to do is type in "steam" in the Ubuntu Software Center. Or, if you have Fedora, you'll first need to enable the RPMFusion repository source and then type in terminal: su -c "yum install steam". For further details on either of these suggestions, please see Valve's instructions here. For me, I am running Fedora 20 (64-bit) and Ubuntu 13.10 (64-bit) on my computer, with each distro installed on its own partition. Therefore, as I just stated, I installed the Steam client, separately, in each distro. Okay, I hope my point was stressed enough here :-). Also, for reference, my Steam's version simply states, "Built: Feb 25 2014 (Steam package version: 1393366296)", but I assume future versions of Steam will work in a similar way.
- Next, simply create or pick a folder some place where both of your Linux distros can physically read and write data to it (don't do anything yet, though). For me, I actually have a third partition, which I aptly called SweetData, to allow me to share data and documents and the like across my Linux distros. But, before I explain further, I will note that you should not need to have a separate data partition for this trick to work. All that matters is that each distro has the ability to see the common folder and can write data to it.
Additionally, since Linux is awesome (and more awesome than Windows in my opinion), usually there is no problem for two different distros to browse and share nearby partitions of an alternate distro. Depending on the distro, you may have to type in your administrator password to open up external partitions like this initially, but that's okay, you can still use such a location for the common game data storage.
However, I have another warning if you already have a working copy of Steam on one of your distros: The method I used to share my Steam games has the actual game files stored to a totally separate directory than where the client files are located. A typical Steam install only has one location created (which houses both the client and game data). So, before proceeding, please do yourself a favor and backup any vital game files or configurations now to a safe place (that is, if you have any custom files that may not be automatically stored on Steam's cloud), as you will need to uninstall and reinstall all of your Steam games (but not the client itself) for everything to work flawlessly. This uninstallation process only needs to occur one-time, but if both of your distros have game data then you'll need to uninstall all of your games on each distro before proceeding further. To uninstall a game in Steam, you first need to look in your Library, and on the left-hand menu you will right-click on a game title and then select "Delete Local Content...". Please go ahead and delete your Steam games now (again, but not the client).
Alright, so for me (using my SweetData partition), I created a folded titled "1. Linux Apps" that has a sub-folder called "SteamWPL". You can create these types of folders manually, or you can have Steam do so for you. Both of these folders I am using were simply created and labeled as such only because of my personal preferences. For me, I like to prefix some folders with a number so that they are always listed first in a directory, and I use the "1. Linux Apps" folder for other program data that I might share between my two distros. The "SteamWPL" folder simply has my initials of WPL as a suffix to remind me that I created the folder, not Steam. Therefore, you do not need to create two folders, but I would advise you to at least create a folder similar to "SteamWPL" because if you ever run into problems later on, you know exactly which folders to move around.
Regarding the actual creation of the folders, I mentioned you can do this manually as you would with any other folder on your computer, or you can use Steam. It is probably easier to do this manually with your existing file browser GUI (e.g., nautilus) or with a terminal like Bash. In the Steam client, you can do this by clicking on the "Steam" menu on the top-left, and then click on "Settings", next select the "Downloads" section on the left-hand menu. From there, you'll see at the very top is a portion talking about 'Content Libraries' with a big button labeled "STEAM LIBRARY FOLDERS", click on this and then click on the "ADD LIBRARY FOLDER" button. You'll then use that to create your common data directory for both distros to use. See the screenshots below, as they showcase this area in the Steam client.
I will show you visually what these folder locations look like on both my Fedora 20 and Ubuntu 13.10 distros. They both are using the exact same physical data blocks on my hard-drive, but they appear different because Fedora and Ubuntu mount partitions differently (namely because, structurally, they are two very different Linux distros). Here you go:
As you'll notice, Fedora sees my SweetData game folder as:
/run/media/junktext/SweetData/1. Linux Apps/SteamWPL
Whereas Ubuntu says:
/SweetData/1. Linux Apps/SteamWPL
Again, they are both the exact same physical data blocks on my hard-drive, but each distro might be a bit different with where it knows how to reference these data blocks. (Also the "/home/junktext/.local/share/Steam" is actually a real folder that IS being used by my Steam client. But, for whatever reason, Steam shows it as using 0 bytes, but this is false. This is where a lot of the Steam client files are located, taking up to about 1 GB of space, for each distro. I believe Steam is simply saying that my game files in that location equals nothing, which is true. Essentially, don't worry about this weird aspect on the Steam client. Moreover, there is a slight difference in the amount of storage used shown on my screenshots of my SteamWPL folder. But, this is only because I didn't take the screenshots on the exact same day for each distro depicted, so there were game updates later on.)
Okay, I hope you got the gist. If you haven't done so already, go ahead and create your common game folder some place that makes sense to you. As a tip, you can create the folder under your primary Linux distro's partition (e.g., Fedora). Then, if you use Ubuntu for testing or if you switch out/overwrite the secondary distro often (to try out other distros), you'll know that your Steam game files are always safe regardless of what you do with your secondary distro.
- Tell Steam to use your common game folder. You might have already done this if you had Steam create your common folder for you. Otherwise, if you manually created a folder, just open up Steam and then click on the "Steam" menu on the top-left, and then click on "Settings", next select the "Downloads" section on the left-hand menu. From there, you'll see at the very top is a portion talking about 'Content Libraries' with a big button labeled "STEAM LIBRARY FOLDERS", click on this and then click on the "ADD LIBRARY FOLDER" button. After you find the folder you want, make sure to click on the "SELECT" button. I have another screenshot below to show you what I mean:
- Install your games in Steam. At this point, you can safely begin downloading all of your Steam games (from whatever distro you are currently in). From here on out, all of these game files will be stored to the folder you specified. Likewise, both of your Linux distros will be able to use the same files with no problems. Just remember to point your other distro's Steam client to this common game data folder. Also, bear in mind that if you need to type in your administrator/root password to access the common data folder location (such as it being stored on another partition), and if you have NOT fully mounted that partition (i.e., you rebooted), that if you attempt to run Steam it'll appear as though you have no games installed. All you need to do is mount that partition (open up your file browser and click on the partition's icon or use an automated method), type in the correct password, and restart Steam. I just say this so you don't call me a liar accidentally.
If you enjoyed this tip or have questions, feel free to send me an e-mail at email@example.com. Also, you can follow me on Twitter at @junktext.
This article was also posted on GamingOnLinux.com.
Boring Legal Footnote:
There is no warranty of any sort provided by this Geeky IT Advice document. I try my best to provide accurate information, so you should likely not experience issues as long as you follow my instructions correctly. However, in order to protect me from any potential legal suit, you are hereby informed that any data loss or computer system problems caused from you following my advice will be your own responsibility to fix. Although, you can e-mail me to alert me of any technical inaccuracies that this document might have and I will revise the information accordingly. Thank you for your understanding.
Linux is a registered trademark of Linus Torvalds.
Fedora is a registered trademark of Red Hat, Inc.
Ubuntu is a registered trademark of Canonical Ltd.
Slackware is a registered trademark of Slackware Linux.
Steam is a registered trademark of the Valve Corporation.
Valve is a registered trademark of the Valve Corporation.
Windows is a registered trademark of the Microsoft Corporation.
Lastly, at the time of this writing, none of the above trademark holders are associated with junktext.org.