This is guide describes the way to run Win32 executable files on ARM host (e.g. tablet) with Ubuntu 18.04 (16.04, 20.04 etc).
- Build static qemu-user-i386 on ARM host
- Type magic strings for Win32 executable file format in binfmts
- Create system root for x86 Ubuntu system with debootstrap
- Mount
/dev
and/sys
to x86 system root - Chroot to x86 root
- Install wine
- Launch Win32 executable with wine
Install required packages for Ubuntu on ARM host
apt-get install debootstrap binfmt-support pkg-config libglib2.0-dev libpixman-1-dev
Build QEMU from source
cd /tmp
wget https://download.qemu.org/qemu-2.12.0.tar.xz
tar xJf qemu-2.12.0.tar.xz
cd qemu-2.12.0
./configure --target-list=i386-linux-user --extra-cflags=-marm --static --disable-tools --disable-system
make
cp i386-linux-user/qemu-i386 /usr/bin/qemu-i386-static
Type magic strings for Win32 executable file format to binfmts
update-binfmts --install qemu-i386 /usr/bin/qemu-i386-static --magic '\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00' --mask '\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff'
update-binfmts --install qemu-i486 /usr/bin/qemu-i386-static --magic '\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x06\x00' --mask '\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff'
Create file system root for x86 Ubuntu system in /usr/i386-root
mkdir /usr/i386-root
debootstrap --foreign --arch i386 jessie /usr/i386-root http://ftp.us.debian.org/debian
cp /usr/bin/qemu-i386-static /usr/i386-root/usr/bin
chroot /usr/i386-root /debootstrap/debootstrap --second-stage
echo 'deb http://ftp.us.debian.org/debian jessie main contrib non-free' >> /usr/i386-root/etc/apt/sources.list
echo 'deb http://ftp.us.debian.org/debian jessie-updates main contrib non-free' >> /usr/i386-root/etc/apt/sources.list
echo 'deb http://ftp.us.debian.org/debian jessie-backports main contrib' >> /usr/i386-root/etc/apt/sources.list
echo 'deb http://security.debian.org/ jessie/updates main contrib non-free' >> /usr/i386-root/etc/apt/sources.list
echo 'deb-src http://ftp.us.debian.org/debian jessie main contrib non-free' >> /usr/i386-root/etc/apt/sources.list
Mount /dev
and /sys
subfolders to x86 root
mount -t proc proc /usr/i386-root/proc
mount --rbind /sys /usr/i386-root/sys
mount --bind /dev /usr/i386-root/dev
mount --bind /dev/pts /usr/i386-root/dev/pts
Chroot to x86 filesystem
chroot /usr/i386-root /bin/bash
arch # Must type "i686"
passwd # Set password for x86 system
export LC_ALL=C
Install Wine
apt-get update
apt-get install locales
# Later if not configured automatically: dpkg-reconfigure locales
# Select en_US.UTF-8 (default) and other required locales (e.g. de_DE.UTF-8, etc)
apt-get install wine
# Must type version of Wine
wine --version
mv /usr/lib/i386-linux-gnu/wine/bin/wine32-preloader /usr/lib/i386-linux-gnu/wine/bin/wine32-preloader.renamed
mv /usr/lib/i386-linux-gnu/wine/bin/wine-preloader /usr/lib/i386-linux-gnu/wine/bin/wine-preloader.renamed
adduser wine --home /home/wine
chown -R wine:wine /home/wine
su wine
# Setup Wine properties if needed
wine winecfg
exit
mount -t proc proc /usr/i386-root/proc
mount --rbind /sys /usr/i386-root/sys
mount --bind /dev /usr/i386-root/dev
mount --bind /dev/pts /usr/i386-root/dev/pts
chroot /usr/i386-root /bin/bash
su wine -c "LANG=de_DE.UTF-8 'wine /path/to/app.exe'"
- https://habr.com/en/post/484484
- Arch Wiki – PCI passthrough via OVMF: https://wiki.archlinux.org/index.php/PCI_passthrough_via_OVMF
- binfmts