CrossOver Support - Community Forums

Important Information These are community forums and not official technical support. If you need official support: Contact Us

CrossOver Mac
Discussion about CrossOver Mac

The following comments are owned by whoever posted them. We are not responsible for them in any way.

Back to Threads Reply to Thread

Running crossover with Root elevation.
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.
Thank you for this well elaborated post. It is unfortunate that you didn't manage to run wine with elevation.

Edit: My issue was not directly related, I managed to screw networking somehow with force quitting CrossOver 19.0.1 while I had an open bottle.

your command should probably be:
sudo chown root:wheel <binary>     # the wheel (with h) group on BSD and derived UNIXes traditionally had su permission, sudo can be configured per user ("sudoers") and is usually granted to members of the admin group.
sudo chmod u+s <binary>     # adds the set-user-ID-on-execution and set-group-ID-on-execution bits on <binary> for the user (now root).
sudo chmod a+s <binary>     # does the same for all users (user, group and others), making the previous command irrelevant.
The result is, that any user can execute <binary>, and it will run as if it were executed by user root (the equivalent of which could be called elevation on windows).
Which of course is more than just a slight security concern.

Please Note: This Forum is for non-application specific questions relating to installation/configuration of CrossOver. All application-specific posts to this Forum will be moved to their appropriate Compatibility Center Forum.

CrossOver Forums: the place to discuss running Windows applications on Mac and Linux

CodeWeavers or its third-party tools process personal data (e.g. browsing data or IP addresses) and use cookies or other identifiers, which are necessary for its functioning and required to achieve the purposes illustrated in our Privacy Policy. You accept the use of cookies or other identifiers by clicking the Acknowledge button.
Please Wait...
eyJjb3VudHJ5IjoiVVMiLCJsYW5nIjpudWxsLCJjYXJ0IjowLCJ0enMiOi01LCJjZG4iOiJodHRwczpcL1wvbWVkaWEuY29kZXdlYXZlcnMuY29tXC9wdWJcL2Nyb3Nzb3Zlclwvd2Vic2l0ZSIsImNkbnRzIjoxNjMxNzI3MzA0LCJjc3JmX3Rva2VuIjoiUTk1YnpOYlBidHY0WUN0MiIsImdkcHIiOjB9