How do I package for Linux from Windows?

This may be a newbie question, but I am trying to package my game for Linux from a Windows computer. When I am in the UE4 Editor, I go to File → Package Project → Linux, just like I usually do for packaging my Win-64 version. But I keep getting the error: “Sorry, packaging a code-based project for the selected platform is currently not supported. This feature may be available in a future release.”

I have been trying to follow the instructions found on the “Compiling for Linux” page (A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums) and followed the steps. I installed the Linux-x86_64 cross compile toolchain, set it up with the Powershell script (as administrator), made sure the environment variable was set, and I ran the GenerateProjectFiles.bat before restarting Visual Studio. Maybe I am supposed to re-write the Environment Variable? The variable value is different in the guide. This is mine:

I noticed that Linux was not available with the Solution Platforms. I am not sure if that is what the instructions meant when it said, “After this, you should have “Linux” available among Win32/Win64 configurations, and you should be able to cross-compile for it.”

But as far as I can tell, I followed the steps right. I am just not really experienced with this type of thing, so I don’t know if I am going about this the wrong way. Perhaps I missed a step or I have to do this through Visual Studio. If so, I need help/instructions on how to do so. Sorry if this is something really basic or obvious! Like i said, I am new at this. I’m just trying to package my game so that my friend on a Linux can try it out. Thanks in advance!

Hey Psykopomp-

After setting you your first screenshot, did you re-run GenerateProjectFiles.bat for the engine you’re using? If so, please try setting up the toolchain manually without using Powershell and let me know if you still have the same issue.

Yes, I did re-run GenerateProjectFiles, but I am not sure how to set up the toolchain manually. Are there any resources on this? I fixed the absolute path to the LINUX_ROOT in the environment variables, as it was set to something completely off, but it still doesn’t allow me to package for Linux.

Thanks for your help so far!

Try re-downloading the toolchain and extracting it to a location other than where it is currently (I put it on my D drive rather than the C). I then ran the Setup.bat from the toolchain folder and copied the OutputEnvVars.txt info into the Environment Variables. After running GenerateProjectFiles.bat Linux did appear in the solution platform dropdown.


1 Like