2

I need help getting ping to work under wine on Ubuntu 16.04. I am trying to run a Battlefield Bad Company 2 server for testing (I might be doing some development on a mod at some point) and I am unable to get it to a playable state. I can run mase_bc2 and Frost.Game.Main_Win32_Final.exe and even connect to the LAN server in game - but, when loading a map, it does not continue loading and instead the game freezes.

Here is the error that I need to solve to get the server playable: 0049:err:winediag:IcmpCreateFile Failed to use ICMP (network ping), this requires special permissions.

When I do wine cmd and then ping I simply get this: Z:\home\user> ping google.com 0075:fixme:ping:main this command currently just sleeps based on -n parameter

Here is what I have tried:

sudo chmod 4755 /bin/ping to allow wine to access ping. This did not help.

I then tried this: sudo setcap cap_net_raw+epi "$(readlink -f "/usr/bin/wine")"

which results in this error: wine: error while loading shared libraries: libwine.so.1: cannot open shared object file: No such file or directory

and then separately after running sudo setcap -r "$(readlink -f "/usr/bin/wine")" to remove the shared libraries error, I also ran this: sudo setcap 'cap_net_bind_service=+ep' "$(readlink -f "/usr/bin/wine-preloader")"

Both setcap commands result in the same shared libraries error.

I'm decent at Linux but it seems this is beyond my level and I need help with this. I have searched thread after thread online and I came up empty. If someone can solve this for me, this may be one of the only sources of fixing this issue (bug??) on the Internet.

I see there is someone else having this issue here: https://forum.winehq.org/viewtopic.php?f=8&t=30704 and he even gets the same error as me after using setcap however he did not get this issue solved.

UPDATE Sep 7 2018: creating a symlink at /usr/lib/libwine.so.1 removes the shared libraries error, but I am still unable to ping via wine.

UPDATE Sep 8 2018: This seems to be a known bug and is fixed in Wine Development 3.15: https://bugs.winehq.org/show_bug.cgi?id=43252

Thanks.

  • 1
    About the ping command not working in Wine — the this command currently just sleeps based on -n parameter basically says that ping command is not implemented, probably because nobody was needing it. Your problem with ICMP is about pinging through WinAPI, and being a distinct issue. The rest you already figured out. Since you found it's fixed in 3.15, you might want to post an answer about it. – Hi-Angel Sep 8 '18 at 18:51
2

The problem is Wine has a bug in it that is fixed in Wine versions 3.14 and beyond where a ReplySize under 56 prevents ping from working. However - ping still requires special permissions set with setcap in Wine versions 3.14 and beyond. Thankfully, there is also a workaround in Wine versions 3.14 and beyond where Wine will automatically use the native Linux ping if the special permissions are not set with setcap which essentially means in Wine versions 3.14 and beyond, wine ping will now work out of the box.

Source: https://bugs.winehq.org/show_bug.cgi?id=43252

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.