It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
Hello!

I'm not sure how many FreeBSD/PC-BSD users are on here, but I thought I'd post my questions here anyway and hope for some insightful comments on getting Linux games to run on FreeBSD, though I personally have its derivative, PC-BSD, installed on my desktop.

Now, I understand that the Linux compatibility layer on both operating systems only support 32-bit Linux binaries at the moment. Knowing this, I downloaded and attempted to install both Hotline Miami and Kentucky Route Zero onto my system. (I thought the binary for Kentucky Route Zero was 32-bit, but I see now that its store page actually makes no mention of it.) The installation of both games failed, even after making their respective .sh files executable with the chmod command in xterm. Below is the output from executing the .sh file for Hotline Miami.

~/Downloads% ./gog_hotline_miami_2.0.0.3.sh
Verifying archive integrity... All good.
Uncompressing Hotline Miami (GOG.com) 100%
Collecting info for this system...
Warning: No binaries for "freebsd" found, trying to default to Linux...
Operating system: linux
CPU Arch: x86_64
trying mojosetup in bin/linux/x86_64
USING en_US
ELF binary type "0" not known.
./startmojo.sh: /tmp/selfgz21947/bin/linux/x86_64/mojosetup: Exec format error
Error: Couldn't run mojosetup

It looks like I'm getting two errors: (1) ELF binary type "0" not known and (2) "Couldn't run mojosetup". I'm not sure how to proceed from here. I even tried unzipping the .sh file to execute the start.sh file manually in the terminal. The output I received was "Command not found." This second method may not be the correct way to do things, but I'm a complete beginner at this.

Does anyone have an idea on how to get Linux games to work on FreeBSD/PC-BSD? Hopefully, this process will become much easier when FreeBSD 11.0 releases next year with its new Linux compatibility layer.
No posts in this topic were marked as the solution yet. If you can help, add your reply
avatar
NobleBrowncoat: It looks like I'm getting two errors: (1) ELF binary type "0" not known and (2) "Couldn't run mojosetup". I'm not sure how to proceed from here. I even tried unzipping the .sh file to execute the start.sh file manually in the terminal. The output I received was "Command not found." This second method may not be the correct way to do things, but I'm a complete beginner at this.

Does anyone have an idea on how to get Linux games to work on FreeBSD/PC-BSD? Hopefully, this process will become much easier when FreeBSD 11.0 releases next year with its new Linux compatibility layer.
Those start.sh scripts are actually bash scripts. Have you tried running bash ./start.sh after installing bash?
avatar
NobleBrowncoat: It looks like I'm getting two errors: (1) ELF binary type "0" not known and (2) "Couldn't run mojosetup". I'm not sure how to proceed from here.
Hmmm... I know the ELF format type is built into the kernel, or more specifically usually included, but some kernels might have it removed to save space or since it's considered an older unused format.

