Woa windows on android linux aarch64 wine i386 для 64 битных android устройств

WoA 1.0 (Windows On Android) — установщик Debian и Wine x86 на Android

Здравствуйте, уважаемые читатели! Я недавно выкладывал здесь Wine x86 для Android в виде обычного приложения. Однако оно работало без Root-прав, и хотя это и хорошо для большинства пользователей, из-за этого там было много багов и недочетов. Эта статья рассказывает о новом Wine x86, работающем уже с Root и кастомным Recovery, однако отличающимся большей надежностью и возможностями, хотя и более высокими системными требованиями. Также теперь он выделен в мой отдельный проект — WoA.

WoA 1.0 устанавливает Linux и Wine x86 (с эмуляцией, разумеется) и позволяет пользоваться сразу несколькими их плюсами, которых нет в Android:

  • Использовать десктопный вариант Debian (пусть и ARM64)
  • Использовать его полноценные GNU утилиты
  • Использовать gcc/make для разработки и/или тестирования программ
  • Использовать десктопный браузер Chromium чтобы смотреть сайты, которые не хотят работать в мобильном браузере
  • Использовать встроеннный Wine x86 для запуска большинства 32-битных Windows-приложений производительностью примерно 20-40% от производительности вашего устройства. Всякие Bochs, ExaGear, Limbo и т. п. не дадут вам такого результата

Все великие возможности Debian я, к сожалению, описать здесь не смогу, поэтому остановлюсь на последнем пункте. Wine x86 на наших ARM-устройствах (а ведь почти все современные Android-устройства имеют именно эту архитектуру) представляет собой ничто иное как userspace-эмулятор qemu-user-static, связанный с контейнером proot/chroot и rootfs-образом минимального debian x86. Не буду вдаваться в подробности, перейдем к установке. Итак, что нужно от вашего девайса:

  • Android 5.1+
  • Root-права и кастомное Recovery (TWRP/CWM/Philz)
  • 2 ГБ RAM и более (если кто не знает, RAM — это оперативная память)
  • 9 ГБ свободного места во внутренней памяти
  • Разрешение экрана HD и выше (!)
  • Архитектура arm64/armv8l (узнаем через CPU-Z)

Что ж, требования для кого-то покажутся высокими. Но уменьшить их, увы, никак нельзя. Устанавливается WoA так же легко, как и любая прошивка через кастомное рекавери. Если вы не знаете, как это делается, погуглите или почитайте. После установки Debian добавится в автозапуск, и все что вам останется сделать — это подключиться по VNC к нему с адресом 127.0.0.1:5900 и паролем android (исправил). Для запуска любого Windows-приложения просто дважды тапните по exe-файлу и файлового менеджера Thunar. Ваша внутренняя память — /storage/emulated/0 или /sdcard — здесь это /data/media/0 (в Debian) или Z:\data\media\0 (при использовании Windows-программ). Для подключения по VNC рекомендую использовать VNC Viewer.

Внимание: это тестовая альфа-версия. О недочетах и неработоспособности на некоторых устройствах сообщайте в комментарии с указанием модели устройства.

Решение проблем

Если не запускается (VNC при подключении говорит «прослушиваемый порт неактивен», connection refused или нечто подобное): скачиваем Terminal Emulator for Android из Google Play Market, открываем и вводим туда:

linux # при всплывании окошка с запросом Root жмем Разрешить, ждем 7-10 секунд и переподключаемся по VNC, и так после каждой перезагрузки, когда вам понадобится Debian или Wine x86

Run Windows software on Android

Wine HQ has been going around for quite a few years, a program that allows users of operating systems such as Linux or Solaris to run Windows software on their machines. Since Android is based on the Linux kernel, nobody should be surprised that there’s also a version for this mobile operating system.

Run old Windows software on your Android

It comes along with functions similar to the PC version. In other words, we can run Windows applications on our smartphone or tablet. However, only Win16 and Win32 programs… but that’s better than nothing.

