You are not logged in.
I have wine installed at /usr/bin/wine and want to use it for windows games. On its own, "wine game.exe` works fine. But when I use bubblewrap it claims that wine is not installed. I assumed that the problem is that I was missing some mounts. I tried a bunch of things, I think this is the most comprehensive version:
bwrap \
--ro-bind /bin /bin \
--ro-bind /lib /lib \
--ro-bind /lib64 /lib64 \
--ro-bind /root /root \
--ro-bind /run /run \
--ro-bind /sys /sys \
--ro-bind /sbin /sbin \
--ro-bind /usr /usr \
--ro-bind /etc /etc \
--dir /tmp \
--dir /var \
--proc /proc \
--dev /dev \
bashWhich gives me a bubblewrapped prompt. If I then type "wine" I get "bash: /usr/bin/wine: No such file or directory". However if I do "ls /usr/bin/win*" I can see that wine is clearly there. Also "winecfg" gives "/usr/bin/winecfg: line 46: /usr/bin/wine: No such file or directory" - so even "winecfg" is clearly there, but they're refusing to see wine. I can even do "stat $(which wine)":
File: /usr/bin/wine
Size: 13784 Blocks: 32 IO Block: 4096 regular file
Device: 254,1 Inode: 1091775 Links: 1
Access: (0755/-rwxr-xr-x) Uid: (65534/ nobody) Gid: (65534/ nobody)
Access: 2021-10-17 18:54:25.122217585 -0700
Modify: 2021-08-27 13:48:01.000000000 -0700
Change: 2021-10-14 22:03:42.017742446 -0700
Birth: 2021-10-14 22:03:42.017742446 -0700So what's going on here?
Last edited by lfitzgerald (2021-10-21 01:17:12)
Offline
Well, let's see:
$ ldd /usr/bin/wine
linux-gate.so.1 (0xf7f6d000)
libpthread.so.0 => /usr/lib32/libpthread.so.0 (0xf7f0f000)
libdl.so.2 => /usr/lib32/libdl.so.2 (0xf7f09000)
libc.so.6 => /usr/lib32/libc.so.6 (0xf7d10000)
/lib/ld-linux.so.2 => /usr/lib/ld-linux.so.2 (0xf7f6f000)
$ readlink -m /lib/ld-linux.so.2
/lib32/ld-linux.so.2
$ ls /lib32/ld-linux.so.2
ls: cannot access '/lib32/ld-linux.so.2': No such file or directorySo that means you're missing /lib32, which you haven't mounted.
The error message is a bit misleading, it's the dynamic linker that's missing, not the wine executable.
Offline
The error message is a bit misleading, it's the dynamic linker that's missing, not the wine executable.
That would make a lot more sense. Thanks for the hint, I didn't know about ldd.
So that means you're missing /lib32, which you haven't mounted.
But /lib32 is missing on the main system as well, and wine runs happily outside the bubblewrap (bw.sh is a wrapper for the command I posted above):
$ wine --version
wine-6.17
$ ls / | grep lib
lib
lib64
$ bwrap \
--ro-bind /bin /bin \
--ro-bind /lib /lib \
--ro-bind /lib64 /lib64 \
--ro-bind /root /root \
--ro-bind /run /run \
--ro-bind /sys /sys \
--ro-bind /sbin /sbin \
--ro-bind /usr /usr \
--ro-bind /etc /etc \
--dir /tmp \
--dir /var \
--proc /proc \
--dev /dev \
bash
$ ls | grep lib
lib
lib64
$ wine --version
bash: /usr/bin/wine: No such file or directoryOffline
Maybe try to use symlinks for the directories in the root that are symlinks in arch
--symlink /usr/lib /lib
--symlink /usr/bin /bin
...| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |
Offline
Maybe try to use symlinks for the directories in the root that are symlinks in arch
Yes, using mountpoints isn't the same as symlinks.
In the "real" environment, /lib is a symlink to /usr/lib, which means /lib/../lib32/ld-linux.so.2 resolves to /usr/lib/../lib32/ld-linux.so.2, which is /usr/lib32/ld-linux.so.2
In the example /usr/lib is mounted to /lib (the fist argument to --mount is resolved!), so from there ../lib32 resolves to /lib32.
So yea, use symlinks where the host environment does.
Offline
Ah, the symlinks were indeed the problem! Specifically, instead of mounting /lib you have to symlink it. The /bin symlink seems to not be necessary for this case (although obviously there may be other problems cause by not symlinking /bin as well).
Here's a full MWE for the next person who googles this:
$ cat ./bwf.sh
#!/usr/bin/env sh
#
# MWE for https://bbs.archlinux.org/viewtopic.php?id=270540
bwrap \
--ro-bind /bin /bin \
--ro-bind /lib64 /lib64 \
--ro-bind /root /root \
--ro-bind /run /run \
--ro-bind /sys /sys \
--ro-bind /sbin /sbin \
--ro-bind /usr /usr \
--symlink /usr/lib /lib \
--ro-bind /etc /etc \
--dir /tmp \
--dir /var \
--proc /proc \
--dev /dev \
bash
$ ./bwf.sh
$ wine --version
wine-6.17I still have to confirm that all the other stuff like graphics and sound are working, but once I do I think I'll add the wine example to the wiki. For the purposes of this thread though I think the problem is solved.
Offline