Jump to content

How to Install Box86-Box64 Wine32-Wine64 Winetricks on Arm64


rna
 Share

Recommended Posts

Dear All,

I just want to share my workflow of successfully installing Box86-Box64, Wine32-Wine64 and Winetricks on Arm64

Big thanks to @NicoD for sharing his source code of Armbian-Gaming. I modified some of his code to be used in Armbian Focal (or any Arm64 distro) and fix the armhf dependencies issue by using the "arm-linux-gnueabihf" Library from TwisterOS. I also used some of Box86 Manual. So many thanks to all of them.

 

Ok Let's Start:

 

1. Add armhf multiarch

sudo dpkg --add-architecture armhf
sudo apt-get update

2. Install dependencies for box86 & box64

sudo apt-get install git cmake cabextract gcc-arm-linux-gnueabihf libc6-dev-armhf-cross


Then download these "arm-linux-gnueabihf" files and extract them on folder /usr/

(Alternatively, you can manually copy paste the "/usr/arm-linux-gnueabihf" folder from TwisterOS and transfer it to your arm64 OS. This file contains dependencies for Box86)

*NOTE: I split the files because Armbian site doesn't allow me to upload more than 1,5MB.

arm-linux-gnueabihf.7z.001 arm-linux-gnueabihf.7z.002 arm-linux-gnueabihf.7z.003 arm-linux-gnueabihf.7z.004

 

3. Compile box86 for general ARM64 board (read box86 manual for more info about your board)

cd
git clone https://github.com/ptitSeb/box86
cd box86
mkdir build
cd build
cmake .. -DARM_DYNAREC=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo
make -j3
sudo make install
sudo systemctl restart systemd-binfmt
cd

4. Compile box64 for general ARM64 board (read box64 manual for more info about your board)

cd
git clone https://github.com/ptitSeb/box64
cd box64
mkdir build
cd build 
cmake .. -DARM_DYNAREC=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo
make -j3
sudo make install
sudo systemctl restart systemd-binfmt
cd

5. Restart your Computer

6. Install Wine32 & Wine64 (Merged is the best option, and please follow the sequence accordingly. Currently at the time of writing, wine 5.21 & Wine 6.0.2 have the best support from Box86-Box64. You can also try a different version of wine if you want)

    #Wine 5.21

cd
cd ~/Downloads
wget https://dl.winehq.org/wine-builds/debian/dists/buster/main/binary-i386/wine-devel-i386_5.21~buster_i386.deb
wget https://dl.winehq.org/wine-builds/debian/dists/buster/main/binary-i386/wine-devel_5.21~buster_i386.deb
wget https://dl.winehq.org/wine-builds/debian/dists/buster/main/binary-amd64/wine-devel-amd64_5.21~buster_amd64.deb
wget https://dl.winehq.org/wine-builds/debian/dists/buster/main/binary-amd64/wine-devel_5.21~buster_amd64.deb
dpkg-deb -xv wine-devel-i386_5.21~buster_i386.deb wine-installer
dpkg-deb -xv wine-devel_5.21~buster_i386.deb wine-installer
dpkg-deb -xv wine-devel-amd64_5.21~buster_amd64.deb wine-installer
dpkg-deb -xv wine-devel_5.21~buster_amd64.deb wine-installer
mv ~/Downloads/wine-installer/opt/wine* ~/wine
rm -rf wine-installer
cd

    #Wine 6.0.2 Stable

cd
cd ~/Downloads
wget https://dl.winehq.org/wine-builds/debian/dists/buster/main/binary-i386/wine-stable-i386_6.0.2~buster-1_i386.deb
wget https://dl.winehq.org/wine-builds/debian/dists/buster/main/binary-i386/wine-stable_6.0.2~buster-1_i386.deb
wget https://dl.winehq.org/wine-builds/debian/dists/buster/main/binary-amd64/wine-stable-amd64_6.0.2~buster-1_amd64.deb
wget https://dl.winehq.org/wine-builds/debian/dists/buster/main/binary-amd64/wine-stable_6.0.2~buster-1_amd64.deb
dpkg-deb -xv wine-stable-i386_6.0.2~buster-1_i386.deb wine-installer
dpkg-deb -xv wine-stable_6.0.2~buster-1_i386.deb wine-installer
dpkg-deb -xv wine-stable-amd64_6.0.2~buster-1_amd64.deb wine-installer
dpkg-deb -xv wine-stable_6.0.2~buster-1_amd64.deb wine-installer
mv ~/Downloads/wine-installer/opt/wine* ~/wine
rm -rf wine-installer
cd

 

7. Create Symlink to Wine