A note though, FreeBSD is not GNU/Linux, so you might just have to consider a different distro that's supported more for games.
You could check if linux.ko is loaded with "kldstat".
The command "brandelf -t Linux run" might also fix this issue (but I bet it'll complain that binary type 3 is not known when running the script).
Post edited December 27, 2015 by ThermioN
A couple other possible approaches:

1. If the game is a DOS game, find a way to extract it and then run the game under the FreeBSD version of DOSBox.

2. If the game has a Windows version, you could try running the Windows version in WINE, which is available for FreeBSD.
Thanks you, guys, for your replies so far!

classicgogger, I tried your suggestion and received the following ouput. Unfortunately, I'm not sure how to interpret the error.

~/Downloads/data/noarch% bash ./start.sh
Running Hotline Miami
support/gog_com.shlib: line 94: 33514 Segmentation fault ./"${bin_32}"

rtcvb32, thanks for your thoughts on the ELF issue. In regards to using a supported Linux distro, I have considered it, In fact, LMDE is my favorite Linux distro, and it would probably make my life a lot easier if I just used it instead, but I'm a BSD guy and would really like to get this working on FreeBSD/PC-BSD. Unfortunately for me, the current 10.2 release may not have a Linux compatibility layer that is updated enough to get my games to work. I may have to wait for the 11.0 release to get this working.

ThermioN, using kldstat, I can confirm that linux.ko is indeed loaded. As for using the brandelf command, I'm not quite sure what to use it on. Doing "brandelf -t Linux start.sh" gave me an output telling me that start.sh is not an ELF format. I went into the /data/noarch/game folder and found two executbales: 'Hotline' and 'hotline_launcher'. Attempting to execute 'hotline_launcher' gave me a segmentation fault.

dtgreene, thank you for your suggestions. Using Wine would probably be my best bet in getting Hotline Miami running on FreeBSD, which is too bad, really, especially in regards to future purchases. In order to show GOG there is demand for gaming on Linux, I would first have to download the Linux version so that developers receive my money for their Linux port and then, in order to actually play the game, I would have to download the Windows version and run it through Wine. Not exactly an ideal situation for me, but it's better than nothing, I suppose. Hopefully, things will get better in time.
avatar
NobleBrowncoat: Doing "brandelf -t Linux start.sh" gave me an output telling me that start.sh is not an ELF format. I went into the /data/noarch/game folder and found two executbales: 'Hotline' and 'hotline_launcher'. Attempting to execute 'hotline_launcher' gave me a segmentation fault.
It's actually "brandelf -t linux your_binary" (not the shell script), but if you do "brandelf your_binary" you should already see it being compatible (look for something like Linux(3) verify with "brandelf -l" (lowercase L))

That said, I played around with KentuckyRouteZero (don't own Hotline Miami) got up to the point where it can't find it's data folder, but it does "run".

Anyway, linux_base-c6, linux-c6-libGLU and linux-c6-dri needed. Not sure what to do about the "missing" folder (related to mono I guess).

EDIT:
avatar
NobleBrowncoat: ~/Downloads/data/noarch% bash ./start.sh
Running Hotline Miami
support/gog_com.shlib: line 94: 33514 Segmentation fault ./"${bin_32}"
Did you install either linux_base-c6 or linux_base-f10 and set linux_enable="yes" in /etc/rc.conf? (including reboot)
Post edited December 27, 2015 by classicgogger
avatar
NobleBrowncoat: Doing "brandelf -t Linux start.sh" gave me an output telling me that start.sh is not an ELF format. I went into the /data/noarch/game folder and found two executbales: 'Hotline' and 'hotline_launcher'. Attempting to execute 'hotline_launcher' gave me a segmentation fault.
avatar
classicgogger: It's actually "brandelf -t linux your_binary" (not the shell script), but if you do "brandelf your_binary" you should already see it being compatible (look for something like Linux(3) verify with "brandelf -l" (lowercase L))

That said, I played around with KentuckyRouteZero (don't own Hotline Miami) got up to the point where it can't find it's data folder, but it does "run".

Anyway, linux_base-c6, linux-c6-libGLU and linux-c6-dri needed. Not sure what to do about the "missing" folder (related to mono I guess).

EDIT:
avatar
NobleBrowncoat: ~/Downloads/data/noarch% bash ./start.sh
Running Hotline Miami
support/gog_com.shlib: line 94: 33514 Segmentation fault ./"${bin_32}"
avatar
classicgogger: Did you install either linux_base-c6 or linux_base-f10 and set linux_enable="yes" in /etc/rc.conf? (including reboot)
Thanks, classicgogger, for the clarification on the use of brandelf! I do have linux_base-c6 installed, but I don't have the linux_enable="YES" entry in my /etc/rc.conf file. The default is "NO" on my system when looking in /etc/defaults/rc.conf. Is it really required to have Linux compatibility enabled at boot time? I thought it would automatically be enabled when needed, such as when executing a Linux binary?
avatar
NobleBrowncoat: I do have linux_base-c6 installed, but I don't have the linux_enable="YES" entry in my /etc/rc.conf file. The default is "NO" on my system when looking in /etc/defaults/rc.conf. Is it really required to have Linux compatibility enabled at boot time?
I'm not a BSD user myself but according to the FreeBSD handbook enabling Linux compatibility through rc.conf seems to be mandatory. Have you checked the handbook to ensure your system is set up correctly for Linux compatibilty? https://www.freebsd.org/doc/handbook/linuxemu.html

I cannot say much concerning brandelf. But I definitely suggest using ldd to make sure you have all necessary binaries installed to run those games.

Hope this helps.
Post edited December 28, 2015 by CatShannon
avatar
NobleBrowncoat: Thanks, classicgogger, for the clarification on the use of brandelf! I do have linux_base-c6 installed, but I don't have the linux_enable="YES" entry in my /etc/rc.conf file. The default is "NO" on my system when looking in /etc/defaults/rc.conf. Is it really required to have Linux compatibility enabled at boot time? I thought it would automatically be enabled when needed, such as when executing a Linux binary?
linux_enable at boot time is not required, but if you don't enable it, you need to load it with "kldload linux" anyway. It would complain about an exec format error otherwise (at least FreeBSD 10.2 does it).

BTW, linux_base-f10 is newer than linux_base-c6, might help with your segmentation fault in Hotline Miami.
avatar
NobleBrowncoat: Thanks, classicgogger, for the clarification on the use of brandelf! I do have linux_base-c6 installed, but I don't have the linux_enable="YES" entry in my /etc/rc.conf file. The default is "NO" on my system when looking in /etc/defaults/rc.conf. Is it really required to have Linux compatibility enabled at boot time? I thought it would automatically be enabled when needed, such as when executing a Linux binary?
avatar
classicgogger: linux_enable at boot time is not required, but if you don't enable it, you need to load it with "kldload linux" anyway. It would complain about an exec format error otherwise (at least FreeBSD 10.2 does it).

BTW, linux_base-f10 is newer than linux_base-c6, might help with your segmentation fault in Hotline Miami.
Oddly, even though linux_enable="YES" isn't found in PC-BSD's rc.conf file, linux.ko is loaded on boot up, which is the result of entering the command "kldload lunux". I guess this makes sense since the Linux flash player that comes with the OS works in Firefox without having to do anything.

As for linux_base-f10 being newer than linux_base-c6, I thought it was the other way around?

Anyway, I think I'm going to hold off on this experiment for now. I'm sure the newer Linux compatibility layer will fix some, if not all, of these issues when it finally comes out. In the meantime, I can just use WINE. I have to say, though, even though I wasn't successful in getting a Linux game to work on my system, I learned a lot during the process, and I have everyone here who replied to my posts to thank for it. Although I don't participate in it as much as i should, we have a really nice community here.

Thanks, everyone!
avatar
NobleBrowncoat: As for linux_base-f10 being newer than linux_base-c6, I thought it was the other way around?
Yeah, you are right. I mixed that up with centos being - usually - slower, but since RHEL6.0 is based on Fedora 12 so is CentOS 6.0.
How about playing games on Red Star OS? ;D
Post edited December 29, 2015 by Klumpen0815
avatar
NobleBrowncoat: Does anyone have an idea on how to get Linux games to work on FreeBSD/PC-BSD? Hopefully, this process will become much easier when FreeBSD 11.0 releases next year with its new Linux compatibility layer.
With linux-c6-* packages you can launch almost any x86 GNU/Linux application on FreeBSD.
Personally I was able to play GOG Hotline Miami (Linux) on FreeBSD 10.2 and 10.3.
But also I was able to launch GOG Hotline Miami 1 & Hotline Miami 2 via emulators/i386-wine.
Attachments:
hotline.png (431 Kb)
Post edited April 21, 2016 by ILUXA