x86-64 Chroot on manjaro arm

install x86 64 deb install wine windows apps

Testing wine in chroot environment takes time. And I don't have that luxury. So maybe somebody could help us to test it. I will post what I did so far. If you follow exactly what I did. You don't need to put yourself into trouble.

Important Note:

I have tested:

I will highlight that you should stick with Ubuntu Bionic x86_64 as it works best, and most winetricks works. But for some it doesn't. But it is better compared to the rest of what I tested.

OK Let's start:

PREPARATION:

Before we start, make sure that Binfmt_misc is compiled in your kernel. If it is not, then you cannot continue this procedure.

$ zcat /proc/config.gz | grep BINFMT_MISC

Make sure that you had installed the base-devel package, Thanks to @Lolix to point it out:

$ sudo pacman -Syyu base-devel --needed

Now Let's install the required package first:

$ yay -S qemu-user-static schroot debootstrap

Now let's install the configuration file for qemu, Thanks to @xabbu for the fix.

$ wget https://raw.githubusercontent.com/qemu/qemu/master/scripts/qemu-binfmt-conf.sh
$ sudo bash qemu-binfmt-conf.sh --systemd i386
$ sudo bash qemu-binfmt-conf.sh --systemd x86_64
$ ls /etc/binfmt.d/

Make sure that you got two files in the folder /etc/binfmt.d/

qemu-i386.conf
qemu-x86_64.conf

Now let's check the status:

$ /usr/lib/systemd/systemd-binfmt --cat-config --no-pager

Now let's edit the qemu-i386.conf because the config is not correct:

$ sudo nano /etc/binfmt.d/qemu-i386.conf

Now replace nearly at the end of the line :/usr/local/bin/qemu-i386: with :/usr/bin/qemu-i386-static: Then ctrl+x, yes and save

We have to edit the qemu-x86_64.conf as well:

$ sudo nano /etc/binfmt.d/qemu-x86_64.conf

Now replace nearly at the end of the line :/usr/local/bin/qemu-x86_64: with :/usr/bin/qemu-x86_64-static: Then ctrl+x, yes and save

Now let's restart and check our binfmt status:

$ systemctl restart systemd-binfmt
$ systemctl status systemd-binfmt --no-pager

INSTALLING UBUNTU BIONIC x86_64 (DEBOOTSTRAP)

If you follow step by step the procedure above, then you should be OK to run the following step. If not, go back to the Preparation procedure:

In this procedure we will debootstrap the ubuntu bionic x86_64 in the folder /srv/chroot/ubuntu-x64. If you deviate from this, then you are on your own. You will get trouble when installing winetricks, etc. As I mentioned earliar. At the moment I am writing this, ubuntu bionic x86_64 is the best option:

$ sudo mkdir /srv/chroot/ubuntu-x64
$ sudo debootstrap --arch amd64 --foreign bionic /srv/chroot/ubuntu-x64 http://archive.ubuntu.com/ubuntu/
$ sudo cp /usr/bin/qemu-i386-static /srv/chroot/ubuntu-x64/usr/bin
$ sudo cp /usr/bin/qemu-x86_64-static /srv/chroot/ubuntu-x64/usr/bin
$ sudo chroot "/srv/chroot/ubuntu-x64" /debootstrap/debootstrap --second-stage

If everything runs smoothly, then let's continue:

$ sudo nano /etc/schroot/chroot.d/ubuntu-x64.conf

Now add this following text, change username with your own user name:

[ubuntu-x64]
description=Ubuntu Bionic x86_64 chroot
aliases=ubuntu-x64
type=directory
directory=/srv/chroot/ubuntu-x64
profile=desktop
personality=linux
preserve-environment=true
root-users=<username>
users=<username>

Then ctrl+x, yes and save

Now lets fix the database issue:

$ sudo nano /etc/schroot/desktop/nssdatabases

then put # in font of networks, group, passwd and add #user. It should look like this:

# System databases to copy into the chroot from the host system.
#
# <database name>
#passwd
shadow
#group
gshadow
services
protocols
#networks
#hosts
#user

Then ctrl+x, yes and save

Now let's fix the stateoverride issue:

$ sudo nano /srv/chroot/ubuntu-x64/var/lib/dpkg/statoverride

change the first crontab and the first messagebus with root, it should look like this:

root root 2755 /usr/bin/crontab
root root 4754 /usr/lib/dbus-1.0/dbus-daemon-launch-helper

Then ctrl+x, yes and save

Now, you can start chrooting into ubuntu:

$ sudo schroot -c ubuntu-x64
$ cd
$ sudo apt install nano
$ sudo nano ~/.bashrc

then add this line in the bottom:

export LANGUAGE=”C”
export LC_ALL=”C”
export DISPLAY=:0

Then ctrl+x, yes and save

Now let's restart our chroot, by exit

$ exit

INSTALL UBUNTU REPOSITORY (INSIDE CHROOT ENVIRONMENT):

$ sudo schroot -c ubuntu-x64
$ cd
$ sudo apt install software-properties-common wget build-essential
$ sudo add-apt-repository universe
$ sudo add-apt-repository multiverse
$ sudo add-apt-repository restricted 
$ sudo apt update && sudo apt upgrade
$ exit

INSTALL WINE & WINETRICKS (INSIDE CHROOT ENVIRONMENT):

$ sudo schroot -c ubuntu-x64
$ cd
$ sudo dpkg --add-architecture i386
$ sudo apt update
$ sudo apt install libxml2-dev:i386
$ sudo apt install wine-development
$ wine --version
$ sudo apt install winetricks
$ sudo apt install zenity
$ sudo apt install winbind
$ sudo apt install nemo
$ exit

INSTALL PLAYONLINUX (INSIDE CHROOT ENVIRONMENT):

$ sudo schroot -c ubuntu-x64
$ cd
$ wget -q "http://deb.playonlinux.com/public.gpg" -O- | sudo apt-key add -
$ sudo wget http://deb.playonlinux.com/playonlinux_bionic.list -O /etc/apt/sources.list.d/playonlinux.list
$ sudo apt update
$ sudo apt install playonlinux
$ exit

Now let's check our ID first:

$ id

ADDING A USER (INSIDE CHROOT ENVIRONMENT):

$ sudo schroot -c ubuntu-x64
$ adduser <username>
$ su - <username>
$ nano ~/.bashrc

add this text in the bottom:

export LANGUAGE=”C”
export LC_ALL=”C”
export DISPLAY=:0

Then ctrl+x, yes and save

Now let's exit:

$ exit

CONFIGURING WINE & WINETRICKS (INSIDE CHROOT ENVIRONMENT):

$ sudo schroot -c ubuntu-x64
$ su - <username>
$ winecfg
$ winetricks
$ exit

INSTALLING .deb Package (INSIDE CHROOT ENVIRONMENT):

$ sudo schroot -c ubuntu-x64
$ sudo dpkg -i <the-location-of-the-deb-package>
$ exit

Once you are done, you can create a shortcut in the desktop running as your username

Nemo Launcher

schroot -c ubuntu-x64 nemo

Other apps:

schroot -c ubuntu-x64 /opt/the/location/of/your/app

With this process, now you should be able to run x86_64 *.deb and install a wine app.

WARNING:

Follow the procedure step by step. Other wise you'll get into trouble.

Hope this might help somebody out there.

Thanks to @Lolix and @xabbu for helping.

I also urge you to post your result with wine to help other.

Many Thanks,

RNA