sudo ln -s ~/wine/bin/wine /usr/local/bin/wine
sudo ln -s ~/wine/bin/wineboot /usr/local/bin/wineboot
sudo ln -s ~/wine/bin/winecfg /usr/local/bin/winecfg
sudo ln -s ~/wine/bin/wineserver /usr/local/bin/wineserver
sudo chmod +x /usr/local/bin/wine /usr/local/bin/wineboot /usr/local/bin/winecfg /usr/local/bin/wineserver

8. Setting Wine32 Folder in ~/.wine (set win32 as wine default, because currently winetricks doesn't work in win64. I would gladly use win64 as my default setup only if winetricks works in win64 in the future).

 

WINEPREFIX=~/.wine WINEARCH=win32 wine winecfg

9. Setting Wine64 Folder in ~/.wine64

WINEPREFIX=~/.wine64 WINEARCH=win64 wine winecfg

10. In Home Folder Create alias in .bashrc (to make shorter command for wine64)

cd
nano .bashrc

       --> enter this command

alias wine64="WINEPREFIX=~/.wine64 wine"

      --> then save (ctrl+x, choose yes)
      --> then logout & login

 

11. Installing & Running 32bit Windows app

wine uninstaller
wine /File/can/be/drag/and/drop/32bit.exe

12. Installing & Running 64bit Windows app

wine64 uninstaller
wine64 /File/can/be/drag/and/drop/64bit.exe

 

13. Install Winetricks

sudo apt-get install cabextract -y
cd ~/Downloads && wget https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks
sudo chmod +x winetricks && sudo mv winetricks /usr/local/bin/

14. Using Winetricks (ex: Corefonts & Dotnet 4)

BOX86_NOBANNER=1 winetricks
BOX86_NOBANNER=1 winetricks corefonts dotnet40

15. Creating Wine Desktop Launcher

Now create a launcher in the desktop with this code in the command section:

wine explorer /desktop=shell,1280x720 explorer.exe

 

As an alternative, I personally like explorer++ mainly because of its GUI and additional feature compared to the original wine explorer. You can download it from here: https://explorerplusplus.com/software/explorer++_1.3.5_x86.zip and then extract it, and then rename to "explorer++.exe" (with small e, not capital E), then copy-paste it to the ~/.wine/drive_c/windows. Then create a launcher in the desktop with this code in the command section:

wine explorer /desktop=shell,1280x720 explorer++.exe

 

 

 

**NOTE:

- With this setting I am able to run Box86 and Box64 without having dependencies conflict between armhf package and arm64 package.

- I used the win32 as my default wine. Alternatively you can also use win64 as your default ~/.wine setup. It is up to you (In fact, by default it will create win64 setup in your ~/.wine folder).

- For RK3399 users, you can use these scripts to Install and Update Box86 & Box64:

install_box86.sh install_box64.sh update_box86.sh update_box64.sh

 

I hope this could help somebody out there. Have a Nice Day!
RNA

 

 

Link to comment
Share on other sites

Check forum guidelines to use maximum potential!

17 hours ago, rna said:

Have a Nice Day!

Nice job. I had a lot of problems getting it to work on Hirsute. So I never looked into it to make it work on other releases.
If you'd be willing to adjust the armbian-gaming script to do this, I'll accept any commit. https://github.com/NicoD-SBC/armbian-gaming
I also was planning to add installation of PPSSPP. But never came to it. If you want to do that...
I'm working on a new review video. So I ain't got time for that.

Link to comment
Share on other sites

3 hours ago, NicoD said:

I had a lot of problems getting it to work on Hirsute.

Yes, after running your script manually in Armbian Focal. I have a lot of dependencies conflict especially from armhf package vs. arm64 package. As a result almost all my 64bit program that has dependencies conflicts were removed from the system.

 

After a while, I looked at how TwisterOS do this beautifully without any dependencies conflict. When building Box86 in TwisterOS, I just realized that TwisterOS only need this "arm-linux-gnueabihf" library files. Then I copied this library and pasted them to my Armbian Focal in /usr/ folder.

 

After that I fixed all dependencies conflict by using "sudo aptitude install" and remove all armhf package that has conflict.

 

Magically, all the conflicts were gone and as what I suspected that Box86 could compile successfully even without armhf package dependencies.

 

Now I am very happy because I can run both Box86 and Box64 without interfering each other. even wine32, wine64 and winetricks are working.


I'll say that this Library Method is better than the Schroot Method. But I am not sure for some distributions that do not support Multiarch like Manjaro, whether this Library Method is working or not. If it isn't then they have to stick with the Schroot Method.
 

3 hours ago, NicoD said:

If you'd be willing to adjust the armbian-gaming script to do this,

I am not good at github and scripting. I trust you, maybe you can try first. If it works, then you can update the armbian-config on Github with the command that I wrote.

Many Thanks @NicoD

Link to comment
Share on other sites

10 hours ago, NicoD said:

I also was planning to add installation of PPSSPP. But never came to it

Why don't you use flatpak?

I used it in my RK3399 board and it runs great. I got the latest release of PPSSPP on Armbian Focal.

But because the lack of OpenGL ES 3.2 and Vulkan Driver, a demanding game like God of War Chain of Olympus only get around 16-18 fps (2x res, autoframeskip).

For a middle game title it runs almost full speed. Like DragonBall Z Shin Budokai 60 fps, Daxter 30 fps with the same setting (2x res, autoframeskip)

sudo apt install flatpak
flatpak search ppsspp
flatpak install org.ppsspp.PPSSPP

I also got Dolphin & Flycast Emulator with quite great performance from flatpak. But maybe dolphin need the driver for OpenGL ES 3.2 or Vulkan to get a higher framerate. Currently the only two-emulator that don't work from apt package or Flatpak are N64 Emulator and RetroArch (Installing core is disabled).

Link to comment
Share on other sites

I was having an error when trying to compile box86 on arm64 (marm not recognized).  I found on github a good solution https://github.com/fengxue-jrql/box86-and-box64-for-arm64/ . Basically it is the same as shown here, but the box86 is compiled on armhf and then copied to arm64. You can download box86 from the link. For wine I used regular tutorial from box86 site and had no issues. Just wanted to post a reference here in case somebody else has similar problems.

 

Link to comment
Share on other sites

On 3/4/2022 at 4:02 PM, daniel2 said:

I was having an error when trying to compile box86 on arm64 (marm not recognized).  I found on github a good solution https://github.com/fengxue-jrql/box86-and-box64-for-arm64/ . Basically it is the same as shown here, but the box86 is compiled on armhf and then copied to arm64. You can download box86 from the link. For wine I used regular tutorial from box86 site and had no issues. Just wanted to post a reference here in case somebody else has similar problems.

 

You almost saved my life hahaha Now I have box86 and box64 runnning OK thanks to you, but I can't manage to run steamcmd (っ˘̩╭╮˘̩)っ

 

I got

 

Box86 with Dynarec v0.2.5 28b05465 built on Jan 16 2022 18:04:17
Error: reading elf header of /root/steamcmd/steamcmd.sh, try to launch natively instead
Segmentation fault (core dumped)

 

Do you guys know what is this error?

Also, I have the same problem runining box86 with chroot (wich I had installed following the older rna guide). I thought that it was because of the lack of box64 in the envirioment, but aparently it's not.

Link to comment
Share on other sites

On 3/7/2022 at 7:47 PM, otomai said:

 

 

Box86 with Dynarec v0.2.5 28b05465 built on Jan 16 2022 18:04:17
Error: reading elf header of /root/steamcmd/steamcmd.sh, try to launch natively instead
Segmentation fault (core dumped)

 

Do you guys know what is this error?

Also, I have the same problem runining box86 with chroot (wich I had installed following the older rna guide). I thought that it was because of the lack of box64 in the envirioment, but aparently it's not.

 

I would suggest to ask on discord Pi Labs, they have a subforum there - box86-steam-unstable

Link to comment
Share on other sites

A little update of my previous post about box86 install. I found on ptitSeb github project a reference for apt install of precompiled box86 builds. With that everything should be easier.

So I'm posting here steps taken from https://github.com/ptitSeb/box86/blob/master/docs/COMPILE.md and https://github.com/fengxue-jrql/box86-and-box64-for-arm64. All credits to them, I just combined the two.

 

# dependency install

sudo dpkg --add-architecture armhf
sudo apt update
sudo apt install zenity:armhf libasound*:armhf libstdc++6:armhf mesa*:armhf

 

# apt install

sudo wget https://itai-nelken.github.io/weekly-box86-debs/debian/box86.list -O /etc/apt/sources.list.d/box86.list
wget -qO- https://itai-nelken.github.io/weekly-box86-debs/debian/KEY.gpg | sudo apt-key add -
sudo apt update && sudo apt install box86 -y

 

# additional steps in chroot

edit with text editor /etc/profile and put at the end this:

export BOX86_PATH=~/wine/bin/
export BOX86_LD_LIBRARY_PATH=~/wine/lib/wine/i386-unix/:/lib/i386-linux-gnu:/lib/aarch64-linux-gnu/

(Last part for box64:sudo apt install mesa* zenity*)
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/

 

# a note about mesa*:armhf install on arm64.

I read on ptitSeb github that installing it on arm64 without chroot can break GPU acceleration. Just a warning, I had so far no issues.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...