Error while loading shared libraries libwine so 1

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 un...

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:homeuser> 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.

Short answer – run this:

sudo sysctl -w vm.mmap_min_addr=0

Longer answer:

I ran into exactly the same error a day ago after upgrading from Ubuntu 16.04 to 18.04 (and re-installing wine-staging from WineHQ).

I was able to work out that it only happened when trying to run a 32-bit Windows executable via Wine (on a 64-bit system).

After way too much debugging, I got a clue from trying to run the Wine notepad.exe under strace:

$ strace /usr/bin/wine notepad.exe
execve("/usr/bin/wine", ["/usr/bin/wine", "notepad.exe"], 0x7ffc266e8478 /* 55 vars */) = 0
strace: [ Process PID=19507 runs in 32 bit mode. ]
brk(NULL)                               = 0x7c423000

[ … 140 lines snipped … ]

openat(AT_FDCWD, "/opt/wine-staging/lib/libwine.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "177ELF111331220d004"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=1832828, ...}) = 0
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 EPERM (Operation not permitted)
close(3)                                = 0
writev(2, [{iov_base="/opt/wine-staging/bin/wine", iov_len=26}, {iov_base=": ", iov_len=2}, {iov_base="error while loading shared libra"..., iov_len=36}, {iov_base=": ", iov_len=2}, {iov_base="libwine.so.1", iov_len=12}, {iov_base=": ", iov_len=2}, {iov_base="cannot create shared object desc"..., iov_len=38}, {iov_base=": ", iov_len=2}, {iov_base="Operation not permitted", iov_len=23}, {iov_base="n", iov_len=1}], 10/opt/wine-staging/bin/wine: error while loading shared libraries: libwine.so.1: cannot create shared object descriptor: Operation not permitted
) = 144
exit_group(127)                         = ?
+++ exited with 127 +++

The crucial bit is the mmap2 failure. After reading the mmap2 manpage (and then the mmap manpage), it seemed like it was just trying to map an anonymous block of 8192 bytes – not even linked to a file on disk. That seemed extremely boring and not the sort of thing that should fail.

So I thought I’d investigate the sysctl settings to see if there was anything that might’ve been changed in my Ubuntu 16.04 → 18.04 upgrade, in particular anything that might affect mmap2 or just mmap.

I found a likely candidate in /etc/sysctl.d/10-zeropage.conf:

# Protect the zero page of memory from userspace mmap to prevent kernel
# NULL-dereference attacks against potential future kernel security
# vulnerabilities.  (Added in kernel 2.6.23.)
#
# While this default is built into the Ubuntu kernel, there is no way to
# restore the kernel default if the value is changed during runtime; for
# example via package removal (e.g. wine, dosemu).  Therefore, this value
# is reset to the secure default each time the sysctl values are loaded.
vm.mmap_min_addr = 65536

The main reason this seemed a strong candidate is because it mentioned Wine.

After that, I found this page on the WineHQ Wiki: Preloader Page Zero Problem.

While that page doesn’t explicitly mention the error we encountered, it mentioned a lot of other things that sounded suspiciously related.

So I tried its recommendation for “the right workaround”, i.e., sudo sysctl -w vm.mmap_min_addr=0 – and suddenly I could run Windows 32-bit apps under Wine again! :-)

NOTE: The WineHQ Wiki page also gives instructions for making that change permanent, though there may be some system security implications if you do so.

Зачем из исходников? Потому что версия из репозитория старая и не даёт возможности играть в некоторые игры, например, в WoT ;)

Всё, ниже изложенное, сновано на:
http://wiki.winehq.org/WineOn64bit
http://www.tecmint.com/install-wine-in-rhel-centos-and-fedora

Дело происходит в 64-х разрядной  RERemix6.

Первым делом нужно удалить Wine, если он был до этого установлен, а так же стереть в домашней директории папку .wine (если там есть какая-либо нужная информация, то сохраните её в другом месте)!!!

Далее устанавливаем пакеты из группы «Development Tools»

su -c «yum groupinstall ‘Development Tools'»

Далее устанавливаем пакеты, необходимые для сборки 32-х разрядного Wine в 64-х разрядной системе:

su -c «yum install alsa-lib-devel.i686 libsndfile-devel.i686 readline-devel.i686 glib2.i686 glibc-devel.i686 libgcc.i686 libstdc++-devel.i686 pulseaudio-libs-devel.i686 cmake portaudio-devel.i686 openal-soft-devel.i686 audiofile-devel.i686 freeglut-devel.i686 lcms-devel.i686 libieee1284-devel.i686 openldap-devel.i686 unixODBC-devel.i686 sane-backends-devel.i686 fontforge libgphoto2-devel.i686 isdn4k-utils-devel.i686 mesa-libGL-devel.i686 mesa-libGLU-devel.i686 libXxf86dga-devel.i686 libXxf86vm-devel.i686 giflib-devel.i686 cups-devel.i686 gsm-devel.i686 libv4l-devel.i686 fontpackages-devel ImageMagick-devel.i686 openal-soft-devel.i686 libX11-devel.i686 docbook-utils-pdf libtextcat tex-cm-lgc freetype-devel.i686 freetype-devel.x86_64 freetype.i686 freetype bison-devel.i686 bison-devel.x86_64 bison»

Возможно, тут чего-то не хватает, об этом вы узнаете во время сборки и сможете доустановить.

Вот теперь можно скачать с офсайта исходники Wine http://www.winehq.org , я скачал версию 1.5.30
Распаковываем, например, в домашний каталог и видим там папку wine-1.5.30 , заходим туда и для порядка читаем файл README, там говориться, что для компиляции и установки необходимо выполнить следующую команду:

./tools/wineinstall

Программа скажет, что для установки понадобиться пароль root-а, отвечаем yes и наслаждаемся процессом, если у вас в системе чего-то не хватает, то сейчас вам об этом будет сообщение, например такое:

configure: error: no suitable bison found. Please install the ‘bison’ package.
Configure failed, aborting install.

Это значит, что не хватает пакета ‘bison’ и его нужно установить (а так же зголовочные файлы и версию для 32-х разрядной системы):

su -c «yum install bison-devel.i686 bison-devel.x86_64 bison»

Если всё, необходимое для компиляции есть в наличии, то через некоторое время у вас в системе будет свежий Wine.

Тут у меня возникли проблемы — при попытке выполнить winecfg выходила ошибка:

/usr/local/bin/wine: error while loading shared libraries: libwine.so.1: cannot open shared object file: No such file or directory

Не хватает библиотеки libwine.so.1 !!! Сам Wine установился, а библиотека нет. Почему и как я не разобрался, но проблему решил. Нужная библиотека (libwine.so.1.0) оказалась в одной из папока с исходниками wine-1.5.30/libs/wine, достаточно её скопировать в папку /usr/local/libs . Так же нужно скопировать лежащие рядом симлинки (@libwine.so и @libwine.so.1)

После этого Wine запустился нормально.

За подробностями по установке WoTа идём на его форум.
http://forum.worldoftanks.ru/index.php?/topic/253723-wot-%D0%BF%D0%BE%D0%B4-linux-2/

UPD
Знающие люди подсказали, что есть патч, решающий проблему с библиотекой.
http://pastebin.com/jtRAbuFT

Понравилась статья? Поделить с друзьями:
  • Error while loading shared libraries libwbclient so 0
  • Error while loading shared libraries libtinfo so 6
  • Error while loading shared libraries libtiff so 3
  • Error while loading shared libraries libstdc so 6
  • Error while loading shared libraries libssl so