I got Wine/x86 1.5.11 to run on Linux/ARM with qemu!

Questions about Wine on Linux
User avatar
orokusaki
Level 2
Level 2
Posts: 16
Joined: Sat Oct 13, 2012 8:08 pm

I got Wine/x86 1.5.11 to run on Linux/ARM with qemu!

Post by orokusaki »

Requirements to get Wine 1.5.11 and Qemu to work with Ubuntu 12.10 on ARM

1. VMSPLIT-3G and BINFMT_MISC must be compiled into the kernel.. It makes my kernel crash when I access the lan\wifi with traffic..
2. Use Qemu-0.14.1 with the NPTL Patch ./configure --enable-sdl --target-list=i386-linux-user --prefix=/usr --extra-cflags=-marm to compile.. I compile it in Ubuntu for Arm.
3. Compile Wine 1.5.11 on Ubuntu 12.10 32bit X86.
4. Create /usr/gnemul/qemu-i386/lib /usr/gnemul/qemu-i386/usr/local/lib, /usr/gnemul/qemu-i386/usr/local/lib/wine /usr/gnemul/qemu-i386/usr/lib /usr/gnemul/qemu-i386/usr/lib/i386-linux-gnu and copy the corresponding files from X86. Qemu\Wine will ask for them. Bring over your ~/.wine directory and put it in your home folder.
5. sudo apt-get build-dep wine (do this on arm)
6 Binfmt time. Here is my script to get wine to run
echo ':i386:M::\x7fELF\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfb\xff\xff:/usr/bin/qemu-i386:' >/proc/sys/fs/binfmt_misc/register
echo ':DOSWin:M::MZ::/usr/local/bin/wine:' >/proc/sys/fs/binfmt_misc/register



7. If you do ALL that... Then winecfg will run. About to start testing programs.

Pinball runs VERY FAST! VERY PLAYABLE NOW!!!!!!!!!!! :D

Justin Shafer
OnsiteDentalSystems.com
User avatar
orokusaki
Level 2
Level 2
Posts: 16
Joined: Sat Oct 13, 2012 8:08 pm

Re: I got Wine 1.5.11 to run on ARM with qemu!!!!!!!!!!!!!!!

Post by orokusaki »

8. mv wine-preloader wine-preloader-old

You will run into that problem if you do not.

I recompiled my wireless driver ath6kl and that made my tablet stable with vmsplit-3g... what a pain.

Wine 1.4 works.. scrapped it.. IE7 loads.. then crashes.. but a window forms.. If wineserver stays loaded.. programs load pretty fast.

Going to 1.5.17 now... going to test it out..

I have an idea.. what if wineserver could be arm, and wineclient could be x86 with qemu.. x86 in /usr prefix, arm in /usr/local prefix... or vice-versa.

and maybe make some symbolic links between the two... At least wineserver and client won't complain about a version difference...

winetricks now runs on arm with wine.. but I use it on x86 and then rsync the .wine directory over to my home folder on arm because.. that seems smarter. Perhaps I could use the arm version of wine-preloader, etc, etc.
lahmbi5678
Level 7
Level 7
Posts: 823
Joined: Thu Aug 27, 2009 6:23 am

Re: I got Wine 1.5.11 to run on ARM with qemu!!!!!!!!!!!!!!!

Post by lahmbi5678 »

Hi, I'm not using ARM, but you may add your experience at http://wiki.winehq.org/ARM , though I don't know, if they are pursuing the same approach like you. There's a wine developer mentioned, Andre Hentschel, who has been doing some work an wine+ARM, so you may contact him.
User avatar
orokusaki
Level 2
Level 2
Posts: 16
Joined: Sat Oct 13, 2012 8:08 pm

Re: I got Wine 1.5.11 to run on ARM with qemu!!!!!!!!!!!!!!!

Post by orokusaki »

Thanks! I will contact him.. I just have 1 program to run...
User avatar
André H.
Moderator
Moderator
Posts: 202
Joined: Sun Dec 07, 2008 8:33 am

Re: I got Wine 1.5.11 to run on ARM with qemu!!!!!!!!!!!!!!!

Post by André H. »

