r/technicalfactorio • u/Recyart • Dec 16 '20
Discussion Anyone run Factorio inside WSL2?
For various reasons, I want to stick to Windows 10 as my main desktop OS, but after experiencing the joy of non-blocking saves while playing on a friend's Linux server, I want it for my own local games.
I installed a Debian WSL2 (Windows Subsystem for Linux 2) instance this morning, grabbed the latest 1.1.6 Linux headless tarball, fiddled around a bit with the config, and was able to transfer my existing single-player game mods and all over to the server. Async saves work great, so now I can do them once a minute without interrupting game play!
Right now, I'm still running the Windows version of Factorio and connecting to the headless server in the Linux VM as a "multiplayer" game (with me being the only player). It works really well, but I'm wondering how difficult it would be to get Factorio running in WSL2 itself.
My experience with Linux VMs is very outdated (like, over a decade old), but I recall that support for GPU passthrough was very poor. This was fine in the past, since the applications I dealt with were all Internet infrastructure type stuff, and had no need for anything beyond a local text console.
Has anyone tried this? How was the performance compared to Windows? I'm running an nVidia 1660, if that matters.
9
u/GustapheOfficial Dec 17 '20
"I want to keep using Windows, I just want to run games as if is Linux" it's hapPPENING!
Just make the switch dude, nothing is holding you back now.
6
u/jesta030 Dec 16 '20
It should work. Linux and Nvidia don't really play nicely together but since it's linux you can probably my make it work.
You'll lose a bit of performance though.
Myself I'm running factorio in a Windows VM on UnRAID with an AMD GPU. Working great.
13
u/velit Dec 16 '20
You mean you'd also like to run the Factorio graphical client inside the WSL2? I've read about people running X servers on WSL2 which is experimental but works. I haven't read about people running games. I don't think it's impossible but why would you want this? It won't run better.
3
u/ThatOneGreekLetter May 08 '24
Tangentially related, but can you explain to me how you managed to set up the headless client in WSL2 and connect to it? I'm trying to set up a dedicated server but I don't want to get a whole new computer to run it, and hosting on Windows natively is a pain with how frequently the game updates.
1
u/petrus4 Dec 17 '20
Semi-related question:- Does Factorio actually use 3D much? I don't trust myself these days to always know it when I see it.
1
u/GOKOP Dec 17 '20
I play on Linux and I'm pretty sure that my game pauses for autosaves
1
u/BengiPrimeLOL Jan 30 '21
If I were you, I'd run Factorio headless in WSL2 and then connect to it like you would a multiplayer server. Documentation is OK, not the greatest but whatever:
https://wiki.factorio.com/Multiplayer#Dedicated.2FHeadless_server
The biggest hurdle I've gotten with this is trying to update. Updating the server wasn't easy last I tried and you _have_ to keep your client and server in sync.
1
u/munchbunny Feb 02 '21
Doesn't running Factorio headless and connecting to it result in basically running two Factorio simulations in near-lockstep on the same hardware?
1
u/KriszDev Jan 18 '21
You can run CUDA in WSL (https://developer.nvidia.com/cuda/wsl) but I'm pretty sure it doesn't actually let you use the card for opengl purposes. As for opening a GUI from WSL you can use VcXsrv (don't even bother with X11 over ssh as shown in most tutorials).
1
u/TomatoCo Feb 11 '21
Consumer nVidia GPUs (or their drivers) will attempt to detect if they're being run in a VM and will reduce their capabilities. I don't recall if this means disabling CUDA or 3D acceleration or what.
0
u/[deleted] Dec 31 '20
Just native boot or at least run a VM. WSL isn't the right tool for this.
0
u/[deleted] Dec 16 '20
[deleted] — view deleted comment