1

After following the tutorial at https://www.novaspirit.com/2019/04/15/run-x86-arm/ with a few modifications (I used /x86/ as the chroot directory and installed wine via apt-get), attempting to run winecfg just returns "Bus Error"

This is being run on a Raspberry Pi 4. The error is so non-descriptive that I've not been able to get anywhere with my troubleshooting attempts.

Here's a complete list of every command I ran to install this:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get update && sudo apt-get install qemu qemu-user qemu-user-static binfmt-support debootstrap binutils
sudo mkdir /x86/
sudo debootstrap --foreign --arch i386 stretch /x86 http://ftp.us.debian.org/debian
sudo mount -t sysfs sys /x86/sys/
sudo mount -t proc proc /x86/proc/
sudo mount --bind /dev /x86/dev/
sudo mount --bind /dev/pts /x86/dev/pts/
sudo mount --bind /dev/shm /x86/dev/shm/
sudo cp /usr/bin/qemu-i386-static /x86/usr/bin/
sudo chroot /x86/ /debootstrap/debootstrap --second-stage
sudo chroot /x86/ /bin/su -l root
echo "export LANGUAGE='C'" >> .bashrc
echo "export LC_ALL='C'" >> .bashrc
echo "export DISPLAY=:0" >> .bashrc
source ~/.bashrc
apt update
adduser -uid 1000 pi
apt install leafpad
exit
sudo chroot /x86/ /bin/su -l pi
echo "export LANGUAGE='C'" >> .bashrc
echo "export LC_ALL='C'" >> .bashrc
echo "export DISPLAY=:01" >> .bashrc
source ~/.bashrc
exit
sudo chroot /x86/ /bin/su -l root
apt install wine
exit
sudo chroot /x86/ /bin/su -l pi
winecfg

When I try to run winecfg or run things with wine, I just receive the error Bus Error

Trenton McKinney
  • 56,955
  • 33
  • 144
  • 158
hexahedron
  • 11
  • 1
  • 2
  • 1
    I'd assume that qemu isn't emulating all the details of a real x86 system the way WINE is expecting. It looks like you're using qemu-user; have you googled to see if WINE on qemu-user is supported, or already known to not work? According to https://wiki.winehq.org/Emulation, maybe. If you want to debug WINE and/or qemu, try using `strace` to find out what system calls `winecfg` is making when it raises SIGBUS, or what it just made if that happens because of a (guest) user-space operation. – Peter Cordes Aug 27 '19 at 05:27

1 Answers1

1

The qemu binaries from the Raspbian Buster repositories stem from an older source version with an unfortunate set of bugs.

One workaround is to modify your procedure to use qemu-x86_64-static and wine64 with an x86_64 chroot[1].

Alternatively, you can build a newer version of qemu-i386-user from source. If you have a Debian Buster x86_64 system, the cross-compilation instructions are as follows:

git clone git://git.qemu-project.org/qemu.git
cd qemu
sudo dpkg --add-architecture armhf
sudo apt-get update
sudo apt-get install -y g++-arm-linux-gnueabihf flex bison libglib2.0-dev:armhf
./configure --cross-prefix=arm-linux-gnueabihf- --prefix=$(pwd)/usr --static --target-list="i386-linux-user x86_64-linux-user " --enable-linux-user --disable-system
make && make install
cd usr/bin
for f in *; do mv $f $f-static; done

The referenced thread also contains a link to such a build for testing.

[1] https://www.raspberrypi.org/forums/viewtopic.php?f=41&t=226376&start=72

jdonald
  • 670
  • 7
  • 15
  • Also `apt install ninja-build` to compile more recent versions of QEMU. Most newer Raspberry Pi models have enough memory to compile it themselves (no longer need cross-compile); the binary provided by this method replaces the one in the `qemu-user-static` package, and the pi may need rebooting after the update (remembering to remount `proc` etc for the `chroot`). I am however now getting a `page_set_flags` assert fail (and illegal instruction) when I try to run `wine notepad`, so I wonder if we need a known good commit of the `qemu` repository (commit `8011837a` matches the answer date) – Silas S. Brown Jan 02 '22 at 15:43
  • Unfortunately I am still getting the `assert` issue even on commit `8011837a` – Silas S. Brown Jan 02 '22 at 16:00