derrod / legendary

Legendary - A free and open-source replacement for the Epic Games Launcher
https://legendary.gl/discord
GNU General Public License v3.0
4.59k stars 164 forks source link

The ability to run Legendary in a Container #305

Closed AutoUpdatingBSoD closed 2 years ago

AutoUpdatingBSoD commented 3 years ago

Is your feature request related to a problem? Please describe.

Hello,

I have inadvertently created two epic games accounts and after going over with epic's support team, they claimed there was no easy way to switch between the two. I don't like to constantly be logging into games clients on my own PC. Games clients aren't remotely close of a security risk to me as things like web browsers and firewalls, where I am significantly more careful. I also use a password manager to save my credentials and since epic games store doesn't tell you what games your specific account owns as opposed to other accounts on your pc, I want a way to make this process as painless as possible for me.

I found this client and I was hoping I could run this in separate directories and have it work that way, but that doesn't appear to be the right answer either. Either that or I can't find where legendary saves credentials locations, because both directory's legendary executables point to the same credentials.

Describe the solution you'd like

I would like some way to run Legendary in a container so that I can run either one of my account's installed games with much less hassle. If there's a way to pass credentials this way already that would be amazing.

Describe alternatives you've considered

The only thing I can think of is passing the authentication token each time using something like xdotool to get the browser token manually, but that's a security risk in of itself to pass that in the browser.

Edit: I forgot existing containerization tools like Docker, but I'm not sure if that's what I'm exactly looking for in this instance.

Additional context

I don't know what screenshots or context I can provide that would be helpful in this case, I'll provide specific ones on request.

RW74 commented 3 years ago

Hi, if you are using arch maybe this can help you, I am using this: https://github.com/intgr/ego it allows to run app using a different account, I run through it steam and legendary without any problem. otherwise is still a good reference to eventually adapt it to your distribution

AutoUpdatingBSoD commented 3 years ago

Unfortunately, Arch Linux Distros are not at a usable point for me for Gaming. Maybe I could get away with making my workstation Manjaro-based, but for gaming, that's not plausible right now. Right now I'm stuck on Windows 10 unfortunately (mainly due to how Anti-Cheat still won't work on Wine properly, and how libraries on Lutris go out of sync far too quickly).

However, if there's a way to use this with WSL, I'd be glad to give it a go.

Thanks for bringing that to my attention @RW74

Edit: This is not to say Arch has a bad package manager, far from it. I've contributed to it in my day where I saw there were problem areas. I also firmly believe Steam Deck will make Arch development much better for the future, and maybe even solve my major concerns with things like Lutris randomly breaking certain games.

But that is in the future and this is now and I'm looking for a solution that will work right now. I should also mention I have over 700 games just on PC and getting specific ones working has historically not been fun when using Linux. That's the one advantage Windows 10 still has over Arch Linux/Manjaro: There may be a sharply increased risk of viruses, or bloatware in the OS that causes a gradual slowdown and/or storage space misuse, or the rare risk of an automatically-updating BSoD (thank you for watching my Ted Talk!). But when I click on that .exe file I can count on Windows to just open it. When time is a factor in getting so much set up at once, that's huge. It's even worth reinstalling once every three years or so whenever there's slowdown because backups from drives and backup installers make things so much easier than on Linux/Proton with things like Denuvo forcing reinstall of the entire game when you switch Proton versions (and I 100% agree that Denuvo is wrong for this but it doesn't make Linux any easier for gaming).

I'm not 100% off of Arch distros, for the record. My laptop's Manjaro. I also completely hope Steam Deck takes off like the hype begs it will. I just don't want it to be the final nail in Linux Gaming's coffin where Gaming is basically just Nintendo, Sony, Microsoft, Apple, and Google dominated with a sprinkle of other companies here and there.

BraINstinct0 commented 3 years ago

A very uneducated guess of mine is that (since it's doable on Arch) using two Arch docker containers will work(tho I'd say it's a bit too much) on your Manjaro linux. On Windows? I do not know, maybe using SandBoxIE(for 'sandboxing' instead of docker or VM-level jobs) might work(though this also is not a good solution) will technically allow the use of two accounts. WSL(WSL2) - don't put too much hope in it yet, since WSL(which is WIP) + Wine/Proton/etc(Not 100% compatible) = Less rates of success.

AutoUpdatingBSoD commented 3 years ago

@BraINstinct0 Why exactly is SandBoxIE not a good solution? I didn't exactly get that to work anyway...

When I meant to use with WSL/MSYS, I meant as a possible way to redirect Legendary via PowerShell. I'm working on a similar project designed to port Open Hexagon to Android when I have time to do so. I know that MSYS programs like GCC, make, etc. are really just a bunch of windows executables.

I don't think it's impossible to build from source on Windows to some extent. At this point I have a little familiarity with how MSYS2/WSL works so would that be possible to compile this, and then reroute EGS games using Legendary through MSYS2?

Edit: it's been a while since I've looked and I forgot Ego uses Xorg and Wayland.

BraINstinct0 commented 3 years ago

When I meant to use with WSL/MSYS, I meant as a possible way to redirect Legendary via PowerShell. I'm working on a similar project designed to port Open Hexagon to Android when I have time to do so. I know that MSYS programs like GCC, make, etc. are really just a bunch of windows executables.

I don't think it's impossible to build from source on Windows to some extent. At this point I have a little familiarity with how MSYS2/WSL works so would that be possible to compile this, and then reroute EGS games using Legendary through MSYS2?

Consider WSL to be a complete linux which can communicate with windows(technically half correct but if it compiles on linux, it will probably on wsl.)

AutoUpdatingBSoD commented 3 years ago

@BraINstinct0 I finally got the chance to actually try it for myself. I had to install firefox on both Sandboxes but it works. May be some performance issues but it's definitely better than relying on Epic Games for an answer.

My issue is resolved for now at least.

AutoUpdatingBSoD commented 3 years ago

@BraINstinct0 I do have one last question for you if you have the time, but it's more of a personal preference than a hard requirement for my needs.

I can't seem to find how to call SandBoxIE in the terminal, to call a terminal. The use case would be to run each game in Steam with its own configurations. Can you help me please? Thanks in advance!

AutoUpdatingBSoD commented 3 years ago

I could write a bash script I guess, but how would I actually call that with SandBoxIE through steam?

BraINstinct0 commented 3 years ago

https://sandboxie-website-archive.github.io/www.sandboxie.com/StartCommandLine.html This might be a good place to start, but I won't have much time for a while(several days). Besides, I understood your preference as below: Run each Steam game as separate SandboxIE sandbox, with preconfigured settings/launch options/etc. Each game should be launched from the terminal.

Did I understand appropriately?

AutoUpdatingBSoD commented 3 years ago

@BraINstinct0 you did. I had to sign off for a bit to be out and about. I'll check here in a few. Thanks!

AutoUpdatingBSoD commented 3 years ago

I got a test game running using links you provided. Actually works better than expected!

For anyone who needs this, the command I used was:

"${SandboxIE_Directory}\Start.exe" /box:${box_name} "${legendary_directory}\legendary.exe" launch ${game_ID_name_from_legendary} | cmd.exe

Replace the variables with your respective names and directories and it works like a charm (at least for me). Tested with Ghostbusters Remastered.

Thank you so much to both of you @BraINstinct0 and @RW74 !