We’ll be faced with a user interface similar to the versions of Windows older than XP, such as Windows 95 and Windows 98, and we’re going to need physical input devices such as a mouse and a keyboard. A good option could be to resort to a virtual keyboard app.

Thus, if you really want to, you can now run software designed for Microsoft’s operating system on your Android phone.

Requirements and additional information:

  • Minimum operating system requirements:
    Android 2.3.
  • The installation of the app by means of the APK file requires the activation of the «Unknown sources» option within Settings>Applications.

Elies Guzmán

With a degree in History, and later, in Documentation, I have over a decade of experience testing and writing about apps: reviews, guides, articles, news, tricks, and more. They have been countless, especially on Android, an operating system…

We have been experimenting to run Windows on Arm binaries from a Linux-x64 machine using qemu-user and wine-arm64.

How it works

  1. QEMU can run aarch64 binaries on x64 host: qemu-aarch64 ./program

  2. Wine-arm64 is set of native aarch64 binaries that implements Windows interface, and can run windows-arm64 programs as simply as: wine ./program.exe

By combining both, we can run windows-arm64 binaries on a linux x64 machine:

qemu-aarch64 /path/to/wine-arm64/wine ./program.exe

QEMU

QEMU is an open source machine emulator and virtualizer.

QEMU provides one binary per architecture, and comes in two variants under Linux: system and user modes.

System mode (qemu-system-aarch64) emulates a whole “virtual machine”, which can be accelerated with virtualization by using KVM.

User mode provides emulation for a single program (and not a whole machine). In this case, QEMU intercepts system calls, which is the interface between user space and kernel space. It translates those calls from host architecture to guest architecture, talking directly to the Linux kernel. This is why user mode works only on Linux, and not on other OS.

Debian provides qemu-user-static which contains:

  • qemu-user binaries statically compiled

  • binfmt support binfmt_misc: In short, when you try to execute an elf-aarch64 binary, it calls automatically qemu-user-aarch64 to run it.

Wine

WineHQ — Run Windows applications on Linux, BSD, Solaris and macOS stands for “Wine is not an emulator”. Wine (software)

It is an implementation of Windows API interface, and a Portable Executable loader to run windows programs. It can run unmodified windows binaries.

Arm64 has been supported since Windows on Arm was released: https://wiki.winehq.org/ARM64

Documentation for this platform can be out of date, or lacking, so be careful.

Setup

Instructions are given for Debian:

  • Install docker: Debian

  • Add your user to docker group: sudo usermod -aG docker $USER

  • Logout your session and reconnect (so your user groups are changed)

Check docker can execute a container by running:

$ docker run -it --rm debian:bullseye bash -c 'echo Hello World'
Hello World

wine-arm64 Docker image

We created a docker x64 container image with wine-arm64 prebuilt and embedded qemu-user-static (so binfmt support is not required). It can easily be used with any CI system interfacing with containers: GitLab, GitHub, etc.

Image is published as linaro/wine-arm64

$ docker run -it --rm linaro/wine-arm64 wine-arm64 cmd.exe /c 'echo Hello World'
Hello World

Details can be found here: Unified docker image

GitLab and GitHub pipelines examples can be found here: linaro / WindowsOnArm / woa-linux-examples · GitLab

Limitations

For now, it’s not yet possible to run arm64 version of cl.exe using wine-arm64, so it’s better to cross compile from windows-x64/Linux (using cl, clang, or llvm-mingw).

We target to run unit tests and programs, instead of full native compilation process for now.

Warning: Wine can have bugs. Either on the Windows interface, or specific arm64 bugs. In case you encounter a crash, don’t assume your program is necessarily faulty, and if you can, investigate on a Windows on Arm machine.

Experiments

We created a repository to collect binaries than can be use to evaluate wine correctness and qemu/wine performance: linaro / WindowsOnArm / woa-linux-test-binaries · GitLab

OSQuery

