I've mostly followed the Novaspirit's tutorial from:
https://www.novaspirit.com/2019/04/15/run-x86-arm/
First, I've built and run vmsplit checking code from wine (from https://gist.github.com/liuqi/ccf638adc675a3b00c98):
I assume, if above code doesn't print warning, everything is OK and I don't need to rebuild kernel.
Then we need to install prerequisites:
With system qemu-i386-static there may be 'illegal instruction' errors, so we'll build qemu from source. I've followed instructions from
http://logan.tw/posts/2018/02/18/build-q...urce-code/
And start second stage:
Next, we'll chroot as root user:
Then we need to add this:
to the end of .bashrc file and run:
Then run:
Then install leafpad or xterm to install all needed dependencies.
and run:
Now we are ready to install Wine.
Switch focus to your root terminal window or run:
To make things easier first install apt-transport-https package:
Download Wine from Playonlinux with:
Then install bzip2:
Then open .bashrc:
Run:
Now you need to check, if Wine is working, run:
Novaspirit has prepared winetricks but I haven't tried them, yet.
https://github.com/novaspirit/winetricks
Let's finish the installation.
Outside of chroot we'll create script to mount /sys, /proc and the rest at start.
As you can see I've moved chroot-stretch-i386 to /opt but I've forgot to umount previously mounted sys, proc and the rest, which wasn't probably a good idea
Next, make above script executable:
Then enable service:
Make it executable:
At last create desktop shortcuts:
And make them executable:
Unfortunately, I was only able to run installers but installed programs (like Notepad++ or Treesheets) crashed but I haven't used Wine for years, so maybe recent Notepad++ or Treesheets are not good starting points. Don't look at me, I didn't touch it, I swear
Maybe different Wine version would do the trick.
Good luck, and good night.
EDIT: One of the problems was broken qemu-i386-static (there was qemu's 'illegal instruction' error at one of last lines of messages when putty crashed), so I've added instructions to build qemu. I've also changed icons of desktop shortcuts.
Now putty works and I was able to install Notepad++ 6.7.4, but it crashed anyway with wine client bad descriptor error.
https://www.novaspirit.com/2019/04/15/run-x86-arm/
First, I've built and run vmsplit checking code from wine (from https://gist.github.com/liuqi/ccf638adc675a3b00c98):
Code:
#include <sys/mman.h>
#include <stdio.h>
#include <errno.h>
static void check_vmsplit( void *stack )
{
printf("user space is %x\n", stack);
if (stack < (void *)0x80000000)
{
/* if the stack is below 0x80000000, assume we can safely try a munmap there */
if (munmap( (void *)0x80000000, 1 ) == -1 && errno == EINVAL)
fprintf( stderr,
"Warning: memory above 0x80000000 doesn't seem to be accessible.\n"
"Wine requires a 3G/1G user/kernel memory split to work properly.\n" );
}
}
int main()
{
int temp;
check_vmsplit( &temp );
}
Then we need to install prerequisites:
Quote:sudo apt update && sudo apt upgradeAfter successful install, run:
sudo apt install qemu qemu-user qemu-user-static binfmt-support debootstrap binutils
Quote:sudo debootstrap --foreign --arch i386 stretch ./chroot-stretch-i386 http://ftp.us.debian.org/debianThen prepare system to run chroot:
Quote:sudo mount -t sysfs sys ./chroot-stretch-i386/sys/
sudo mount -t proc proc ./chroot-stretch-i386/proc/
sudo mount --bind /dev ./chroot-stretch-i386/dev/
sudo mount --bind /dev/pts ./chroot-stretch-i386/dev/pts/
sudo mount --bind /dev/shm ./chroot-stretch-i386/dev/shm/
With system qemu-i386-static there may be 'illegal instruction' errors, so we'll build qemu from source. I've followed instructions from
http://logan.tw/posts/2018/02/18/build-q...urce-code/
Quote:sudo apt-get build-dep qemuWithout --disable-tools there were linker errors, --target-list=i386-linux-user will build only qemu-i386 binary.
$ git clone git://git.qemu.org/qemu.git
$ cd qemu
$ git submodule update --init --recursive
$ ./configure --prefix=$(cd ..; pwd)/qemu-user-static --static --disable-system --enable-linux-user --target-list=i386-linux-user --disable-tools
make -j6
make install
cd ../qemu-user-static/bin
mv qemu-i386 qemu-i386-static
sudo mv qemu-i386-static ./chroot-stretch-i386/usr/bin
And start second stage:
Quote:sudo chroot ./chroot-stretch-i386/ /debootstrap/debootstrap --second-stageOn my Pinebook Pro it took 28 minutes 30 seconds to finish second stage.
Next, we'll chroot as root user:
Quote:sudo chroot ~/chroot-stretch-i386/ /bin/su -l rootIf your DNS isn't working inside chroot check /etc/resolv.conf and fix your name server address!
Quote:nano .bashrc
Then we need to add this:
Code:
export LANGUAGE="C"
export LC_ALL="C"
export DISPLAY=:0
Quote:source ~/.bashrcso change will to effect.
Then run:
Quote:apt updateAnd create user account:
Quote:adduser -uid 1000 <username>where <username> is your chosen username.
Then install leafpad or xterm to install all needed dependencies.
Quote:apt install leafpadThen open second terminal window and enter:
Quote:sudo chroot /home/marek/chroot-stretch-i386/ /bin/su -l <username>to chroot as your newly created user.
Quote:nano .bashrcAdd at the end:
Code:
export LANGUAGE="C"
export LC_ALL="C"
export DISPLAY=:0
Quote:source ~/.bashrcand then run leafpad (or xterm):
Quote:leafpad
Now we are ready to install Wine.
Switch focus to your root terminal window or run:
Quote:sudo chroot ~/chroot-stretch-i386/ /bin/su -l root
To make things easier first install apt-transport-https package:
Quote:apt install apt-transport-httpsIt will install all dependencies for SSL certificates to work (and we might need apt-transport-https it in the future).
Download Wine from Playonlinux with:
Quote:wget -c https://www.playonlinux.com/wine/binarie...ux-x86.polI've chosen version 3.20, but you can choose a different version (and maybe have better luck with running Windows programs).
Then install bzip2:
Quote:apt install bzip2and then unpack previously downloaded Wine and "install' it:
Quote:tar -jxf PlayOnLinux-wine-3.20-linux-x86.pol --strip-components=1Symbolic link will help with switching wine versions in the future.
mv ./3.20/bin/wine-preloader ./3.20/bin/wine-preloader.renamed
mv ./3.20 /opt/wine-3.20/
cd /opt
ln -s wine-3.20 wine
cd
Then open .bashrc:
Quote:nano .bashrcand add this:
Quote:export PATH=/opt/wine/bin:$PATHat the end and run:
Quote:source ~/.bashrcto refresh session then do the same line to the .bashrc file of your new i386 user account.
Run:
Quote:sudo chroot ~/chroot-stretch-i386/ /bin/su -l <username>Then open .bashrc:
Quote:nano .bashrcand add this:
Quote:export PATH=/opt/wine/bin:$PATHat the end and run:
Quote:source ~/.bashrcto refresh session.
Now you need to check, if Wine is working, run:
Quote:winecfgThe window should appear and it will download gecko and stuff, finally Wine config window should appear.
Novaspirit has prepared winetricks but I haven't tried them, yet.
https://github.com/novaspirit/winetricks
Let's finish the installation.
Outside of chroot we'll create script to mount /sys, /proc and the rest at start.
Quote:sudo mkdir -p /opt/chrootscript/Paste this:
sudo nano /opt/chrootscript/chrootmount
Code:
#!/bin/sh
mount -t sysfs sys /opt/chroot-stretch-i386/sys/
mount -t proc proc /opt/chroot-stretch-i386/proc/
mount --bind /dev /opt/chroot-stretch-i386/dev/
mount --bind /dev/pts /opt/chroot-stretch-i386/dev/pts/
mount --bind /dev/shm /opt/chroot-stretch-i386/dev/shm/
Next, make above script executable:
Quote:sudo chmod a+x /opt/chrootscript/chrootmountThen create service file:
Quote:sudo nano /etc/systemd/system/chrootmount.servicepaste this:
Code:
[Unit]
Description = mounts chroot on boot
[Service]
Type=one-shot
ExecStart=/opt/chrootscript/chrootmount
[Install]
WantedBy=multi-user.target
Quote:sudo systemctl enable chrootmount.serviceThen we will make scripts to make chrooting easier:
Quote:sudo nano /opt/chrootscript/start_x86_userAnd paste:
Code:
#!/bin/sh
/usr/sbin/chroot /opt/chroot-stretch-i386/ /bin/su -l <username>
Quote:sudo chmod a+x /opt/chrootscript/start_x86_userRepeat this process for root:
Quote:sudo nano /opt/chrootscript/start_x86_root
Code:
#!/bin/sh
/usr/sbin/chroot /opt/chroot-stretch-i386/ /bin/su -l root
Quote:sudo chmod a+x /opt/chrootscript/start_x86_root
At last create desktop shortcuts:
Quote:nano ~/Desktop/chroot_user.desktop
Code:
[Desktop Entry]
Type=Application
Comment=Start Wine x86 Environment
Name=Wine x86 User
Exec=mate-terminal -e 'sudo /opt/chrootscript/start_x86_user'
Icon=utilities-terminal
Terminal=false
Categories=Utility
StartupNotify=True
Quote:nano ~/Desktop/chroot_root.desktop
Code:
[Desktop Entry]
Type=Application
Comment=Start Wine x86 Environment
Name=Wine x86 Root
Exec=mate-terminal -e 'sudo /opt/chrootscript/start_x86_root'
Icon=gksu-root-terminal
Terminal=false
Categories=Utility
StartupNotify=True
Quote:chmod a+x ~/Desktop/chroot_user.desktopRestart Pinebook Pro. After restart check status of our mounting service:
chmod a+x ~/Desktop/chroot_root.desktop
Quote:sudo systemctl status chrootmount.serviceIf there are no error, you can double click on one of Wine x86 shortcuts to open terminal.
Unfortunately, I was only able to run installers but installed programs (like Notepad++ or Treesheets) crashed but I haven't used Wine for years, so maybe recent Notepad++ or Treesheets are not good starting points. Don't look at me, I didn't touch it, I swear
Maybe different Wine version would do the trick.
Good luck, and good night.
EDIT: One of the problems was broken qemu-i386-static (there was qemu's 'illegal instruction' error at one of last lines of messages when putty crashed), so I've added instructions to build qemu. I've also changed icons of desktop shortcuts.
Now putty works and I was able to install Notepad++ 6.7.4, but it crashed anyway with wine client bad descriptor error.