Exporting on Windows for Linux, How do I actually run the game on Linux/Pop OS?

This may be more of a question about Linux then it is about MonoGame.

After following the instructions from here: Package games for distribution | MonoGame Documentation I was able to get a distributable package working on Windows and Mac.

Starting up the game on Windows is as simple as double clicking the .exe file and on Mac you just have to double click the .app “file”.


Linux export command

dotnet publish -c Release -r linux-x64 /p:PublishReadyToRun=false /p:TieredCompilation=false --self-contained

After running the above on Windows I just copied over the “publish” folder over to my Linux environment running Pop OS. I’ve barely used Pop OS or any Linux distro for that matter and I have no idea how to actually run the game. There’s no obvious file I gotta double click.

I know it should work because I setup a dev environment on Pop OS and it can run my game from VS Code. But I have absolutely no idea what to do with the distributable folder spit out by MonoGame. I’ve only gotten apps to work that I’ve downloaded through the Pop OS app store thing. I don’t know how you’re supposed to get apps acquired outside of that to work.

If anyone could point me in the right direction that would be great.

Thanks!

The file you are looking for will be your game name without an extension.
Before you start it, you will need to right click and select properties.
On the second tab, give Execute permission on Owner or Owner and Group.

Double click to run or ./gamename in the terminal.

Hope this helps,
pherbeas

1 Like

Alright so running it from the command line seems to work, thanks for that! I am getting errors in the terminal, but I played through my game and it worked really well.

I tried double clicking the same file, instead of running it in the terminal and I’m getting the following error. I’m not sure what it means, and clicking “Search in Software” does nothing as far as I know.

Screenshot from 2021-11-19 06-41-23

I tried fussing with the permissions in the properties windows but it didn’t seem to change anything.

Screenshot from 2021-11-19 11-50-46

I’m still not very acquainted with the Linux universe, so I’m not sure if this is the kind of user experience Linux users are expecting. If I just distribute this as is will Linux users be satisfied?

For Windows the thing you download looks like this:
Parent folder
- Application folder
- Double clickable Windows shortcut to .exe file in Application folder

And for Mac it’s even simpler:
Parent folder
- Double clickable .app "file"

What can I do to fix these problems and to make for a smoother experience on Linux like I’ve tried to do for other platforms?

Try changing the group access to read and write as well.

“Most” linux users will know about setting the permissions. There is a terminal command to change the permissions as well… chmod .

Here is a link that explains it:

The error is due to a double ‘/’ in the path.

Hope this helps.

1 Like