Unittests from OSQuery. Some failures (9 tests on 70) found:

  • filesystem issues:

    • Files · master · linaro / WindowsOnArm / woa-linux-test-binaries · GitLab

    • Files · master · linaro / WindowsOnArm / woa-linux-test-binaries · GitLab

  • extension socket not implemented: Files · master · linaro / WindowsOnArm / woa-linux-test-binaries · GitLab

  • “various” windows issues: Files · master · linaro / WindowsOnArm / woa-linux-test-binaries · GitLab

  • issue with registry: Files · master · linaro / WindowsOnArm / woa-linux-test-binaries · GitLab

  • issue with CoCreateInstance
    https://gitlab.com/Linaro/windowsonarm/woa-linux-test-binaries/-/blob/master/fails/osquery/osquery/utils/conversions/osquery_utils_conversions_conversionstests-test.exe

  • issue with pid:
    https://gitlab.com/Linaro/windowsonarm/woa-linux-test-binaries/-/blob/master/fails/osquery/osquery/utils/pidfile/osquery_utils_pidfile_tests-test.exe

OSQuery is using advanced for API on Windows, so it’s not a total surprise to find those issues.

Numpy-benchmarks

Running benchmarks from numpy https://github.com/numpy/numpy/tree/main/benchmarks/benchmarks .

Installing numpy with pip does not work under wine-arm64, as cl.exe is not available to compile native code.

All benchmarks work under wine-arm64

Performance:

  • volterra: windows-arm64: 0.175s

  • volterra: linux-arm64-vm + wine: 0.850s

  • intel i7-10700k: linux-x64 + qemu-user + wine: 1.4s

  • intel i7-10700k: linux-x64 + qemu-system + windows-arm64: 2.9-3.5s (variations)

Most of the tests are short, and bound by python startup.

Running full windows-arm64 vm is unresponsive (background services can randomly make the cpu busy) and slower than running qemu-user + wine. In more, booting the VM itself takes 4 minutes.

🇹🇼 中文版

We can run Windows programs (.exe) with Box86 and Wine in Termux proot on Android. No root required.

Wine is a translation layer for running x86/x64 Windows programs on Linux. However, most of Android devices run on ARM architecture so Wine will not work in ARM platform.

Fortunately, a new program named Box86 can transalte x86 instructions into ARM instructions. And there is Box64 for transalting x64 instrcutions.

Therefore, you can run x86 appplications on ARM devices! And Box86 is faster than QEMU emualtion.

By combining Box86 and Wine, now we could run Windows programs in Termux proot.

1. Install Termux Proot#

Install proot Debian and setup Termux X11.

2. Install Box86 & Box64#

  1. Log into proot Debian as normal user.
proot-distro login debian --user user shared-tmp
  1. Enable armhf support
dpkg --add-architecture armhf
  1. Add ryanfortner’s repo and install Box86
sudo apt install gpg

sudo wget https://ryanfortner.github.io/box86-debs/box86.list -O /etc/apt/sources.list.d/box86.list

wget -qO- https://ryanfortner.github.io/box86-debs/KEY.gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/box86-debs-archive-keyring.gpg

sudo apt update

sudo apt install box86-android
  1. Add ryanfortner’s repo and install Box64
sudo wget https://ryanfortner.github.io/box64-debs/box64.list -O /etc/apt/sources.list.d/box64.list

wget -qO- https://ryanfortner.github.io/box64-debs/KEY.gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg

sudo apt update

sudo apt install box64-android

3. Install Wine and Wine64#

Wine is for running x86 (32bit) programs;whereas Wine64 is for x64 programs.

Since we are on ARM64 platform, we cannot install pacakges (i386:wine) from foreign architecture while using APT. Here we will install Wine by downloading binaries and moving them to the proper path.

  1. Install Wine’s dependencies
sudo apt install nano cabextract libfreetype6 libfreetype6:armhf libfontconfig libfontconfig:armhf libxext6 libxext6:armhf libxinerama-dev libxinerama-dev:armhf libxxf86vm1 libxxf86vm1:armhf libxrender1 libxrender1:armhf libxcomposite1 libxcomposite1:armhf libxrandr2 libxrandr2:armhf libxi6 libxi6:armhf libxcursor1 libxcursor1:armhf libvulkan -dev libvulkan-dev:armhf zenity
  1. Download Wine and Wine64 from Kron4ek’s Wine-Builds. The latest version is Wine 9.7.

