Getting started with Linux

From Linux Gaming
Revision as of 00:34, 17 January 2022 by Aragorn (talk | contribs) (→‎10. Troubleshooting: change links)
Jump to navigation Jump to search

1. Prelude

This is a community-maintained version of the Guide: Migrating to Linux in 2020 written by u/PBLKGodofGrunts.

I recommend reading the whole article, but if you feel overwhelmed with too much information or too many options, here is a short version that should work:

  • First, and foremost: Be prepared that nothing works as you would expect. Linux does not try to copy Windows. Stuff works differently. You will probably not be able to use the software that you're used to. But usually there is different software that might even be better.
  • Your experience will be much better if you have supported hardware. Your RGB keyboard may not blink in the way you want it to blink. You might not be able to change your mouse DPI or lift-of-distance. At least not out of the box and not without hassle. Wifi and Bluetooth are also known to be problematic. Check if your model is supported, or get a supported model. If you can choose your GPU, chose AMD. If you have a laptop that is unsupported, not all features will work out of the box, or might not work at all or without bugs. Normal functionality of other components is usually unproblematic, you should not have to worry about your CPU, RAM, etc.
  • Not all games work. Check lutris.net and protondb.com for information about what games are currently working. Most games that don't use anti-cheat work, even if they are not listed. However, they might not work without tweaking.
  • Use Pop!_OS. It might not be the best for everyone and everything, but it's a popular choice, and you should not face too many weird issues. If you don't know how to install it, watch this video. Use Balena Etcher (ignore what he says about rufus), and ignore the part about the alternative for shadowplay (assuming that you don't want that). Note, that Pop!_OS has two versions. One for Nvidia, and one for everything else. Install the version for Nvidia GPUs if you have one.
  • Use Steam (Runtime) for Steam games (if you don't know how to install it, watch the video linked above). Go to Steam -> Settings -> Steam Play and check "Enable Steam Play for all other titles" and then select "Proton Experimental" in the drop down menu. If something doesn't work, check out Proton-GE
  • Use Lutris for all other Windows Games. If something doesn't work, check out Wine-TKG
  • If you have an AMD GPU, install CoreCtrl. If you previously chose Pop!_OS, input the following in the terminal:

    sudo add-apt-repository ppa:ernstp/mesarc
    sudo apt-get update
    sudo apt install corectrl

    Otherwise look here for instructions. Open CoreCtrl, and add a profile for every game, or edit the global settings to your likings.

  • When Linux gives you a warning, take it seriously. It's not your average "You could harm your computer" bullshit you are used to from Windows.

  • Disable Composition: Your games will run like shit if you don't disable it. Read more here.

2. Getting Started

So, you want to get started in Linux. The most important thing you need to remember is that you're using Linux.

Now that might seem obvious, but you'd be surprised how often you'll see "Why isn't this easy like in Windows?" or "I just want it to act like my Mac."

While I do understand that it's hard to get used to something you're not familiar with, I promise that, in time, it will be just as comfortable as Windows or macOS.

Curious to see Linux gaming in action before getting your feet wet? /u/PCgamingFreedom has an amazing thread with a huge list of Youtubers that play games on Linux.

Want to checkout the latest news for Linux gaming? Take a trip to GamingOnLinux. They also have a great wiki that covers more topics than this one.

3. The software

Perhaps the biggest hurdle of using Linux is compatibility issues with the software you currently use. Before you get started on your journey, I would highly recommend you do a bit of prep work here.

  • Which software do I commonly use?
    • Get a pen and paper and start writing a list. Include your most played games (and the ones that you are sure that you will want to play in the future) and the software you need for a computer to be your daily driver (Office, Photoshop, etc).

Now that you have a list, let's check. There are four possible outcomes for each item in your list.

  • You will be able to run it natively.
    • This is almost always the best case scenario, since it's the one where you will get all the performance and compatibility without drawbacks.
  • You will be able to run it, but not natively.
    • You'll most often find this with Proprietary software and is the nature of using closed source software. We have a few tricks up our sleeves that we can try and we'll get to those a little later.
  • Cloud Software (SaaS or Software as a Service)
    • Though not ideal, especially in a world where owning your own software is becoming less and less common, a lot of business and professional software can be run "in the cloud". Office 365 is a prime example and allows people like me to work on Linux computers at work since I can still access all the Microsoft Office applications required to interact with my coworkers.
  • You won't be able to run it.
    • This is the big one, the one that will hold you back. Sometimes, and it's not your fault, there is a killer app that you absolutely need in order for your computer to be useful to you. While it would be great if the OSS community provided a good alternative to you, we understand that this is not always the case. There's no shame in this. Thank you for trying.

In order to catalog your list into these four outcomes, you grab the first item on the list. If it's a game, check in SteamDB if the game does have Linux support (Note: Sometimes the game offers Linux support even if it's not listed here or in steam). In 2018, Valve released a compatibility software called Proton that is based on Wine. Check ProtonDB (used to be called Steam Compatibility Reports) to see if your Windows only games run fine under it. If it's software, just check in the official website if there's a Linux version.

If you've done that and there's no Linux support, we go to the next step. Bring up the Wine AppDB and put there the name of your software. Click on the link that fits the most your search (Usually the first link, ignore all the [Bug XXXXX] results) and check the rating of the game. Generally you'll be able to use it if it's not bronze or garbage. If you click in the version of the software, you'll see reports of people who have tried to run it, known bugs and general instructions and steps to follow. For now we're just cataloging the software, so we'll see how to actually install it later. If there's no search results there's still hope. Do a quick google search (probably "NameOfTheSoftware Wine support") and see what happens. If the software you want to use is really small and unknown probably nobody tried it, but just leave it marked as "dubious" or something because you may be able to run it anyways.

If what you want to run shows as garbage in there (and most of the times bronze, you seriously want to read the reports to see what works and what doesn't) you just put it in the "I won't be able to run it" section. Now repeat with each element of the list until you've gone through your list.

There is also a paid for solution called Crossover made by CodeWeavers. CodeWeavers are the same minds behind Valve's Proton so you should expect a pretty good product in general. They have a search feature that you should also use.

I will mention that some games are more problematic then others. For example, League of Legends is notorious for needing custom versions of Wine to get working. Thankfully, it has a dedicated subreddit /r/leagueoflinux which has the latest news and tends to be very helpful.

You got your list and a general idea of what you can run and what you can't run and at which degree you will be able to use it. If you have something that needs to be run but you can't run, here's a small list of alternatives you can use.

  • Look for an alternative. If it's a game I'd say that you should look for games with similar tags in steam. If it's software use something like alternativeto
  • Use a windows VM. Useful if the software you want to run is not resource intensive (99% of the time games won't like this, so don't use this for games unless you're going to attempt the GPU passthrough option)
  • Dual boot.
  • GPU passthrough. This is hard. You need to met a lot of requirements and invest time, but if you can pull it out you can get the best of both worlds. The Level1Techs forum has been one of the driving forces behind using this technology and has a lot of information on the subject. (You can also check out their Linux Youtube channel)

4. The swap (Distributions, or "versions" of Linux)

If you are here, congratulations! You want to get started with Linux and you have all your software narrowed down. In order to get started in the odyssey of Linux, you have to think about what distribution (informally referred to as distro) you want to use. The distribution is just the flavor of Linux you want to use. Just to be clear from the start, pretty much every distribution is equally capable of gaming and running software. The differences between them are:

  • The preinstalled software.
    • Some are more minimalist than others, but all of them can run the same software. With enough patience, you can turn one distribution into another just by installing and removing stuff.
  • The update frequency.
    • Some distros release updated software faster than others. Distros that push out updated software with minimal testing are known as bleeding edge distros or rolling release distros. If you want to be up to date with features, you want a bleeding edge distro, but in exchange for the latest and greatest features you run an increase risk of running into bugs. Stable Release distros usually have to wait longer for updates, but those updates are often heavily vetted before being pushed out.
  • The community.
    • Different distros have different communities. The distros that are perceived to be easier or more user friendly tend to have communities that are quicker to help with easy to follow instructions.
  • The other minor things including default configurations, art, fonts, etc.

If you want to avoid problems:

  • Choose something with KDE or Gnome.
  • Don't choose a "stable" distribution because "stable" usually means "old".
  • Don't choose a niche distribution because this probably means that you don't have good software availability.
  • Don't choose something with Wayland if you can't use FreeSync.
  • Some distributions make problems if you change the default desktop environment. For example, if you want to use Ubuntu with KDE, choose Kubuntu.

Now that I've explained that, let's have a look at different distributions.

First a list of some "easy" distributions:

Easy distributions
Distribution Explanation
Pop!_OS Pop!_OS is a Linux distribution developed by System76 based on Ubuntu, using the GNOME Desktop Environment. Has a Nvidia and a AMD/Intel image for convenience. (Recommended by LTT) If you don't know what to choose, pick this one.
Ubuntu LTS The latest Ubuntu LTS (20.04 as of this writing). Ubuntu also has a new-user-friendly community but is heavily discussed because of some design choices.

If you're feeling particularly adventurous, there are other distributions, that might work great for you. Particularly Arch and Arch based distributions are known to work great for gaming, but also to require more knowledge.

Advanced distributions
Distribution Explanation
Garuda Garuda is an ArchLinux based distro. Uses the offical ArchLinux software repositories. Ships with useful software for gaming. Is made to be user friendly.
Manjaro Based on ArchLinux, but uses its own repositories and includes other features like automatic graphic card drivers installation. Is made to be user friendly. (Recommended by LTT)
Endeavour Endeavour is an ArchLinux based distro. Uses the offical ArchLinux software repositories. Very minimal. You will need to use the terminal.
Fedora Made by Red Hat, one of largest open source companies, which use the dnf package manager and has a lot of officially supported desktop environments.
Solus Solus brings updates to its users by means of a curated rolling release model.
openSUSE Offers both a rolling release (Tumbleweed) and a regular release (Leap) option.
Linux Mint Offers two versions. "Linux Mint" is based on Ubuntu and "LMDE" is based on Debian. The default desktop environment of Linux Mint, Cinnamon is nice, but doesn't get the most attention. You might face problems here.
elementary OS Based on Ubuntu, elementary OS strives to be user-friendly and deliver a cohesive aesthetic and user experience.
GamerOS If you are looking for a Steam-centric, couch-gaming-friendly Linux distribution, this might be what you are looking for.
Others There are a ton of Linux distros out there. Feel free to browse distrowatch if you're bored.

If you are having trouble deciding, just start with Pop!_OS. It's not the flashiest, but you're almost guaranteed to find an answer to your problem if you search "My Problem Pop!_OS" or "My Problem Ubuntu" (Pop!_OS is very similar to Ubuntu) in your favorite search engine (make sure to limit the search to only things from the past year). You can always switch later.

Most of them will let you install next to Windows and set up a dual boot automatically. Be careful though, Windows Updates have a bad habit of changing the boot loader and it will look like your Linux OS vanished. REMEMBER TO DO BACKUPS. Things can always go wrong and you don't want to lose anything. It's FOSS has a video on dual booting if you'd like a visual example, but it basically boils down to you clickin an option that says "Install along side Windows".

5. The habit (what to do after the installation)

So, you've installed your distro and you have your computer running Linux. Congratulations! The absolute most important part of becoming a Linux user is to consistently use Linux! The last step is to get all of your software back running so you can use your computer as a daily driver.

A few things first:

This is rather controversial, but you do not be afraid of the terminal. While the terminal is absolutely not required to do your normal day to day activities, you'll often find solutions to your problems require you to enter a few lines into the terminal. This isn't any sort of magic and it's nothing to be fearful of using, if you want you can think of it a bit like a voice assistant that works with text. The reason for this is because the terminal is, generally, distro agnostic and it's easier to explain one line of code instead of having lots of different pictures showing you what to click in each distro.

Second, use the internet! Everyone starts as a beginner at some point. You might be very comfortable in Windows or macOS now, but at some point you had no idea what you were doing. That's very normal! As you use Linux more and more you'll gain the knowledge and experience needed and eventually it will feel like home. There's absolutely no shame in asking questions!

If you are coming from Windows, you are probably used to search for an .exe and install it by double clicking. Things are way different here. Installing software individually is often discouraged. The reasons for this varies, but security and compatibility are the main reasons. So what do you do in Linux? You use a package manager. Think of it as being similar to the Play store, but instead of random people uploading software to it, everything is maintained by your distribution's software team.

Package managers have a lot of benefits that may not be immediately obvious to new users. The package manager knows what other software is required to work on your system and can manage updating all of the software pieces you have without you manually having to handle it. As I mentioned earlier, since your distribution's software team creates these packages, the chances of installing malware on your system is very slim.

Remember when I said don't be afraid of the terminal? Here's a good example as to why. To install Steam on Ubuntu, Linux Mint, or most other distros that derive from Ubuntu, all you have to do is open a terminal and type:

sudo apt install steam

Video example. And that's it. Steam is installed, from a trusted source and with everything it needs. Do you want to update all the stuff installed in your system?

sudo apt upgrade

Let's break those two lines down a bit so you know what's going on. sudo stands for "super user do". You can think of this like right clicking and choosing the "Run As Administrator" in Windows. apt is the package manager's name. install is the command to install programs. steam is the steam software. So in English we just said. "Please install the "steam" program as administrator (called root on Linux)."

Now, if you wanted to use the graphical way, I'd have to post pictures from Ubuntu, Mint, etc and they all look slightly different and you have to find their front end in different places. It's just easier this way.

So what do you do if the software you need isn't in your package manager? The next best thing is to add a 3rd party repository to your package manager. As an (educational) example, let's add Google Chrome. Note, that the following procedure is not recommended for various reasons, including, but not limited to Chrome being considered spyware. UbuntuUpdates.org give the following instructions:

wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
sudo apt-get update
sudo apt-get install google-chrome-stable

That looks a bit scary, but it's just adding the security key and repository to your system and then installing Google Chrome. You'll want to use a PPA of your software when possible since it will update with the rest of your system.

6. Windows compatibility

So you can't find a Linux version of that software you want to install? Our last step is to try Wine. Wine is a compatibility layer that tries to translate Window Binaries (.exes) calls into Linux calls. Sometimes this works really well, and other times nothing happens at all.

For Steam games you can just use Steam. For games that are not on Steam, use Lutris. Your last resort is the following:

First, let's install Wine.

sudo apt install wine

On some systems, installing Wine allows you to double click an .exe and it will try to run just like in Windows, but if not, you'll want to open a terminal and type (credit to /u/whyhahm for suggesting cd to directory before running):

cd /path/to/program; wine file.exe

Remember to check the ratings and know issues in the wine AppDB so you know what you can expect, and you should be golden. Here's an in-depth guide of wine stuff but again, google and find how stuff works and it works. If you don't understand, please ask! The community is usually happy to help!

There are also other programs that try to help you with Wine, like PlayOnLinux.

6.1. DXVK/D9VK/Gallium Nine/VKD3D

What are DXVK/D9VK/VK9/Gallium Nine? I'll let the projects explain themselves:

DXVK: Vulkan-based D3D11, D3D10, and now D3D9, implementation for Linux / Wine

D9VK: Used to be separate from DXVK, but now they are one project. Kept separate on this page for searching.

Gallium Nine: Gallium Nine allows to run any Direct3D 9 application with nearly no CPU overhead, which provides a smoother gaming experience and increased FPS. Gallium Nine requires you to be using the Mesa3D driver though, so Nvidia users are out of luck. (Thanks to /u/MicroToast for the clarification)

VKD3D (and its currently more active -proton fork): Translates D3D12 to Vulkan. Still in its early stages, but is already capable of running most games.

Okay, but what does that mean?

Direct3D (the graphical part of the DirectX API) is what most Windows game built after ~2000 use. You don't really need to know any technically details about it other than the fact that it's a Windows' only API. For the longest time, one of the biggest bottle necks for gaming on Linux was translating the Direct3D calls to OpenGL (a cross platform graphical API that works on Linux/most other OSes).

All of these projects attempt to translate Direct3D calls to something that Linux understands. As far as I'm aware, the most used one is DXVK.

Proton and Lutris both have support for automatically using these technologies, so you don't have to worry about what to do in order to take advantage of them.

Using these technologies you can get very good performance, sometimes even better than on Windows! Cyberpunk 2077 for example gets 40% more FPS in this video. Note, that this is not true for all games, though. Some games still run with less FPS, in general you can expect about the same performance. Also note, that this is not the default experience, but a heavily optimized Linux install. Your default experience will be worse.

7. Improving performance

The default settings are probably not the best for a flawless experience. Read more here

8. Nice things

You don't need the following. But you might find them useful for special use cases.

9. Downloading stuff from GitHub/GitLab

You might find yourself in the situation where you want to download something from GitHub or GitLab. Don't do it, as long it's not absolutely necessary. This is usually a bad idea. Try to find a better solution (for example post here in the forum). But here is how to do it:

  1. Install git. If you're on Pop!_OS or other Ubuntu/Debian-based distributions: sudo apt install git
  2. On GitLab there is a button called "Clone", on GitHub it's called "Code". Click it. You will see an URL like this: https://gitlab.com/some/stuff. Copy it (for example by clicking the button right next to it).
  3. Open a terminal, and navigate to the folder where you want your stuff. For example, by typing cd repos if you have a folder repos in your home folder.
  4. Type git clone (and type a space). Then paste the URL by pressing ctrl + shift + v. Then press Enter.

10. Troubleshooting

I personally can't spend a lot of time helping people individually. That's where this and other communities come in!

When asking about your problems, remember to give as much info as you can. For example, include what Distro you're on, what you have already tried, any error messages that come up, anything you've changed recently, etc.

10.1. Common issues

Vulkan games (native, Proton, Wine with DXVK) don't run (no Vulkan support)

11. Going further

If you want to learn more about Linux and the command line, this is a great resource to interactively learn: https://linuxjourney.com/

12. The end

u/PBLKGodofGrunts put this guide under the WTFPL License. Please attach this license when sharing or modifying this guide. I hope that this is helpful to someone.