Skip Navigation

Hosting windows to play games

I saw from a post that you can basically host your own mini windows inside of linux to play games with, and you can choose what to share with that little windows so microsoft can't track you in any way. Does anyone have a tutorual/guide for that? Also what Distro would be best for it?

34
34 comments
  • What you're probably referring to is running a virtual machine with VFIO passthrough. I hate to be that guy, but this is one of those "if you have to ask for help, you probably shouldn't do it" kind of situations. It's complicated and easy to mess up, requires a decent amount of knowledge of both Linux and Windows, and every situation is unique. There's no cookie-cutter way to set it all up.

    But if you're willing to buckle down and learn anyways, the best way would be to do it from scratch. This is the best documentation I'm aware of on the subject, but it's tailored heavily for Arch Linux, a rather advanced distro to use.

    https://wiki.archlinux.org/title/PCI_passthrough_via_OVMF

    22
  • There are a few ways...

    The easiest is using Steam, which handles everything for you (once you flip a switch in settings). The second easiest is using Bottles or Heroic, both of which lets you run Windows games and apps on Linux via Wine. The third is VMs, but that's just Windows itself running virtualized (in its own virtual machine) in Linux. The fourth way to use the same computer for Linux and games is to dual boot (reboot from one OS into the other) and stick with Linux except for particular games that might not work with other methods — which is thankfully very rare these days (as most games work in Linux via Proton or in Wine via Bottles or Heroic).

    1. Steam on Linux has a switch in the settings to enable Proton for all games. Flip that on, and it's basically transparent. For setting up Steam, the easiest way is to install it from Flathub.org. Depending on your distribution, it's most likely set up for you. If not, then follow the setup guide @ https://flathub.org/setup. Once Flathub is set up on your system, you can install the flatpak of Steam from your app store (GNOME Software, KDE Discover, etc.)

    2. An alternate method is to set up Wine outside of Steam. There are a few ways to do that; Bottles is the most straightforward and super easy way, letting you have different Wine environments for different apps or games (or just one for everything, if you'd rather)... Bottles is easy to use and has installers for a lot of common apps and launcher. Additionally, Heroic is also a good way to run GOG, Epic, and Amazon games on Linux. Both are on Flathub too.

    3. There's a third major way, and that's installing Windows as a virtual machine on Linux. You'd probably want to use GNOME Boxes or virt-manager for that. Boxes is easier (and on Flathub) and will give you adequate GPU performance for a lot of things (however, isn't ideal for high performance gaming), but if you have two GPUs (often one integrated and one discrete), then you can use GPU passthrough with virt-manager, but that's way outside the scope of this comment. 😉 Perhaps having a Windows install in a VM just for some games that don't work on Linux is what that person meant? But that would still get you tracked by Microsoft whenever you're using Windows in that VM. (So I'm guessing they're talking about Wine instead, which is option 1 and 2.)

    4. Dual boot is basically reusing the same hardware for two different operating systems, but only one at a time. When you're in Linux, Microsoft doesn't track you (unless you're using Edge on Linux or specifically using a Microsoft service). You'd want to minimize your time in Windows.

    You could use any of the above or a combination (perhaps even all of the above), depending on what you want. I only use 1 and 2 myself. While I do play a lot of games, all on Linux, I don't play any that require Windows.

    (There are only a few these days that don't work on Linux. The notable ones I'm aware of are Fortnite, Destiny 2, Genshin Impact, and a few others that rely on lootboxes where the maker didn't flip the switch to enable "anti-cheat" on Linux. Most everything else works these days, even a lot of other lootbox/pay-to-win games.)

    8
  • The Distro isn't super important, since Valve started shipping their own runtime (for Linux ports) and Proton (for Windows games). Anything modern outside of the strictly free-software distros (things like Ututo, Guix, etc. which do not ship proprietary firmware or drivers of any kind) will suffice.

    There are a few different approaches to playing Windows games. Some have direct ports. Games like Doom, Quake, were open-sourced a long time ago and have dozens of ports with all sorts of features. Other games, like CS:GO, Kerbal Space Program, X-Com: Enemy Unknown, etc. are not open source, but have ports produced by either the developer or the publisher. A LOT of indy games have ports available, and most modern game engines like Unreal, Unity, Godot, etc support Linux targets (whether the publishers give a shit is another story.) These typically target the Steam Runtime (a collection of specific versions of graphics, audio, and auxiliary libraries that Steam will install). These libraries are also provided by distributors, but the distribution libraries will typically be newer. This is normally a good thing, but commercial ports don't receive frequent updates and are likely only tested against the Steam Runtime.

    If there is no port available, the next option is Wine. Wine is a Windows compatibility layer which is capable of loading Windows PE format executables on Linux and dynamically linking them to a large collection of substitute DLLs which implement Windows functionality on top of Linux. Proton is the version of Wine shipped by Steam, with a bunch of tweaks specifically focusing on graphics performance. Most of the time, games will work in Proton, but there are a handful of cases where they work in Wine/Wine-Staging but not in Proton.

    If the game requires an anti-cheat component, it will almost certainly not work in WINE/Proton, because the whole basis of getting Windows games to work on Linux operates using the same mechanism as cheats: replacing "genuine" components of the Windows operating system with 3rd party code to intercept system calls and do something other than intended.

    A much more complicated route would be to set up a virtual machine. A virtual machine is a full blown PC-emulator, except since the host machine shares the same instruction set as the guest, it is a lot faster. This is not enough not yield good performance in games though, because games also require direct access to the video hardware. To do this, you need a SECOND graphics card for the guest operating system, then you can try to configure PCI-e passthrough (so the video driver in the guest OS talks directly to the video hardware). This is probably the most complicated approach, but you end up running genuine Windows virtualized on real hardware. In addition to the second GPU, you need to make sure you have the overhead in CPU / RAM / storage to run multiple operating systems concurrently such that gaming performance won't be substantially impacted. Additionally, you probably need a second monitor if you want to interact with both the guest and host operating system simultaneously.

    Finally, if none of that works, it may be worth looking into whether ports for other platforms exist. If you struggle running a dated Windows game in WINE, you might have better luck emulating a release for PS2/3, GameCube/Wii/WiiU/Switch, etc. The state of Nintendo platform emulation in particular is phenomenal, and it is trivial to increase the video resolution beyond what the official hardware supports if your machine has the horsepower for it.

    5
    • I see, It seems virtualization won't be the way to go as I don't have a second monitor nor a second GPU.

      1
  • It's pretty advanced. You'll need 2 GPUs (so gaming laptop or gaming PC with at least 2 graphics adapters) and some more advanced Linux stuff like editing kernel/boot configs, messing with drivers, and BIOS settings.

    Look at BlandManStudios on Youtube, he has a bunch of tutorials on this. But make sure you back up your system because, like I said, it's not a simple setup.

    2
  • 2
    • Just a thing to note, if you’re considering virtualizing windows to play games that have anti-cheat software like BattleEye if they notice you’re virtualizing windows it might ban you. You’re almost better off using the other advice here and using proton with those that support it. For things that don’t you probably will have to flip the setup around and have the base os be windows and virtualize Linux :(

      3
      • yes, thank you for the advice, I appreciate it!

        1
  • Are you talking about a VM ?

    2
  • Thank you everyone for all the lengthy and informative replies! I appreciate them all. I'll probably go with gaming normally on linux and not do anything fancy

    1
  • Not sure what you mean. You can virtualize a whole windows machine but that will NOT be good for performance.

    What you really want is a compatibility layer than maps syscalls to your linux kernel and emulates a windows filesystem. I'm fairly sure that's what Wine and Proton do, but am no expert.

    If you install steam (on most distros) it should also install Proton to play games with (check ProtonDB for which games work well). Again no expert but maybe this helps a little.

    1
  • I remember there being a script for fedora, that apperently workes since it made me realize my PC only has one GPU (no GPU)

    1
  • As the other comment says, what you're referring to is running a Windows VM (virtual machine) inside of your Linux machine. It's a great asset for a lot of things, but gaming is not it's strong point. A VM shares resources with it's host machine, meaning it can only access so many of your CPU cores, utilize only so much of your RAM, and take advantage of CPU powered graphics -- unless, as was pointed out in another comment, you happen to have a spare graphics card laying around. The set up for GPU passthrough is more trouble than it's worth, IMO, especially for gaming. And you still have the other bottlenecks to contend with.

    Gaming on Linux is best enjoyed by using a combination of Wine and Proton (Wine suped up for the express purpose of gaming by the fine folks behind Steam) paired with a launcher of some kind, usually Steam. For non-Steam games, Lutris is a fantastic second choice. These platforms make gaming on Linux easier than ever, and are actually the technologies powering the SteamDeck. If you decide to go this route and need any help setting up, please reach out! The community is here and (usually) quite helpful, lol.

    If you decide to try the VM anyway, you should look into a software called VirtualBox. You will need to install a few packages to make your system a suitable host, and you'll need the Windows installation ISO image to get it up and running. You can usually acquire it directly from Microsoft by running a search for "Windows XX ISO" where the XX is the version number you're looking for. If you need help getting any of that together, I'd be glad to assist as well. ☺️

    All this comes from years of running Linux and only Linux, on a PC I almost exclusively game on. I've had great success, especially with all the headway Valve has made into making the ecosystem viable and accessable.

    However you decide to proceed, best of luck to you!

    EDIT: As has been pointed out, if you want to virtualize a gaming setup, you should look into KVM, not VirtualBox! It sounds like it's a much more performant option, I am just not very familiar with it myself.

    -1
    • If you decide to try the VM anyway, you should look into a software called VirtualBox.

      God, please, no. Why do people insist on using subpar virtualization when KVM is far superior and built into the kernel? I will never understand.

      Please, I beg of you, stop this madness.

      7
      • Because it's accessable, and is also the extent of my knowledge in running a VM. I won't speak about KVM because I am not intimately familiar with KVM, nor will I ever be. I'm certain it's a better solution than VirtualBox, just as running games in Linux with Wine/Proton is a better solution than setting up a VM to game in.

        I'd be happy to hear about the details of why KVM is so superior, if you'd care to enlighten me! I'm always looking to learn new things.

        The real question is why we're down voting people who are adding to the discussion just because we disagree with them, instead of just having a conversation?

        3
    • thank you for the lengthy reply! I think I'll go with alternative options and not to virtualize windows, because I don't have a separate GPU that I can pass in, nor a second monitor.

      2
You've viewed 34 comments.