cd ~/

wget https://github.com/Kron4ek/Wine-Builds/releases/download/9.7/wine-9.7-amd64.tar.xz

wget https://github.com/Kron4ek/Wine-Builds/releases/download/9.7/wine-9.7-x86.tar.xz
  1. Unzip the file and delete redundant files
tar xvf wine-9.7-amd64.tar.xz

tar xvf wine-9.7-x86.tar.xz

rm wine-9.7-amd64.tar.xz wine-9.7-x86.tar.xz

mv wine-9.7-amd64 wine64

mv wine-9.7-x86 wine
  1. Create a symbolic link and point /usr/local/bin/wine to $HOME/wine/bin/wine.
echo '#!/bin/bash
export WINEPREFIX=~/.wine32
box86 '"$HOME/wine/bin/wine "'"$@"' > /usr/local/bin/wine

chmod +x /usr/local/bin/wine

echo '#!/bin/bash
export WINEPREFIX=~/.wine64
box64 '"$HOME/wine64/bin/wine64 "'"$@"' > /usr/local/bin/wine64

chmod +x /usr/local/bin/wine64
  1. Add the PATH of Box86 and Box64 to ~/.bashrc
echo 'export DISPLAY=:0
export BOX86_PATH=~/wine/bin/
export BOX86_LD_LIBRARY_PATH=~/wine/lib/wine/i386-unix/:/lib/i386-linux-gnu/:/lib/aarch64-linux-gnu/:/lib/arm-linux-gnueabihf/:/usr/lib /aarch64-linux-gnu/:/usr/lib/arm-linux-gnueabihf/:/usr/lib/i386-linux-gnu/
export BOX64_PATH=~/wine64/bin/
export BOX64_LD_LIBRARY_PATH=~/wine64/lib/i386-unix/:~/wine64/lib/wine/x86_64-unix/:/lib/i386-linux-gnu/:/lib/x86_64-linux-gnu:/lib/aarch64 -linux-gnu/:/lib/arm-linux-gnueabihf/:/usr/lib/aarch64-linux-gnu/:/usr/lib/arm-linux-gnueabihf/:/usr/lib/i386-linux-gnu /:/usr/lib/x86_64-linux-gnu' >> ~/.bashrc

source ~/.bashrc
  1. Install Winetricks
cd ~/

wget https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks

chmod +x winetricks

mv winetricks /usr/local/bin/

echo '#!/bin/bash
export BOX86_NOBANNER=1 WINE=wine WINEPREFIX=~/.wine32 WINESERVER=~/wine/bin/wineserver
wine '"/usr/local/bin/winetricks "'"$@"' > /usr/local/bin/winetricks32

chmod +x /usr/local/bin/winetricks32

echo '#!/bin/bash
export BOX64_NOBANNER=1 WINE=wine64 WINEPREFIX=~/.wine64 WINESERVER=~/wine64/bin/wineserver
wine64 '"/usr/local/bin/winetricks "'"$@"' > /usr/local/bin/winetricks64

chmod +x /usr/local/bin/winetricks64
  1. Create a shortcut to the Wine file manager on the Linux desktop, so that you can directly click the exe to start:
cd ~/Desktop

echo '[Desktop Entry]
Name=Wine32 Explorer
Exec=bash -c "wine explorer"
icon=wine
Type=Application' > ~/Desktop/Wine32_Explorer.desktop

chmod +x ~/Desktop/Wine32_Explorer.desktop

cp ~/Desktop/Wine32_Explorer.desktop /usr/share/applications/

cd ~/Desktop

echo '[Desktop Entry]
Name=Wine64 Explorer
Exec=bash -c "wine64 explorer"
icon=wine
Type=Application' > ~/Desktop/Wine64_Explorer.desktop

chmod +x ~/Desktop/Wine64_Explorer.desktop

cp ~/Desktop/Wine64_Explorer.desktop /usr/share/applications/

4. Install DXVK#