Hi,
just spotted this topic, not sure if you contacted me.
Didn't expect a NPTL patch for qemu to be enough...
have to try this out.
lahmbi5678 wrote:Hi, I'm not using ARM, but you may add your experience at http://wiki.winehq.org/ARM , though I don't know, if they are pursuing the same approach like you. There's a wine developer mentioned, Andre Hentschel, who has been doing some work an wine+ARM, so you may contact him.
same approach? Wine run nativly on ARM, so it's not run x86 applications.
User avatar
orokusaki
Level 2
Level 2
Posts: 16
Joined: Sat Oct 13, 2012 8:08 pm

Re: I got Wine 1.5.11 to run on ARM with qemu!!!!!!!!!!!!!!!

Post by orokusaki »

With qemu, I am running the X86 version of wine, and moving the binaries over to my HP Touchpad running Ubuntu 12.10.. I have done the same thing with this olpc, but I could never go past 1.1.16 because of wine-pthread no longer being supported.. I just assumed the NPTL patch would not run Wine 1.3, because Wine 1.2 does not run with the NPTL patch. But wine 1.3-wine1.5 does.. If you delete the wine-preloader.. No idea why..

Wine 1.3 throws one less system call problem with Qemu.

wglxgears runs... (I think that was the name.. its the windows version of glxgears)

I am going to try to get sound to work with my touchpad by compiling the sound as a module instead of being "built-in" so I can make my bose companion 5 card 0.. or something, and perhaps that will get dxdiag to run..

The program I am trying to run on the olpc is Neobook... Its a program that is compiles binaries kind of like making a powerpoint presentation...

If your bored, or want a fun project... Try to run neobook and get past this one error.. :D Thats what I do for fun... If we could, then it would help some kids run exe's compiled by teachers, etc and they could run them without a "pc"... Long shot, but its funner then working a crossword puzzle. :D

I have also ran the arm version of wine.. I ran notepad.. Couldn't think of anything else to run.. Since windows lacks alot of apps for arm.. And uhh.. they require a whole new namespace for a Windows8 app.. or something.. Not easy to give a native desktop application project pinch to zoom without it becoming a new project in Visual Studio.. According to what I read... And all the libraries need to be compatible with the new project... I think it will be awhile until Windows 8 Arm sees a lot of programs... Maybe I am wrong.
User avatar
orokusaki
Level 2
Level 2
Posts: 16
Joined: Sat Oct 13, 2012 8:08 pm

Re: I got Wine 1.5.11 to run on ARM with qemu!!!!!!!!!!!!!!!

Post by orokusaki »

Really the layout is like this:

Copy files\folders from X86 to ARM. Copy ALL of the wine binaries from X86 side to ARM. Don't forget to grab wrm, notepad, regedit, etc.. Don't do rsync -arPtz [email protected]:/usr/bin/wine* /usr/bin and expect all the files to be copied... copy ALL the wine binares. then start copying files to /lib.. you will know which ones as qemu will ask.. then grab libwine and the wine folder.. then qemu will ask for more files for lib.. the last one being libdl something.. Then winecfg should run.. You will also need to copy the libX and libx libraries for X and well, more libraries.. I ran a script to regsvr32 all native dll's from XP just to see what wine would ask for and I was surprised.. it wanted quite a bit of X86 libraries to fullfill all the requirements... You guys will see. Heck, what am I thinking.. I bet you know the list of X86 libraries that wine would want brought over more then I. :D

