So today I was having fun making things work on CrossOver, and ended up trying NeedForSpeed Underground 2, which runs great on it.
However, I decided to try playing a LAN game with a friend. To my surprise it did not work, and after some googling most people manage to fix it by running the game as an Administrator on windows, but I know there is no such thing on Crossover. So I decided to investigate this further.
I enabled LOGs on the game and tried opening a LAN game some times, then closed the game and went to check the logs.
After that I immediately discovered what the issue was. the Logs said
WSASocketW Failed to create a socket of type SOCK_RAW, this requires special permissions.
Meaning that the game is trying to open a RAW SOCKET, an operation that on most Operating systems Require administrative or root privileges.
So a solution to this problem would be running crossover itself as Root, or somehow giving its binaries permission to make such an operation.
However from what I've gathered running it as root is difficult since it has many binds with the $USER directory, and the bottles probably would not work.
And giving the proper permission to the binaries could be possible but I've not figured out how to do that.
On linux this appears to be a non issue, since you can just
sudo setcap cap_net_raw=ep /usr/bin/wineserver
getcap -v /usr/bin/wineserver
/usr/bin/wineserver = cap_net_raw+ep
But on macOS there is no such thing as the setcap
command.
So what I did was making a small test program in C that open a RAW Socket to do some tests. And indeed without running with sudo
, it errors "Operation not permited".
SO I googled a lot and figured out that If I run the following commands to the binary I would open the RAW SOCKET normally without asking for root access
sudo chown root:weel test.bin
sudo chmod u+s test.bin
sudo chmod a+s test.bin
I'm not sure if it is all needed and what these permission flags are, but they worked for the test binary I've just did. So I tried applying the same logic to the wineserver
, but that just make my app not open anymore, I restore it to default and then tried on the wine32on64-preloader and it also did not work, and also just broke my apps.
Anyway, long story short, I just want to share this experience here, since for me it is not a dealbreaker, but there might be some software out there that needs this permission too. And since I've found solutions on Linux and none for macOS, maybe we can figure out a way to make it work here, and have this information documented for future people.
Maybe I'm just changing the permission of the wrong binary files. I'll keep trying out different things and will update this thread if I find anything new.