DXVK is a Vulkan-based translation layer for Direct3D 9/10/11. This may improve performance of some Windows games.

  1. Install dependencies
sudo apt install mesa-vulkan-drivers mesa-vulkan-drivers:armhf libvulkan1 libvulkan1:armhf
  1. Download the latest version of DXVK from Github. The latest version is 2.3.1
wget https://github.com/doitsujin/dxvk/releases/download/v2.3.1/dxvk-2.3.1.tar.gz
  1. Unzip and move the dxvk files to the Wine directory
tar xvf dxvk-2.3.1.tar.gz

cddxvk-2.3.1
cp x32/* ~/.wine32/drive_c/windows/system32
cp x32/* ~/.wine64/drive_c/windows/system32
cp x64/* ~/.wine64/drive_c/windows/syswow64
  1. Open Wine settings, switch to the library tab, and overwrite the DLL files of d3d11, d3d10core, dxgi, and d3d9.
wine winecfg

wine64 winecfg

You could check the comapbility of specific programs on Wine Application Database and install the packages through winetricks.

Some programs may need GPU Acceleration to work.


Make sure to check your programs are 32bit or 64bit before running them.

For example, to run Notepad++ 32bit, open terminal at the directory where the exe is, and run:

Wait for few seconds, then the window of Notepad++ will pop out.

If the program is 64 bit, run with Box64 instead:

box64 wine64 notepad++.exe

You could use WINEPREFIX to create a separate directory (the fake “C drive” created by Wine) for running specific programs:

export WINEPREFIX=~/.wine64
export WINEARCH=win64
box64 wine64 notepad++.exe

References#

  • Wine User’s Guide — WineHQ Wiki
  • Box86 usage — Github
  • Wine32, Wine64, Box86 and Box64 installation on Android using Termux Ubuntu 22.04 proot / chroot — Github

Wine (x64)

Run x86 and x64 Windows apps with a box64-emulated version x86/x64 wine-9.17 (WOW64 mode enabled).
To run: wine path/to/file.exe
To configure wine: go to ‘Wine configuration’ in main menu or type in terminal: wine winecfg
Not all Windows applications will work under Wine. It’s a good idea to check online if your program can run, or if something can be tweaked to make it work.

Note: x86 32bit applications use the new Wine WOW64 mode. The WOW64 mode allows for running x86 Windows applications on x86_64 without any x86 Linux userspace.
Note: This mode is experimental in Wine and Box64 support for x86 code still need some work. However, many applications already work.

Note: the applications installed with wine will appear under the wine category in the main menu, and they will stay there even after uninstalling wine.

Need support with running a game or app with wine and box64? Ask it on the Pi Labs Discord: https://discord.gg/JKNQXprqUd

Box86/Box64 Game compatibility list: https://box86.org/app/

Fortunately, Wine (x64) is very easy to install on your Linux ARM Device in just two steps.

  1. Install Pi-Apps — the best app installer for Linux ARM Device.
  2. Use Pi-Apps to install Wine (x64).

Compatibility

For the best chance of this working, we recommend using the latest LTS of Ubuntu or Debian from your hardware manufacturer.
Wine (x64) will only run on an Ubuntu/Debian ARM64 OS. Pi-Apps will not let you install Wine (x64) on an Ubuntu/Debian ARM32 OS.

Install Pi-Apps

Pi-Apps is a free tool that makes it incredibly easy to install the most useful programs on your Linux ARM Device with just a few clicks.

Open a terminal and run this command to install Pi-Apps:

wget -qO- https://raw.githubusercontent.com/Botspot/pi-apps/master/install | bash

Feel free to check out the Pi-Apps source code here: https://github.com/Botspot/pi-apps

Pi-Apps is a free and open source tool made by Botspot, theofficialgman, and other contributors. Find out more at https://pi-apps.io

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Как активировать windows 7 home premium sp1
  • Куда сохраняются видео с экрана windows 10
  • Аналог терминала для windows
  • Как подключить air pods pro к windows 11
  • Chessmaster 9000 для windows 10