<-----------------------------------------------------------------COPY FILES FROM X86 to ARM. FILES THAT ARE ASKED FOR.
ARM ___________________________________________________________________X86
/usr/bin/wine executables____________________________________________/usr/bin
/usr/gnemul/qemu-i386/lib____________________________________________/lib
/usr/gnemul/qemu-i386/lib/i386-linux-gnu_______________________________/lib/i386-linux-gnu (if copying from newer distro's of ubuntu)
/usr/gneul/usr/lib___________________________________________________/usr/lib
/usr/gnemul/qemu-i386/usr/lib/i386-linux-gnu____________________________/usr/lib/i386-linux-gnu (if copying from newer distro's of ubuntu)
/usr/gneum/qemu-i386/usr/lib/wine____________________________________/usr/lib/wine
/usr/share/wine____________________________________________________/usr/share/wine
~/.wine__________________________________________________________~/.wine
~/.local/applications/wine___________________________________________~/.local/applications/wine

(~/.wine can be recreated if you delete if, as long as /usr/share/wine has been brought over)

This is if wine has been installed on /usr prefix instead of /usr/local on the X86 side.. You must match the prefix...


WHAT NOT TO DO!!!!!!!!!!!!!!!
DONT try doing something like this
sudo ln -s /proc /usr/gnemul/qemu-i386/proc
OR
sudo ln -s /home/ubuntu/.wine /usr/gnemul/qemu-i386/home/ubuntu/.wine

It just freezes and nothing happens.. You can get away with /dev if I remember correctly... But it seems that this is not needed. the more files you stick inside of /usr/gnemul/qemu-i386... the more qemu slows down.. So if you overload it, or give it an entire filesystem from X86 like I did... expect things to be sluggish.. I did that just as a test to see what would happen.
User avatar
orokusaki
Level 2
Level 2
Posts: 16
Joined: Sat Oct 13, 2012 8:08 pm

Re: I got Wine 1.5.11 to run on ARM with qemu!!!!!!!!!!!!!!!

Post by orokusaki »

STEP 9. Be sure to change the ADDRESS in your .config from 0x80000000 to 0xC0000000 its located near the VMSPLIT in your kernel .config.. Change that as well when you recompile your kernel. Unless your kernel already had these settings.. Mine did not. Be sure to recompile and reinstall modules.
User avatar
André H.
Moderator
Moderator
Posts: 202
Joined: Sun Dec 07, 2008 8:33 am

Re: I got Wine 1.5.11 to run on ARM with qemu!!!!!!!!!!!!!!!

Post by André H. »

could you point us to the "NPTL Patch" for qemu, or a compiled qemu with that patch, please?
User avatar
orokusaki
Level 2
Level 2
Posts: 16
Joined: Sat Oct 13, 2012 8:08 pm

Re: I got Wine 1.5.11 to run on ARM with qemu!!!!!!!!!!!!!!!

Post by orokusaki »

Sure... Qemu 0.14.1
and

http://patchwork.ozlabs.org/patch/45206/

:D

./configure --enable-sdl --prefix=/usr --target-list=i386-linux-user --extra-cflags=-marm

That is how I would configure it on arm.. I don't cross compile qemu.
ptitSeb
Level 2
Level 2
Posts: 19
Joined: Sun Dec 02, 2012 5:33 am

Re: I got Wine 1.5.11 to run on ARM with qemu!!!!!!!!!!!!!!!

Post by ptitSeb »

The NTPL patch can also be applied (manually) on the latest version of Qemu.

I am using an OpenPandora (cortex-a8 proc) to do my test.

Qemu has also another problem, when you don't use binfmt : the "execve" syscall use native execve... I found another hack on the net so execve re-lauch Qemu when it's call.

I can use Qemu with that, but wine doesn't start. I will try with renaming the wine-preload program has hinted in post #2 to see if it's better.

(Also, I have do some experiments with Wine for ARM, and have problems/remarks, I will create a new thread for that).
User avatar
André H.
Moderator
Moderator
Posts: 202
Joined: Sun Dec 07, 2008 8:33 am

Re: I got Wine 1.5.11 to run on ARM with qemu!!!!!!!!!!!!!!!

Post by André H. »

sadly i often have problems with access to memory areas like 0x110000 or 0x7####### anybody with some solution for this?
Testcase: run Powerpoint Viewer 2007
orokusaki wrote: I have an idea.. what if wineserver could be arm, and wineclient could be x86 with qemu.. x86 in /usr prefix, arm in /usr/local prefix... or vice-versa.

and maybe make some symbolic links between the two... At least wineserver and client won't complain about a version difference...

winetricks now runs on arm with wine.. but I use it on x86 and then rsync the .wine directory over to my home folder on arm because.. that seems smarter. Perhaps I could use the arm version of wine-preloader, etc, etc.
i just tried it with an hacked ARM wineserver, it works but it seems there was no speed boost or something.
there's no wine-preloader for ARM atm, i once wrote one, but i'm not sure if it worked, have to have a look at this again.
ptitSeb
Level 2
Level 2
Posts: 19
Joined: Sun Dec 02, 2012 5:33 am

Re: I got Wine 1.5.11 to run on ARM with qemu!!!!!!!!!!!!!!!

Post by ptitSeb »

André H. wrote:i just tried it with an hacked ARM wineserver, it works but it seems there was no speed boost or something.
there's no wine-preloader for ARM atm, i once wrote one, but i'm not sure if it worked, have to have a look at this again.
I'd love to experiment with this on the OpenPandora (even if with the Mesa Software OpenGL implementation, directX Games will be unuseable).

Can you discribes the modification needed to achive that?
User avatar
André H.
Moderator
Moderator
Posts: 202
Joined: Sun Dec 07, 2008 8:33 am

Re: I got Wine 1.5.11 to run on ARM with qemu!!!!!!!!!!!!!!!

Post by André H. »

in server/thread.c:
-static const unsigned int supported_cpus = CPU_FLAG(CPU_ARM);
+static const unsigned int supported_cpus = CPU_FLAG(CPU_ARM) | CPU_FLAG(CPU_x86);
compile Wine for ARM with that
run application like:
WINESERVER=/pathtowinesrc/server/wineserver ...qemu... ...wine... ...x86app.exe...
ptitSeb
Level 2
Level 2
Posts: 19
Joined: Sun Dec 02, 2012 5:33 am

Re: I got Wine 1.5.11 to run on ARM with qemu!!!!!!!!!!!!!!!

Post by ptitSeb »

Thank you ! Will try that and repport latter.
User avatar
orokusaki
Level 2
Level 2
Posts: 16
Joined: Sat Oct 13, 2012 8:08 pm

Re: I got Wine 1.5.11 to run on ARM with qemu!!!!!!!!!!!!!!!

Post by orokusaki »

Compiling.. try it in the morning. =)
User avatar
orokusaki
Level 2
Level 2
Posts: 16
Joined: Sat Oct 13, 2012 8:08 pm

Re: I got Wine 1.5.11 to run on ARM with qemu!!!!!!!!!!!!!!!

Post by orokusaki »

Morning.. still compiling... Morning came to fast. :lol:
BasicOs
Newbie
Newbie
Posts: 3
Joined: Sun Dec 09, 2012 6:32 pm

Re: I got Wine 1.5.11 to run on ARM with qemu!!!!!!!!!!!!!!!

Post by BasicOs »

Hi everybody,

Can Wine run at Ubuntu-Nexus7 version (kind of android)? see https://wiki.ubuntu.com/Nexus7

If it is possible, is there any straightforward and quick way? (not compiling)...

Nexus 7" costs 200€ vs your TouchPad (600), and it may be quicker and more updated.


Based on this topic:
http://translate.google.es/translate?sl ... 26t%3D3730
Original: http://www.emesn.com/autoitforum/viewto ... f=1&t=3730

Salu BasicOs
from www.Autoit.es programming language for Windows &LInux&Mac(wine)
User avatar
André H.
Moderator
Moderator
Posts: 202
Joined: Sun Dec 07, 2008 8:33 am

Re: I got Wine 1.5.11 to run on ARM with qemu!!!!!!!!!!!!!!!

Post by André H. »

BasicOs wrote:Hi everybody,

Can Wine run at Ubuntu-Nexus7 version (kind of android)? see https://wiki.ubuntu.com/Nexus7

If it is possible, is there any straightforward and quick way? (not compiling)...
I'd suggest you read http://wiki.winehq.org/ARM before sending e-mails to every address you can gather and posting in forums.
Or maybe some research in this forum would have been nice, too.
User avatar
orokusaki
Level 2
Level 2
Posts: 16
Joined: Sat Oct 13, 2012 8:08 pm

Re: I got Wine/x86 1.5.11 to run on Linux/ARM with qemu!

Post by orokusaki »

Cool.. well it worked.. No speed difference like you said, but they were talking to eachother..

I didn't really make any applications that could not run before suddenly run now... So I guess the idea is over..

Peter Maydell basically told me that someone is going to have to do some work to the user emulation to make more applications run regardless of what we do to wine.. That sounds about right, though I do wonder about hardware and libraries like alsa, and comctl32.dll or vc++ libraries and directx.. even if qemu was 100%.. how much of a change to wine would be required to run x86 binaries on wine and qemu-i386.

My motherboard went out yesterday.. :evil: Threw in some $50.00 one until I spring for a i7, 32GB ram, and many drives. I had a 975X chipset.. I really liked that board, I am going to replace the caps on it. :lol:
BasicOs
Newbie
Newbie
Posts: 3
Joined: Sun Dec 09, 2012 6:32 pm

Re: I got Wine/x86 1.5.11 to run on Linux/ARM with qemu!

Post by BasicOs »

@Thanks for answer. My idea was to activate one minute focus about it. If you like it.

I've been waiting, not for 1, 2 or 3 years, but for many years Wine to reached current Status, even I thought Wine was not going to be successful to achieve it for many reasons. I'm just happy it works very well on Linux / Mac.

I know that following Ubuntu leading efforts about pocket devices, means investment in money, time and resources and maybe it is asking a too much.
Wine should invest important resources for other topics. I (https://wiki.ubuntu.com/Nexus7)

Ubuntu may be setting the right way into pocket devices behind Apple/google. Google-android did it a few years ago. MS was trying hard and failing during the last years.

I know that follow Ubuntu in his investment of money,resources and time is asking so much, as i suppouse wine resources maybe more limited than Ubuntu.

from xda-developers about Nexus instalar http://www.xda-developers.com/android/u ... available/
about Nexus dual-boot both android/Ubuntu (10 december) http://www.xda-developers.com/tag/google-nexus-7/

Have nice coding!!
juan
Level 1
Level 1
Posts: 6
Joined: Tue Dec 11, 2012 4:35 pm

Re: I got Wine/x86 1.5.11 to run on Linux/ARM with qemu!

Post by juan »

I think this is related to http://forum.xda-developers.com/showthr ... ?t=1258506 (created over a year ago and added to the wiki/ARM some time before this thread).

any strategy to go further on develop x86 wine bin support, André? :)
User avatar
André H.
Moderator
Moderator
Posts: 202
Joined: Sun Dec 07, 2008 8:33 am

Re: I got Wine/x86 1.5.11 to run on Linux/ARM with qemu!

Post by André H. »

BasicOs wrote: I know that follow Ubuntu in his investment of money,resources and time is asking so much, as i suppouse wine resources maybe more limited than Ubuntu.
You just don't make a point on what you want, Wine/ARM runs nearly perfectly without this qemu copy all around thing. and as you can see Wine/x86 works somewhat enough.
juan wrote: any strategy to go further on develop x86 wine bin support, André? :)
I can't do this all alone. :) And i think for many reasons this configuration can't be supported anyway.
Anyway, it works (not good, not easy, but it works) when you know what you do, if you don't you can still consider recompiling your app for ARM with winelib :)
BasicOs
Newbie
Newbie
Posts: 3
Joined: Sun Dec 09, 2012 6:32 pm

Re: I got Wine/x86 1.5.11 to run on Linux/ARM with qemu!

Post by BasicOs »

Hi, Thanks for answers.
I tryed to install Wine in Nexus7-Ubuntu. But it is not in PPA repository of Ubuntu from the software control centre.
Is there any other way or shortcut to have this Wine installed in this case..
User avatar
André H.
Moderator
Moderator
Posts: 202
Joined: Sun Dec 07, 2008 8:33 am

Re: I got Wine/x86 1.5.11 to run on Linux/ARM with qemu!

Post by André H. »

BasicOs wrote:Hi, Thanks for answers.
I tryed to install Wine in Nexus7-Ubuntu. But it is not in PPA repository of Ubuntu from the software control centre.
Is there any other way or shortcut to have this Wine installed in this case..
Again, see http://wiki.winehq.org/ARM
Use Fedora or Maemo, they already package Wine/ARM.
You can install the Maemo package in Ubuntu, too. But the pathes are different, you need to be aware of it (IIRC wine is somewhere in /opt/ then)
Locked