View Full Version : Running native i386 linux binaries
I've managed to run hello world (static at the moment) which is an x86 binary, on my n900 using qemu's user linux mode.
?:/home/opt/root# file hello
hello: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.8, statically linked, stripped
?:/home/opt/root# file `which file`
/usr/bin/file: ELF 32-bit LSB executable, ARM, version 1 (SYSV), for GNU/Linux 2.4.17, dynamically linked (uses shared libs), stripped
?:/home/opt/root# ./qemu-i386-2 ./hello
Hello World
?:/home/opt/root#
Next up, dynamically linked stuff, and then wine :)))
Now with a stock GNU ls from an x86 box, dynamically linked.
?:/home/opt/root/lib# ../qemu-i386-2 ./ld-linux.so.2 --library-path `pwd` ../ls
qemu: Unsupported syscall: 240
ld-linux.so.2 libattr.so.1 libdl.so.2 librt.so.1
libacl.so.1 libc.so.6 libpthread.so.0 libselinux.so.1
?:/home/opt/root/lib#
Don't know what Unsupported syscall: 240 is, but it seems to work and correctly lists files.
A call to system library that is ARM EABI?
My wineserver and wine attempts are failing sadly.
?:/home/opt/root/standalonewine-0.99# strace -s256 -v -fF -o log ../qemu-i386-2 $MYWINEPATH/ld-linux.so.2 --library-path $LDLIBRARY_PATH $MYWINEPATH/wine-pthread
qemu: Unsupported syscall: 240
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
I happened to already have an ld-linux.so spawned wine and wineserver shell wrapper from a different project running missmatched system compiled binaries. However that was on the same arch. This isn't working.
#!/bin/bash
export MYWINEPATH=`pwd`
export WINEPREFIX=`pwd`
export WINEDLLPATH=$MYWINEPATH/dlls
export LDLIBRARY_PATH=$MYWINEPATH/libs
../qemu-i386-2 $MYWINEPATH/ld-linux.so.2 --library-path $LDLIBRARY_PATH $MYWINEPATH/wineserver.bin
Anyone have any ideas what to try next? qemu mailing list, wine mailing list ?
Hve you tried looking into the core dump? Even debugging it?
which qemu version are you using?
You could try to get wine running on a x86 host (x86 on qemu on x86) first.
With the following
mount -t binfmt_misc none /proc/sys/fs/binfmt_misc
echo ':i386:M::\x7fELF\x01\x00\x00\x00\x00\x00\x00\x00\ x00\x00\x00\x00\x02\x00\x03:\xff\xff\xff\xff\xff\x fe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfb\xff \xff:/home/user/qemu-i386:' >/proc/sys/fs/binfmt_misc/register
echo LD_LIBRARY_PATH=/opt/root/x
~/wine/usr/lib/wine $ file /lib/ld-l*
~/wine/usr/lib/wine $ file -L /lib/ld-l*
/lib/ld-linux.so.2: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), stripped
/lib/ld-linux.so.3: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), stripped
~/wine/usr/lib/wine $
I can simply run arm or x86 linux binaries with reasonable success. fork/clone don't work so wine can't run stuff but will execute:
~/wine/usr/lib/wine $ /usr/bin/file /usr/bin/file
/usr/bin/file: ELF 32-bit LSB executable, ARM, version 1 (SYSV), for GNU/Linux 2.4.17, dynamically linked (uses shared libs), stripped
~/wine/usr/lib/wine $ file ../../bin/wine
../../bin/wine: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.18, dynamically linked (uses shared libs), stripped
~/wine/usr/lib/wine $ wine
qemu: Unsupported syscall: 240
Usage: wine PROGRAM [ARGUMENTS...] Run the specified program
wine --help Display this help and exit
wine --version Output version information and exit
~/wine/usr/lib/wine $ wine --version
qemu: Unsupported syscall: 240
wine-1.1.29
ldesnogu
2010-02-11, 08:42
There are two things here :
- The unsupported syscall 240 is __NR_futex. The problem is that QEMU doesn't support NPTL for x86. This will certainly cause some problems with clone.
- You shouldn't mix host and guest files in the same place! Copy an x86 filesystem somewhere, and chroot into it from inside QEMU. That's the safest way of doing things :)
2disbetter
2010-02-11, 09:20
I'm following this thread with much interest. Please keep us updated on your attempts.
2d
There are two things here :
- The unsupported syscall 240 is __NR_futex. The problem is that QEMU doesn't support NPTL for x86. This will certainly cause some problems with clone.
- You shouldn't mix host and guest files in the same place! Copy an x86 filesystem somewhere, and chroot into it from inside QEMU. That's the safest way of doing things :)
Thanks, I've also (yesterday) heard the same about NPTL from the qemu developers list. Simply my use of particular userland libs could be causing me the issues. I might try and find quite old dists to compile against or just nick binaries from.
As for mixing stuff, well I was segregating with ./ld-linux.so.3 --library-path ... ./binary which is not quite chrooted but as separate as safe. But mixing was cool and I know the dangers ;) I've also been unable to get chroot (busybox) to work as I expected it, I get /bin/sh no such file or directory despite there being a bin/sh in the /place/ I'm chrooting to.
Sadly I'm away for 3 weeks now with probably limited connectivity. I encourage others to try what I've checked out. Qemu peeps say my override of __clear_cache() was okay, so the qemu-i386 binary is safe to use, if somebody wants a copy it's wgetable from this url: http://a.trap.me.uk/qemu-i386 - they also agree a p90 was reasonable speed to expect (excluding any floating point). My experience with xeyes and topper show that graphically it's nifty and well worth investigating.
The rest of this thread should help the rest of the set up, most people will have the right libs and files lying around.
FYI: I've uploaded my qemu-kvm build to extras-devel.
I guess the most promising approach would be install a Maemo i386 rootstrap in a chroot (it uses the same binary versions as armel) and install a Wine compiled for the Maemo i386 SDK.
you guys absolutely rule. i came across this post: http://talk.maemo.org/showthread.php?t=14879
and someone posting there was nice enough to answer a question but when i mentioned wine, he might have clammed up haha. oh well.
i'm glad to see that you guys are excited about trying wine in qemu. i don't expect anything amazing, but i'm itching to see what it can do.
keep up the great work guys!
I had a couple of hours spare this evening. Previously I've had issues running an x86 chroot. I've tried several known working directory hierarchies which chroot should work with. I've even tried an x86 chroot binary. So continuing down the LD_LIBRARY_PATH and ./ld-linux.so execution route I decided to try the exact instructions that worked in 2004 on PPC, old RedHat RPMs and wine version to guarentee old non NTPL stuff.
Unfortunately I think I've hit a blocker:
~/winefiles $ ../qemu-i386 -L /home/user/winefiles/l lib/ld-2.3.2.so usr/bin/wineserver
~/winefiles $ ../qemu-i386 -L /home/user/winefiles/l lib/ld-2.3.2.so usr/bin/wine-pthread notepad
Could not stat /mnt/floppy (No such file or directory), ignoring drive A:
err:dosmem:setup_dos_mem Cannot use first megabyte for DOS address space, please report
err:heap:HEAP_CreateSystemHeap system heap base address 0x65430000 not available
Segmentation fault
~/winefiles $ ../qemu-i386 -L /home/user/winefiles/l lib/ld-2.3.2.so usr/bin/wineserver
~/winefiles $ ../qemu-i386 -L /home/user/winefiles/l lib/ld-2.3.2.so usr/bin/wine-pthread pscp.exe
Could not stat /mnt/floppy (No such file or directory), ignoring drive A:
err:virtual:map_image Standard load address for a Win32 program (0x00400000) not available - security-patched kernel ?
wine: could not load L"C:\\windows\\pscp.exe" as Win32 binary
~/winefiles $
I need help from a qemu/wine/armlinux/kernel expert to continue.
This might be solved by a custom kernel (annoyingly), I don't have a /proc/sys/kernel/exec-shield-randomize or /proc/sys/kernel/exec-shield
but apparently echoing 0 in to those can help. There is a page covering the issue here: http://www.codeweavers.com/site/support/tickets/browse/?ticket_id=34072
I also found the following from 2006 http://www.winehq.org/pipermail/wine-devel/2006-July/049937.html which covers the setup_dos_mem as maybe needing a differently compiled wine, which will be a pain.
Anyone else interesting in getting this going? I think it's looking possible now. Native x86 binaries seem to run reasonably quickly so this is definitely worth it, and quite a big win for the N900
I've done it! I used a newer base x86 chroot and wine. Then bind mounted /tmp/.X11-unix and ran notepad and several other utils. It's not bad at all but is a tad more graphically sluggish than I was hoping for. winmine and sol.exe would be indistinguishable from native speeds as notepad is. But I've yet to try out a highly graphical game.
videos to be posted shortly.
javispedro
2010-05-15, 14:26
The "right way" would be to use native wine with patched x86 loader, much like the older PPC wine used to do. In fact last time I looked at it (months ago) someone was submitting patches to winelib for this. This way rendering code is not emulated (= fast).
Ooh, sounds good. Although I didn't find this as the way the PPC version worked, last I saw was it was qemu-ing wine like I am.
As for the videos, here is the first:
http://www.youtube.com/watch?v=n3v4YC9RT-g
For non windows stuff, just native linux X11 binaries are pretty fast. I have a video of XV starting up to show this as an example, xterm, cfdisk and other things work, but I was mainly working on wine, seeing as all of these can be compiled natively.
http://www.youtube.com/watch?v=mMzTFMpAQVM
RafaLL92
2010-05-15, 15:18
Nice! That looks sweetly promising :)
does anyone know any good windows free games wine compatible and fast on a p90-p300 sort of range of machine?
OpenTTD new version :) At the moment we can play with 0.7.4 only but at least will be something to compare wit native build.
They have a lot of platforms on the list
http://www.openttd.org/en/download-stable
You've tried with qemu already or are suggesting it?
Just to show the graphical responsiveness, here is sol.exe running:
http://www.youtube.com/watch?v=dfcEsJc74Qs
Megaltariak
2010-05-17, 16:08
Wow, this is definitively impressive, maybe that some old windows games will be playable at decent speed with OC.
Shouldn't need OC for many basic old games
Love the work being done here. Would be grateful for a full howto. Would be happy to write one up if you would be willing to walk me through a basic install. I realize you have limited cycles left so let me know if there is some other way I can help. Have used WINE quite extensively on other linux builds.
Megaltariak
2010-05-17, 20:49
Yes but for more advanced games like Starcraft or Age of Empires, does they will be playable at decent speed ?
Do you think it will possible to use dropbox for linux with qemu ?
Yes but for more advanced games like Starcraft or Age of Empires, does they will be playable at decent speed ?
Screw that - does this play :)
http://appdb.winehq.org/objectManager.php?sClass=version&iId=7440
How old are they? How fast a cpu do they need? Do they need 3D?
This technique emulates a 250MB ram pentium I @ 90-133MHz with no 3d accel and compatibility comparible with wine. I've not tested audio at all and I've hit at least one issue with the screen size on a solitaire clone.
Notepad and solitaire are very usable/fast. I've yet to find a download for something more adventurous.
I'll do a howto soon, although the details are in the two threads I've been updating.
Megaltariak
2010-05-18, 05:31
They are 1997-1998, fully compatible with wine and they need a 133 pentium with 32mb ram, no 3D accel so I think that they will be perfectly playable with OC.
How old are they? How fast a cpu do they need? Do they need 3D?
This technique emulates a 250MB ram pentium I @ 90-133MHz with no 3d accel and compatibility comparible with wine. I've not tested audio at all and I've hit at least one issue with the screen size on a solitaire clone.
Notepad and solitaire are very usable/fast. I've yet to find a download for something more adventurous.
I'll do a howto soon, although the details are in the two threads I've been updating.
Audio and network running and we might also have Spotify, considering it works well in wine, and the screen is resizable to less than 800x480. If the desktop client works, there is no need for Spotify Premium account :)
Audio and network running and we might also have Spotify, considering it works well in wine, and the screen is resizable to less than 800x480. If the desktop client works, there is no need for Spotify Premium account :)
Spotify is a fairly new app, and I seriously doubt they tested it on something as slow as the speed this runs at. It decodes audio (mp3 or similar) and that is seriously going to struggle at p90 speeds. As for actually running it. I'll give it a go as my colleagues here want to see that too.
Network works perfectly, putty.exe works almost flawlessly. I've simply not tried audio, but I'm not sure how easy it'll be with pulse running, I think my /dev/snd/* structure is there for the kernel to pick up stuff thrown at it, but I've not tried yet.
They are 1997-1998, fully compatible with wine and they need a 133 pentium with 32mb ram, no 3D accel so I think that they will be perfectly playable with OC.
If you have them in wine on your desktop could you tar up your .wine/ which hopefully contains the working c: with the games, as well as optimised registry settings. Then private message me with a way to get them and I'll give them a go.
Do you think it will possible to use dropbox for linux with qemu ?
I was going to download and try this for you, expecting a closed source linux x86 binary. However the source is available: https://www.dropbox.com/downloading?os=lnx So this should just be trivial to cross compile (which I could do, but I CBA as I have no use for it).
If I find my copy of Eric's Ultimate Solitaire I'll try that, I suspect it'll work well. I paid for that many years ago.
Megaltariak
2010-05-18, 10:55
Ok I will try to find my usb key when I will be at home, or reinstall Ubuntu on a dumb usb key then reinstall the games ... if I find them.
And do you think to package qemu + wine with working settings as a deb ?
I'll do a quick write-up and then maybe do a .tar people can extract in to /home/user and follow a readme.
I /might/ if I really feel generous, create a .deb people can dpkg. But as you need to echo stuff to /proc and chroot and things, it needs sudo and other nasties, and this whole thing is still really an experiment in madness, so I don't really think it's worth doing that. It's certainly not going to be worth my time registering for maemo repositories, although I do play to put mediatomb and xroar in there at some point in the future (when my kids start school!?).
For the moment, it's probably better for experimenters to extract the tar and run a few basic commands to initiate the phone in to the state where it can run arbitrary x86 binaries including wine.
The "right way" would be to use native wine with patched x86 loader, much like the older PPC wine used to do. In fact last time I looked at it (months ago) someone was submitting patches to winelib for this. This way rendering code is not emulated (= fast).
+1
This is very similar to the way scratchbox runs ARMEL binaries in full X86 environment.
User Mode of QEMU (http://en.wikipedia.org/wiki/QEMU#User_mode_emulation) was designed exactly for this purpose.
DarWINE (http://sourceforge.net/projects/darwine/) does it and may serve as reference.
Spotify%20Installer.exe just managed to reboot my phone. I'm worried as to how a program running as user (I su - user within the chroot), is able to cause the phone to do that. I guess the chroot and initial shell are root, so maybe something was able to tickle something it should via that, maybe the bind mounted /tmp/.X11-root wrote something iffy to the X0 socket? perhaps /dev/* interaction can cause it to get upset.
I then tried the chroot on a real desktop and the system libs, wine version and/or surrounding /etc and /dev weren't up to the task. So I'll have to have a bit of a think about the cleanest way to work around this. Perhaps somebody used to using pbuilder or debootstrap to create feature full chroots could follow my instructions.
+1
This is very similar to the way scratchbox runs ARMEL binaries in full X86 environment.
User Mode of QEMU (http://en.wikipedia.org/wiki/QEMU#User_mode_emulation) was designed exactly for this purpose.
DarWINE (http://sourceforge.net/projects/darwine/) does it and may serve as reference.
Who do I convince to work on this? This sounds beyond my level of expertise.
# HOWTO:
# I've put hashes at the start of the line, so you could practically execute
# This file and expect it to work to a degree.
# bring up a terminal and from within /home/user (the default):
wget http://a.trap.me.uk/qemu-i386
chmod 755 ./qemu-i386
# test it works
./qemu-i386
# If this seems to output directions for use, this is working.
sudo gainroot
mount -t binfmt_misc none /proc/sys/fs/binfmt_misc
echo ':i386:M::\x7fELF\x01\x00\x00\x00\x00\x00\x00\x00\ x00\x00\x00\x00\x02\x00\x03:\xff\xff\xff\xff\xff\x fe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfb\xff \xff:/home/user/qemu-i386:' >/proc/sys/fs/binfmt_misc/register
# Your phone can now execute arbitrary statically linked x86 binaries
# or with some effort, (./ld-linux.so.2 --library-path `pwd` ./filename)
# any x86 linux binary.
# Set up the chroot with wine...
# I tarred up /etc /usr/lib /usr/X11/lib /usr/X11/bin /usr/bin /lib /bin /sbin
# from (it turns out) an old slackware 10.2 install that had had wine
# installed at some point in the past, ~version 0.9.14.
# extract the chroot in to /chroot (or wherever you want that has space)
# ... actually DON'T use rootfs space, but I'll use /chroot for ease of
# writing this.
# as root
cd /chroot
mkdir -p proc dev tmp/.X11-unix
chmod 777 tmp && chmod +t tmp
# I can't remember the octal for sticky in one go ;)
# copy the phone's /dev, something like:
tar cf blah.tar /dev && tar xf blah.tar
# by default tar strips the leading / so this probably works.
mount -o bind /tmp/.X11-unix tmp/.X11-unix
mount -t proc none proc
mount -t devpts dev/pts
vi etc/mtab etc/passwd
# ... edit to suit your needs. mtab should be small with mainly just /
# referenced, in passwd put a user:29999 account
# TEST full x86 chroot!!!
chroot /chroot
# You should see: bash-2.0# Or similar, and stuff like ls should work!
su - user
export DISPLAY=:0
/usr/X11/bin/xterm
# Oh I needed a symblink for X11 to X11R6 too, I also think I edited
# /etc/ld.so.conf to contain X libs, also I lack terminal definition files
# from that list of directories so I can't do some curses stuff.
# After your success running xterm as x86, which itself fork()ed bash
# again and showed a pretty impressive speed, you're 95% of the way
# there.
# Copy existing known .wine/ hierarchy ??? I think I happened to have
# one in /home/damion from where I nabbed the x86 chroot stuff.
# Then...
wine-pthread ./sol.exe
# Obviously you'll need sol.exe from XP or something and obviously you
# can use whatever wine stuff you need, not just sol :) You need
# wine-pthread, wine on its own segvs for me. I used to run wineserver
# 1st, but wine-pthread can successfully fork wineserver within this
# chroot without issue for me.
# Profit.
Who do I convince to work on this? This sounds beyond my level of expertise.
I'm already sold to the Project.
Just need to step to a store and purchase few buckets of free time. :)
Oh and I typed the HOWTO entirely from my head so if it works flawlessly, I'm a rockstar ;) Please can people try this out, especially anyone with spare time and/or good experience with working with chroots.
Oh and I typed the HOWTO entirely from my head so if it works flawlessly, I'm a rockstar ;) Please can people try this out, especially anyone with spare time and/or good experience with working with chroots.
when i was running this ssh'ed from my mac I got a few errors, I disagreed them but I will look into them my self and see if I can figure out what im doing wrong. If not I will post questions and errors here :P
Anyway looking forward to a .deb application to install and maintain this chroot with wine, It can be called Easy Wine or something haha :)
But right now im on work, so I cant fiddle with stuff, but I will try again later :) Thanks for the progress, this will be the ultimate phone if it can run x86 programs easily!!!
None the less, my phone is clocked at 850 with titans kernel, and I would love to have the qemu to emulate more than at P90 speeds, maybe at like 333mhz or even 500mhz, or as much as possible. Thanks for your time :)
Has anyone else got it working ?
Marshall Banana
2010-05-21, 15:50
Has anyone else got it working ?
First thank you again for your present work and the howto :)
Here is what i tried:
I downloaded your qemu-Build and registered it to run i386-binaries.
I tried to run a static linked i386-binary and a dynamic linked binary, they both worked but for the dynamic linked one i had to execute qemu explicitly:
../qemu-386 ./ld-linux.so.2 --library-path `pwd` ./otrdecoder
because
/ld-linux.so.2 --library-path `pwd` ./otrdecoder
just gave me: ./ld-linux.so.2: line 1: syntax error: "(" unexpected
otrdecoder is a closed source downloader/decoder for an internet tv recorder service: www.onlinetvrecorder.com (http://www.onlinetvrecorder.com)). I can execute them and the tell me about their command line arguments but they complain that they can't connect to the server. I guess that's because qemu doesn't provide network access.
Did you leave out the networking functionality of qemu in your build or did i just not configure it properly?
I just missed a few networking libraries (libresolv, libnss*), now i can run & use otrdecoder on the n900 :).
I did not create a full chroot environment with wine yet. Collecting all the libraries for the dynamically linked binary was enough work for me :). So i can't say if that part of your howto works.
Edit: i'm doing this right now
Descalzo
2010-05-21, 15:53
This really interests me. Makes me wish that A: I wasn't a big chicken and B: I had the time to do this.
Aw screw it, I'm gonna see what happens. I can always reflash, right?
Descalzo
2010-05-21, 16:04
# HOWTO:
# I've put hashes at the start of the line, so you could practically execute
# This file and expect it to work to a degree.
# bring up a terminal and from within /home/user (the default):
wget http://a.trap.me.uk/qemu-i386
chmod 755 ./qemu-i386
# test it works
./qemu-i386
So far, so good.
# If this seems to output directions for use, this is working.
sudo gainroot
mount -t binfmt_misc none /proc/sys/fs/binfmt_misc
echo ':i386:M::\x7fELF\x01\x00\x00\x00\x00\x00\x00\x00\ x00\x00\x00\x00\x02\x00\x03:\xff\xff\xff\xff\xff\x fe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfb\xff \xff:/home/user/qemu-i386:' >/proc/sys/fs/binfmt_misc/register
What in the world? I'm pretty new when it comes to this, but I want to learn, and I will have some free time in the coming weeks. What does all this mean?
If you tell me that maybe I ought to wait, I won't be insulted.
Marshall Banana
2010-05-21, 16:54
So far, so good.
What in the world? I'm pretty new when it comes to this, but I want to learn, and I will have some free time in the coming weeks. What does all this mean?
If you tell me that maybe I ought to wait, I won't be insulted.
"binfmt_misc is a capability of the Linux kernel which allows arbitrary executable file formats to be recognized and passed to certain user space applications, such as emulators and virtual machines." (wikipedia (http://en.wikipedia.org/wiki/Binfmt_misc)).
With this two commands everytime you execute a i386 binary on your n900, i. e. ./wine-pthread, qemu-i386 is called by the kernel to execute it.
Other topics you want to look up to understand this howto: chroot, devfs, mounting.
The hardest part will be to "fill" up your chroot environment. You need an old i386 linux installation with a working xserver and wine (like i. e. slackware 10.2) and copy all the stuff that is necessary to run the xserver and wine (/etc /usr/lib /usr/X11/lib /usr/X11/bin /usr/bin /lib /bin /sbin).
My tip: Don't be a chicken and try it out :). Make a backup before you start in case you need to reflash.
Put your chroot directory in /opt and be careful not to overwrite anything (like /dev on your phone or /etc). If you don't accidentally overwrite anything you just need to reboot your phone to revert the changes you made by chrooting and mounting.
If you don't accidentally overwrite anything you just need to reboot your phone to revert the changes you made by chrooting and mounting.
Huh? You can always exit your chroot:ed evironment and use umount to unmount whatever has been mounted. Rebooting is ... just wrong.
Marshall Banana
2010-05-21, 17:21
Huh? You can always exit your chroot:ed evironment and use umount to unmount whatever has been mounted. Rebooting is ... just wrong.
y, that's a good point. I'm not a diligent unmounter :(
Can I use ubuntu 10.04 (i386) for this?
Latest Ubuntu should be okay, I've been meaning to try a newer chroot base and wine as I think lack of NPTL should be okay not a forced requiement.
I've had mixed results so far, with many windows apps never opening up a window, for example wordvrw.exe. I'm not sure why much would fail. I though the main disadvantage would just be resources like cpu speed, ram and screen size.
First thank you again for your present work and the howto :)
Here is what i tried:
I downloaded your qemu-Build and registered it to run i386-binaries.
I tried to run a static linked i386-binary and a dynamic linked binary, they both worked but for the dynamic linked one i had to execute qemu explicitly:
../qemu-386 ./ld-linux.so.2 --library-path `pwd` ./otrdecoder
because
/ld-linux.so.2 --library-path `pwd` ./otrdecoder
just gave me: ./ld-linux.so.2: line 1: syntax error: "(" unexpected
Yeah I had it work on an ubuntu ld-liux.so but not slackware, I suspect just differing magic sequence of bytes in the ELF header.
otrdecoder is a closed source downloader/decoder for an internet tv recorder service: www.onlinetvrecorder.com (http://www.onlinetvrecorder.com)). I can execute them and the tell me about their command line arguments but they complain that they can't connect to the server. I guess that's because qemu doesn't provide network access.
Did you leave out the networking functionality of qemu in your build or did i just not configure it properly?
I just missed a few networking libraries (libresolv, libnss*), now i can run & use otrdecoder on the n900 :).
You also need to be online 1st. I run an auto idling script fm the if-up.d myself.
I did not create a full chroot environment with wine yet. Collecting all the libraries for the dynamically linked binary was enough work for me :). So i can't say if that part of your howto works.
Edit: i'm doing this right now
Good luck. One thing I mean try try is touching a file before testing on a normal x86 system, then using find / -anewer /fileyoutouched
to create a list of files for a very minimal chroot.
"
The hardest part will be to "fill" up your chroot environment. You need an old i386 linux installation with a working xserver and wine (like i. e. slackware 10.2) and copy all the stuff that is necessary to run the xserver and wine (/etc /usr/lib /usr/X11/lib /usr/X11/bin /usr/bin /lib /bin /sbin).
You do not need an xserver, you should be able to talk to the existing one. In fact given time I'd investigate what the easy arm debian chroot is doing.
My tip: Don't be a chicken and try it out :). Make a backup before you start in case you need to reflash.
If you always stay as a user and use ./qemu itself to envoke stuff, I'd go as far as to say that this is pretty much zero risk. There is always some risk doing anything as root, that you delete or overwrite something by mistake if you're new and make a mistake. But there aren't any flash requiring kernel changing weirdnesses here to make this ricky. It is however, fairly UNIXy and technical, hard for anyone who isn't experienced to follow.
Put your chroot directory in /opt and be careful not to overwrite anything (like /dev on your phone or /etc). If you don't accidentally overwrite anything you just need to reboot your phone to revert the changes you made by chrooting and mounting.
I using mount -o bind a few times so I was adding a smidgen of risk that I'd go near my own filesystem.
Marshall Banana
2010-05-29, 11:05
You do not need an xserver, you should be able to talk to the existing one. In fact given time I'd investigate what the easy arm debian chroot is doing.
Good to know, thx! So the x86 x11 libraries that wine or x86-xterm call use the existing xserver on the n900?
Good luck. One thing I mean try try is touching a file before testing on a normal x86 system, then using find / -anewer /fileyoutouched
to create a list of files for a very minimal chroot.
My approach for creating a minimal chroot environment with i386 Ubuntu 8.04:
I use strace and call the x86 binary i want to run on the n900 and filter out all the "open" calls:
strace xterm 2>&1 | grep 'open("' | grep -o '"/.*",' | grep -o '[^"]*' | sort | uniq | grep -v "/dev" | grep -v "/proc" > list_xterm.txt
I add some more stuff to that list (i.e. output of dpkg -L xterm or /home/user/.wine) and create a tar with it. Hopefully i get a working minimal chroot environment out of this.
Yeah, strace is another good way to achieve good results. Of course you might want a shell and other utilities as basic as ls, which if you're not run under strace or relying on an atime enabled mount and use find, then you realise you've missed them all too late :-/ It's a pity it takes so long to copy a large dist over to the phone, otherwise I wouldn't skimp so much.
The instructions with a mount -o bind /tmp/.X11-unix/. provide access to the X0 socket in that directory which is what X11 libs use when DISPLAY=:0, if the X server isn't run with -nolisten tcp then localhost:0 would work (127.0.0.1 port 6000) using tcp. I suspect easy debian chroot is using one of those two techniques. Frankly the idea of tweaking my X server start up scripts and rebooting scares the hell out of me, that IS a sure fire way to risk bricking.
javispedro
2010-05-29, 15:26
Hm.... Doesn't system qemu have a "-L" option for setting the dynamic loader's library path? And doesn't recent versions of qemu support NPTL? At least I've seen a few x86 patches for it.
bartekxyz
2010-06-05, 14:18
Is it possible to run Blade Runner that way?
http://www.youtube.com/hotdigi#p/a/u/0/rZBlrinSjec
You're picking your nose in great style, bro. Kudos!
Great discussion ! I stumbled several times over this post and now I just wanted to know some more about it.
I'm trying to do exactly the same on a seagate dockstar. Unfortunately it has a different Marvell Feroceon ARM cpu. Your qemu binary however does run and display the help message but running any other i386 binary gives me an illegal instruction.
I compiled several qemu 0.11 and 0.12 myself but can not seem to get a stable qemu-i386. The qemu-i386 that comes with debian-arm squeeze does not want to chroot as well.
How did you configure ? which gcc did you use any CFLAGS ?
hi, I had been reading this wonderful post. I even tried out the steps to run x86 binary on ARM Linux.
I successfully using the provided qemu-i386 run some easy statically and dinamically build binary, such as a helloworld program.
However, when I tried to use this with chroot and bash shell, the bash shell can run but it can not execute any shell command such as ls because it keep on giving me <b>fork: invalid argument</b>. However, if I run ls command directly from qemu without using bash shell, the ls command can work. I really wondering why this fork error come out?
I tried with the mentioned x86 slackware and x86 Ubuntu 10.04 LTS chroot enviroment. Though the slackware don't give syscall error 240 but Ubuntu 10.04 does.
The only main different is that, I am not using maemo or N900, but angstrom on beagleboard. I know I shouldn't post here, but I believe experts from here could give me some hint to overcome this problem.
clasificado
2010-09-08, 05:06
maybe you should double check your chroot box. if your PATH in bash is mixing arm binaries inside your chroot-qemu-shell x86 environment, that will give you some headcaches :D
maybe you should double check your chroot box. if your PATH in bash is mixing arm binaries inside your chroot-qemu-shell x86 environment, that will give you some headcaches :D
May I know more detail? Because I never touch on my $PATH. Before chroot, my $PATH is /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
after chroot my $PATH still the same value (Somehow after chroot echo command still executable but printenv will give fork error still).
I created a directory named 'newroot' which I stored all the x86 Linux files and also the qemu provided by damion. Then I chrooted into this newroot with argument /bin/bash. Most of the shell command can't work on this /bin/bash but change direction command (cd) and echo still work.
the bin_fmt stuff is needed as outside of the chroot you can run ./qemu ./stuff but within then /bin/sh and everything it touches is the wrong arch so the kernel needs to know via the right magic echoed in to proc. Sorry tapping away in to my phone so can't c+p references but this should help. if it's any consolation it took me ages to get my head around the chroot complexities and architecture mixmatch. There is a reason qemu is static here!
Megaltariak
2010-11-07, 17:56
Sorry for bumping this thread but I have a problem:
When I enter "mount -t devpts dev/pts", it return error "mount: can't find dev/pts in /etc/fstab", I am a noob with chroot environments, what can I do for getting it working ?
Megaltariak
2010-11-23, 19:40
Any idea ?
Sorry for bumping this thread but I have a problem:
When I enter "mount -t devpts dev/pts", it return error "mount: can't find dev/pts in /etc/fstab", I am a noob with chroot environments, what can I do for getting it working ?
Try this:
# mount -t devpts devpts /dev/pts
Looks like you had a syntax error.
Megaltariak
2010-11-23, 19:52
Not the same error but still not working:
mount -t devpts devpts /dev/pts
mount: mounting devpts on /dev/pts failed: Device or resource busy
Edit: mount -t devpts devpts dev/pts
works when $PWD is the root of the chroot environment :)
Edit: another problem:
chroot ./
chroot: cannot execute /bin/bash: Exec format error
file bin/bash
bin/bash: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.8, dynamically linked (uses shared libs), stripped
mount|tail -n -4
none on /home/user/chroot/proc type proc (0)
devpts on /home/user/chroot/dev/pts type devpts (0)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (0)
/tmp/.X11-unix on /home/user/chroot/tmp/.X11-unix type bind (bind)
Megaltariak
2010-11-23, 20:44
The problem did not seem to be the chroot but the way that I use binfmt, it is strange because the commands
mount -t binfmt_misc none /proc/sys/fs/binfmt_misc
echo ':i386:M::\x7fELF\x01\x00\x00\x00\x00\x00\x00\x00\ x00\x00\x00\x00\x02\x00\x03:\xff\xff\xff\xff\xff\x fe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfb\xff \xff:/home/user/qemu-i386:' >/proc/sys/fs/binfmt_misc/register
did not return errors.
What could be wrong here ?
Edit: wait, the command
echo ':i386:M::\x7fELF\x01\x00\x00\x00\x00\x00\x00\x00\ x00\x00\x00\x00\x02\x00\x03:\xff\xff\xff\xff\xff\x fe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfb\xff \xff:/home/user/qemu-i386:' >/proc/sys/fs/binfmt_misc/register
don't prints on stderr but returns an error code of 1
strace says:
write(1, ":i386:M::\\x7fELF\\x01\\x00\\x00\\x00"..., 179) = -1 EINVAL (Invalid argument)
Megaltariak
2010-11-23, 23:38
Ok I got binfmt working by googling a bit about it and paste:echo ":qemu-i386:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x0 0\x00\x00\x00\x02\x00\x03\x00:\xff\xff\xff\xff\xff \xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfb\x ff\xff\xff:/home/user/qemu-i386:" > /proc/sys/fs/binfmt_misc/register
But now I have a problem with the chroot itself:
chroot ./
chroot: cannot execute /bin/bash: No such file or directory
file bin/bash
bin/bash: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.8, dynamically linked (uses shared libs), stripped
(On my PC):
ldd /media/00558657-94dd-411e-9a75-b5ad64e5e8dc/bin/bash
libncurses.so.5 => /lib/libncurses.so.5 (0x00848000)
libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0x00432000)
libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0x009dd000)
/lib/ld-linux.so.2 (0x0011a000)
ls -l lib/libncurses.so.5 lib/tls/i686/cmov/libdl.so.2 lib/tls/i686/cmov/libc.so.6
lrwxrwxrwx 1 root root 17 2010-11-07 18:06 lib/libncurses.so.5 -> libncurses.so.5.6
lrwxrwxrwx 1 root root 14 2010-11-07 18:06 lib/tls/i686/cmov/libc.so.6 -> libc-2.8.90.so
lrwxrwxrwx 1 root root 15 2010-11-07 18:06 lib/tls/i686/cmov/libdl.so.2 -> libdl-2.8.90.so
All theses symlinks are valid so it is not a library problem.
I can even chroot in this path with my PC with sshfs but not directly in my N900. (Only executables that use static library works on my N900)
TiagoTiago
2011-01-12, 13:33
As soon as you guys manage to get some GUI programs, or at least some famous closed source binaries, running could you please start posting Youtube vids and stuff and linking here?
Applesaws
2011-03-07, 01:39
I finally got binfmt to execute ld-linux.so.2 with qemu by using /x7fELF as the magic (instead of that whole long magic given in the tutorial) but now, it throws a no file or directory when I try chrooting (instead of an Exec format error). All the files exist, all the symlinks are valid, and executing bash outside of the chroot works. Anyone know why it's not working?
Nokia-N900:/.maewine# chroot .
chroot: cannot execute /bin/sh: No such file or directory
Nokia-N900:/.maewine# bin/sh
/lib/ld-linux.so.2: No such file or directory
Nokia-N900:/.maewine# file bin/sh
bin/sh: symbolic link to `bash'
Nokia-N900:/.maewine# file bin/bash
bin/bash: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.15, dynamically linked (uses shared libs), stripped
Nokia-N900:/.maewine# lib/ld-linux.so.2
Usage: ld.so [OPTION]... EXECUTABLE-FILE [ARGS-FOR-PROGRAM...]
<SNIP>
Nokia-N900:/.maewine# lib/ld-linux.so.2 --library-path lib bin/bash
Nokia-N900:/.maewine# ls
bash: fork: Invalid argument
Nokia-N900:/.maewine#
Just a quick question. How to run a native Linux i386 .bin app using qemu? I mean not windows so no wine is needed (I think).
Any 'You're a real noob' tutorial? Please?
# HOWTO:
# I've put hashes at the start of the line, so you could practically execute
# This file and expect it to work to a degree.
# bring up a terminal and from within /home/user (the default):
wget http://a.trap.me.uk/qemu-i386
chmod 755 ./qemu-i386
# test it works
./qemu-i386
# If this seems to output directions for use, this is working.
sudo gainroot
mount -t binfmt_misc none /proc/sys/fs/binfmt_misc
echo ':i386:M::\x7fELF\x01\x00\x00\x00\x00\x00\x00\x00\ x00\x00\x00\x00\x02\x00\x03:\xff\xff\xff\xff\xff\x fe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfb\xff \xff:/home/user/qemu-i386:' >/proc/sys/fs/binfmt_misc/register
# Your phone can now execute arbitrary statically linked x86 binaries
# or with some effort, (./ld-linux.so.2 --library-path `pwd` ./filename)
# any x86 linux binary.
# Set up the chroot with wine...
# I tarred up /etc /usr/lib /usr/X11/lib /usr/X11/bin /usr/bin /lib /bin /sbin
# from (it turns out) an old slackware 10.2 install that had had wine
# installed at some point in the past, ~version 0.9.14.
# extract the chroot in to /chroot (or wherever you want that has space)
# ... actually DON'T use rootfs space, but I'll use /chroot for ease of
# writing this.
# as root
cd /chroot
mkdir -p proc dev tmp/.X11-unix
chmod 777 tmp && chmod +t tmp
# I can't remember the octal for sticky in one go ;)
# copy the phone's /dev, something like:
tar cf blah.tar /dev && tar xf blah.tar
# by default tar strips the leading / so this probably works.
mount -o bind /tmp/.X11-unix tmp/.X11-unix
mount -t proc none proc
mount -t devpts dev/pts
vi etc/mtab etc/passwd
# ... edit to suit your needs. mtab should be small with mainly just /
# referenced, in passwd put a user:29999 account
# TEST full x86 chroot!!!
chroot /chroot
# You should see: bash-2.0# Or similar, and stuff like ls should work!
su - user
export DISPLAY=:0
/usr/X11/bin/xterm
# Oh I needed a symblink for X11 to X11R6 too, I also think I edited
# /etc/ld.so.conf to contain X libs, also I lack terminal definition files
# from that list of directories so I can't do some curses stuff.
# After your success running xterm as x86, which itself fork()ed bash
# again and showed a pretty impressive speed, you're 95% of the way
# there.
# Copy existing known .wine/ hierarchy ??? I think I happened to have
# one in /home/damion from where I nabbed the x86 chroot stuff.
# Then...
wine-pthread ./sol.exe
# Obviously you'll need sol.exe from XP or something and obviously you
# can use whatever wine stuff you need, not just sol :) You need
# wine-pthread, wine on its own segvs for me. I used to run wineserver
# 1st, but wine-pthread can successfully fork wineserver within this
# chroot without issue for me.
# Profit.
# I tarred up /etc /usr/lib /usr/X11/lib /usr/X11/bin /usr/bin /lib /bin /sbin
# from (it turns out) an old slackware 10.2 install that had had wine
# installed at some point in the past, ~version 0.9.14.
# extract the chroot in to /chroot (or wherever you want that has space)
# ... actually DON'T use rootfs space, but I'll use /chroot for ease of
# writing this.
I tar those from another system, then what? Where to I extract them? Whats the chroot? Where doesnt use rootfs space?
Nokia-N900:/opt/chroot# chroot . chroot: cannot execute /bin/sh: Exec format error
Anyone?
I'll run through my post again to confirm
Graham Cobb
2011-06-03, 12:09
Nokia-N900:/opt/chroot# chroot . chroot: cannot execute /bin/sh: Exec format error
Anyone?
That error tells you there is something wrong with the value you put in /proc/sys/fs/binfmt_misc/register.
I have not done this myself so I don't know if damion's instructions are correct but double check you did the mount command and the echo command correctly, and check that you actually have qemu-i386 at /home/user/qemu-i386 and it is executable.
Having just cut and pasted from the above include, I can see spaces where there shouldn't be any between the single quotes in that echo line. Make sure when that line runs you don't have spaces.
I can confirm that this qemu-i386 binary works on the n950.
pablocrossa
2011-07-18, 02:11
Sorry to revive this thread but im having the same problem as sanylcs, Megaltariak and Applesaws: Bash cannot fork.
Firstly I am using a chroot environment with sshfs from an ubuntu 10.04 box (mounting the directories mentioned by damion except the /usr/X11, as it is no longer placed there in modern debians).
I tried chrooting into the environment and i got the "cannot execute /bin/sh: No such file..." error.
I then tried manually invoking ld-linux.so.2 and i got a "syntax error: "(" unexpected..." error
I then tried loading bash from qemu directly (..qemu-i386 -L lib bin/bash), but i once again failed atrociously as it did not show any output (just the same happened when I ran ls)
After loading ../qemu lib/ld-linux.so.2 --library-path lib bin/bash bash runs but however cannot fork.
xterm cannot open because it cannot fork bash.
Basically I can run x86 executables as long as they do not fork. :(
I once did this a while back on the ps3 to run wine and had bash forking problems, however i cannot recall the fix i used. I believe because the kernel doesn't know it needs to run ld-linux.so.2 with qemu (even though i did the binfmt magic) every time it is called on a fork it fails, or maybe it is the executable and my n900 has different revision of hardware to damion's :confused: ?? I don't know, I am no big expert, just a linux lover :D . I would like to know if you devs and whatnot can guide me to getting the kernel to run ld-linux automatically with qemu to see if that is the problem. How do i add this ELF header to the binfmt?? Or any other suggestions??
Thank you for the time and keep the awesome work up :)
Pablo
Edit: By the way my old qemu thread for wine I cannot find however I found the one for PCSX2 on PS3 linux, no important data but just any possible reference/old idea I forgot/spark of though might appear here: http://forums.pcsx2.net/archive/index.php/thread-16970-1.html
Edit2: Actually I will also try a pre-nptl linux (i.e. slackware 10.2 I believe ;) I think it was still in the 2.4 realm), just in case that could be the problem, I will update with news :)
wow didn't know that this is actually possible on N900
great job guys
and @pablocrossa
i don't think that the hardware revision is the problem
maybe it is from chroot
try reinstalling it
apt-get install easy-chroot
or from bash it self
try to install bash3
apt-get install bash3
and make it your
default shell
by
bash-setup
NOTE : HAVEN'T TRY TO REVERSE TO THE DEFAULT N900 SHELL
hope it helps
pablocrossa
2011-07-18, 04:40
Ok now tried bash3 and bash4 (because 10.04 is bash4) and still the same error, checked I have the right folders mounted, I guess it is the chroot, preparing a new one from good ol' slack 10.2 :)
pablocrossa
2011-07-18, 09:13
ok my slackware 10.2 chroot gives me the same problem, I took all the spaces off the binfmt in the tutorial, corrected the dev/pts command and the rest I believe is pretty much the same, but I cannot fork. Can it be that I'm using power kernel?? I don't know what to think...
EDIT: I think I should blame the binfmt magic, I am pretty new to it, it does not load ld-linux.so.2 without calling qemu first, I need to find the elf header of it... hmm...
pablocrossa
2011-07-23, 12:38
Ok I believe I have found the problem but I cannot test it right now (I do not have a linux distro available for the next 2 days). I believe it is one of the two following. Either:
1. Binfmt is configured incorrectly so when the binary is going to fork the kernel cannot run the i386 binary and therefor fails, or
2. qemu-i386 binary should be placed within the chroot too, possibly the kernel tries running the x86 binary with /home/user/qemi-i386 from within the chroot, failing.
Could someone test this?? I do not currently have access to a linux box, I might be able to prepare a VM with virtualbox later, but I'm not sure.
Cheers
Nokia 5700
2011-07-24, 12:43
Tell me: how do you run this?
You do copy the qemu binary to the path in the chroot, I assume?
That's how I've done it on my desktop, and I've run both BASH and apt-get from a Maemo chroot.
Basically, this is all I do: mount it, copy the appropriate qemu to it's /usr/bin/, chroot into it. It has worked flawlessly unless it's been working with assemblies from some apps.
pablocrossa
2011-08-07, 20:39
@Nokia 5700
I copy the binary into the chroot, yes. I still fail, I think binfmt is the problem as I cannot run ./ld-linux.so.2 as it says 'syntax error, ")" unexpected" or something along those lines. I am stuck at this part, bash doesnt fork. I do not know how to proceed, some help with binfmt, I used it a while back on the PS3 but im stuck now. Help?!
EDIT: Maybe the statically compiled /usr/bin/qemu-i386-static could help??
Applesaws
2011-08-07, 20:52
@Damion,
Could you upload a tarball of your chroot? I don't think anyone else has managed to successfully chroot into theirs...
pablocrossa
2011-08-07, 21:05
@Damion,
Could you upload a tarball of your chroot? I don't think anyone else has managed to successfully chroot into theirs...
and also check the binfmt is correct, sorry for my persistence :)
pablocrossa
2011-08-24, 14:53
BTW my current wine does not have wine-pthread, I tried finding it with 'find' command but still nothing, does someone know if newer versions are missing this binary for simplicity or whatnot?? Thanks
does anyone know any good windows free games wine compatible and fast on a p90-p300 sort of range of machine?
any dos x86 game? try fallout since its turn-based and still has great support at nma forums
pablocrossa
2011-08-25, 12:55
Ok as in wine 1.1.17 they removed "old linux treading" or something similar I tried 1.1.16 and it had wine-pthread. I know 1.2 has no pthread and 1.1.28 doesnt either so I am pretty positive it dissapeared in update 1.1.17. I am now 'ldd -v'ing wine binary so that i copy all the libraries needed (checking if they are symlinks) to a folder and using the qemu binary with the -L option to run wineserver and then wine-pthread... wish me luck :)
orokusaki
2011-09-05, 09:18
This is very cool. I have been trying to get this going for about 2-3 days. I can run
qemu-i386 /chroot/lib/ld-linux.so.2 --library-path '/chroot/lib' /chroot/usr/bin/wine-pthread
Which gives me:
qemu: Unsupported syscall: 240
Usage: wine PROGRAM [ARGUMENTS...] Run the specified program
wine --help Display this help and exit
wine --version Output version information and exit
So it does run, if I change my library-path it doesnt get this far. So something is working.
But I cannot chroot. It says:
chroot /chroot
chroot: cannot run command `/bin/sh': No such file or directory
But /chroot/bin/sh is there.. and its the i386 version.
I have used qemu 0.15 compiled myself on my phone (took hours) and ubuntu 9.04 chroot...
I dont have a nokia phone, I have a motorola droid. So I have it chrooted for an ubuntu arm. Then in that enviroment, am I then running vncserver, and then export display=0:1 and then xterm and then try to run qemu-i386, but run i386 compiled apps in a folder called /chroot. I made an img file of /bin /lib, everything you took from slackware, I took from ubuntu 9.04.. stuck it in an image file and mount it with -o loop.
qemu-i386 /chroot/lib/ld-linux.so.2 --library-path '/chroot/lib' /chroot/usr/bin/wine-pthread /chroot/sol.exe
qemu: Unsupported syscall: 240
qemu: Unsupported syscall: 240
wine: fork : Invalid Argument
Even recompiled the kernel to get bin_fmtmisc
Applesaws
2011-09-05, 09:46
This is very cool. I have been trying to get this going for about 2-3 days. I can run
qemu-i386 /chroot/lib/ld-linux.so.2 --library-path '/chroot/lib' /chroot/usr/bin/wine-pthread
Which gives me:
qemu: Unsupported syscall: 240
Usage: wine PROGRAM [ARGUMENTS...] Run the specified program
wine --help Display this help and exit
wine --version Output version information and exit
So it does run, if I change my library-path it doesnt get this far. So something is working.
But I cannot chroot. It says:
chroot /chroot
chroot: cannot run command `/bin/sh': No such file or directory
But /chroot/bin/sh is there.. and its the i386 version.
I have used qemu 0.15 compiled myself on my phone (took hours) and ubuntu 9.04 chroot...
I dont have a nokia phone, I have a motorola droid. So I have it chrooted for an ubuntu arm. Then in that enviroment, am I then running vncserver, and then export display=0:1 and then xterm and then try to run qemu-i386, but run i386 compiled apps in a folder called /chroot. I made an img file of /bin /lib, everything you took from slackware, I took from ubuntu 9.04.. stuck it in an image file and mount it with -o loop.
qemu-i386 /chroot/lib/ld-linux.so.2 --library-path '/chroot/lib' /chroot/usr/bin/wine-pthread /chroot.sol.exe
qemu: Unsupported syscall: 240
qemu: Unsupported syscall: 240
wine: fork : Invalid Argument
Even recompiled the kernel to get bin_fmtmisc
The problem is that the kernel doesn't know to run x86 applications with qemu unless you tell it to with binfmt. And since wine-pthread doesn't know to fork things by calling qemu (the kernel is supposed to step in and do that if binfmt is configured correctly when it sees an x86 application), nothing works unless binfmt works. Unfortunately, AFAIK no one has been able to make the chroot work, most experiencing similar errors to yours, probably indicating that we all have problems with our chroots or our binfmt magic is configured incorrectly.
Damion, please come back and help us =(
orokusaki
2011-09-05, 14:33
See if this helps us.. I did a cat. I have been messing with the "interpreter".
root@localhost:/proc/sys/fs/binfmt_misc# cat i386
cat i386
enabled
interpreter /usr/bin/qemu-i386 /chroot/lib/ld-linux.so.2 --library-path /chroot/
lib
flags:
offset 0
magic 7f454c46010000000000000000000000020003
mask fffffffffffefefffffffffffffffffffbffff
------------------------------------------------------
I wish that one guy would run cat on i386 so we could compare.
orokusaki
2011-09-05, 14:41
root@localhost:/# update-binfmts --display
update-binfmts --display
cli (disabled):
package = mono-common
type = magic
offset = 0
magic = MZ
mask =
interpreter = /usr/bin/cli
detector = /usr/lib/cli/binfmt-detector-cli
python2.6 (disabled):
package = python2.6
type = magic
offset = 0
magic = \xd1\xf2\x0d\x0a
mask =
interpreter = /usr/bin/python2.6
detector =
orokusaki
2011-09-05, 15:05
Try with this patch today.
http://patchwork.ozlabs.org/patch/45206/
pablocrossa
2011-09-11, 19:59
Good to see some activity, just updating to say school started and I have not had time to work on the n900, i already have enough with a system I have to finish soon.
@orokusaki
I believe if you install busybox you get chroot, no need for ubuntu mobile, just in case you did not know this :)
and about the NPTL I also tried with Slack 10.4 (2.4 Pre-NPTL kernel) and it still failed with the forking error, the problem is probably the binfmt
EDIT2: According to this https://bugs.launchpad.net/qemu/+bug/739785 you are right, however that leaves me VERY confused with why slack 10.4 did not work with me?? :confused: I will patch, compile and test :)
Question to all, if you run bash with the ./qemu-i386 /chroot/ld-linux bladibla and place the qemu executable in /chroot/bin can you run it from the chroot?? because if you can then the problem would most probably be binfmt :D
Question 2: how do I find the magic of binary files?? This could help a lot to solve the binfmt issues (of course Damion and his chroot would help too ;) )
EDIT: Ok, I tested the first question and I got the forking error, still does not exclude binfmt
about the second question using the command 'file' reads the first bytes to find the magic and check it against a file in the HD if I understand correctly (/usr/share/file/magic), looking into it to find if the magic for i386 is correctly established.
On a sidenote, if I have time I will set up scratchbox and compile qemu-i386-static, which is actually made for chrooting (rather than qemu-i386 which is made for dynamically loading executables, orokusaki you might also want to look into this for your device ;) ) or find all the libraries wine requires and keep on testing, hope I get somewhere :)
orokusaki
2011-09-11, 23:16
Let it be known to the world, that I Justin Shafer got solitare to run on Wine today, with android and qemu-i386!
I think I know why we are having so many problems!
I am NOT creating a chroot for x86 to run wine and solitaire.
I DID create a /usr/gnemul/qemu-i386\usr and lib folders and copied X86 stuff into those folders.. then created a /usr/lib/wine folder and copied the X86 info into there.. THEN IT WORKED!
My binfmt is working fine I guess! :)
orokusaki
2011-09-11, 23:19
http://img714.imageshack.us/img714/5307/yaye.jpg
marovada
2011-09-12, 06:28
http://img714.imageshack.us/img714/5307/yaye.jpg
Wonderful. May we have a step by step guide and possibly a tar of the x86 files?
Many Thanks
orokusaki
2011-09-12, 07:55
Wonderful. May we have a step by step guide and possibly a tar of the x86 files?
Many Thanks
I am going to post my ubuntu.img on the internet. I no longer need the slackware folder (chroot folder).
you will need to steal the /usr/lib/wine and put it in yours.
the /root/.wine folder and put it in your user home folder (mines root)
the /usr/gnemul folder copy to your /usr so you end up with /usr/gnemul (this is where most of the slackware files are)
and copy /usr/bin/qemu-i386 to your /usr/bin
and copy /usr/bin/wine* to your /usr/bin
and that should be it
chmod 755 /usr/bin/wine*
this is what I have for ubuntu. not sure the maemo layout.
then to run it
export DISPLAY=0:1 is what I have to use. I have a droid. Go to page 5 and look at that dudes instructions.
/usr/bin/qemu-i386 /usr/bin/wineserver
ps -ef (verify wineserver is running)
/usr/bin/qemu-i386 /usr/bin/wine sol.exe (sol.exe is located at /root/.wine/dosdevices/c:/windows/sol.exe, and wine will find it automatically like path=c:\windows)
this does NOT require binfmt.
it does require loop to mount the image. The reason its an image is the sdcard is fat, and stuff wont run on fat, hence the ext2 image file, but to mount it the kernel needs loop. mount -o loop blah blah blah........
to verify your kernels features run zcat /proc/config.gz < /path/.config at least for android.
I will post the ubuntu.img file soon.
HEY WAIT! I forgot.. I dont have your phone. How much space do you guys have and all that. sdcard wise?
The major thing is that qemu-i386 is looking to these folders for x86 library files. (.so and .so2 files)
/usr/gnemul/qemu-i386/usr
/usr/gnemul/qemu-i386/lib
/usr/gnemul/qemu-i386/etc (mine is empty)
If wine needs a library, qemu will look for it in those folders. And those folders are the ones needed from slackware. I stole /lib /usr/lib /usr/X11R6/bin /usr/X11R6/lib and put those files in the corresponding /usr/gnemul/qemu-i386/usr lib etc folders.. get it?
If it was sparc cpu instead of i386 then qemu would look for libaries in:
/usr/gnemul/qemu-sparc/lib
/usr/gnemul/qemu-sparc/etc
/usr/gnemul/qemu-sparc/usr
orokusaki
2011-09-12, 12:10
http://thepiratebay.org/torrent/6670616
Here is a torrent for now.
pablocrossa
2011-09-12, 13:20
We have 32gb so we are fine :)
On a sidenote I will create a deb for the general public :) wish me luck again people
orokusaki
2011-09-12, 13:21
Let me know if its not seeding! For the record I gave up on chrooting into another chroot..
It is my hope that you guys can run it without needing to chroot, I think you can. And I think davison guy was doing that at one time since he said he was running wineserver (which means he wasnt always using binfmt).
Its all in creating the /usr/gnemul folder and creating the qemu-i386 folder inside of that, and then creating etc lib and usr inside of that. Then start copying the x86 libraries into those folders. Like lib and /usr/lib.. soon as I did that the errors changed with wine
Thats what were missing.
Its about the -L switch in qemu-i386 -L
orokusaki
2011-09-12, 14:32
http://thepiratebay.org/torrent/6670616
new torrent file! vncpassword is thoughtp
marovada
2011-09-13, 00:27
http://thepiratebay.org/torrent/6670616
new torrent file! vncpassword is thoughtp
Thanks - but the file is saying 'not found'
orokusaki
2011-09-13, 02:16
http://www.onsitedentalsystems.com/ubuntu.rar
orokusaki
2011-09-13, 04:37
http://www.youtube.com/watch?v=A-G1pa4zUEE
pablocrossa
2011-09-13, 18:04
After 3 hours downloading it (my bad internet :) ) it says it is not a bz2 file. Please tell me you renamed the extension wrong :(
Edit: Not even the file command can figure out what it is and its not .tar.gz either, I will redownload :(
pablocrossa
2011-09-13, 18:36
Right now I am compiling qemu-i386 from 0.14.1 with the patch for NPTL and maybe that will also fix the problem (I have time while the rar downloads). Lets get going :)
pablocrossa
2011-09-13, 20:26
Redownloaded from a more reliable AP and still having problems with the format of the file, I even tried winrar & 7zip, still not working... can you please reupload it as I am pretty confident the file is corrupt :) thank you so very much :D
orokusaki
2011-09-13, 21:58
I compiled 0.15 with NPTL patch and it didnt matter. What mattered is we were all doing something wrong.
Use tar to extract the bz2 file. But I realized I made a wine.gz and it has everything you need.
As I used it to get it working on my HP Touchpad last night. I will reupload it and will help you.
=)
orokusaki
2011-09-13, 22:01
Okay http://www.onsitedentalsystems.com/wine.tar.gz
Its 180MB. =) Everything you need.
orokusaki
2011-09-13, 22:05
what to do with wine.tar.gz
Move everything from bin into your /usr/bin
Move gnemul to your /usr
Move wine folder to your /usr/lib so you have /usr/lib/wine
mkdir /user/.wine
unzip wine.zip /user/.wine
fix dosdevices.
cd /user/.wine/dosdevices
ln -s ../c_drive c:
*when I say fix dosdevices make it to where this is a valid path
/root/.wine/dosdevices/c:/windows get it?
*my user is root so mkdir /root/.wine
then run
/usr/bin/qemu-i386 /usr/bin/wineserver
/usr/bin/qemu-i386 /usr/bin/wine-pthread notepad.exe
See what happens.. what errors you get.
Dont forget the files you copy into /usr/bin must be executable
chmod 755 wine*
Dont forget you may need to export display
Have you tried tar to extract that bz2? Just curious...
pablocrossa
2011-09-13, 22:15
tar did not work. I have an idea what to do with wine executable and libraries, thank you for all :) I will post a vid too when I get it to run. I will attach my executable by request anyways just in case it is needed for us n900 mortals.
I will get back to you ASAP :D till then
orokusaki
2011-09-13, 23:06
tar did not work. I have an idea what to do with wine executable and libraries, thank you for all :) I will post a vid too when I get it to run. I will attach my executable by request anyways just in case it is needed for us n900 mortals.
I will get back to you ASAP :D till then
What! wine.tar.gz? I extracted it and everything... it does work. Same with my tar.bz2... ???
Are you using tar to extract? Or winrar?
orokusaki
2011-09-13, 23:08
Be sure you have good ram! =) Last time I spent time figuring out why a large archive would not decompress.. Then SP3 wouldnt install.
orokusaki
2011-09-13, 23:15
You will know wine is happy when it stops asking for libraries.. it will gripe about missing files or it cant find a file with .so in it or .so2
What is your error? You could always install vmware and download slackware 10.2 and install wine then create your archive...
Next I was going to recompile with that qemu 0.15 patch. I had it but I deleted it because it didnt work, but that was before creating the gemu folder.
Run qemu-i386 and look at the L switch and you see its looking for ELF interpreter and the default path is /usr/gnemul
pablocrossa
2011-09-13, 23:36
sorry i meant tar didnt work with the ubuntu.tar.bz2 :)
pablocrossa
2011-09-13, 23:37
even with the right parameters for .tar.bz2 .tar.gz or .tar
pablocrossa
2011-09-13, 23:53
and it works!! notepad opened successfully, kudos to you and now I will make a deb for the comunity :) I didnt shove gnemul to usr as it uses rootfs space, I just used -L bladibla and got it going. of course with now I mean tomorrow because it is late :D
pablocrossa
2011-09-14, 18:34
just as a note I am also compiling newer qemu with NTPL patch which will hopefully allow newer wine :)
Applesaws
2011-09-15, 06:58
orokusaki, we're forever in your debt. It works perfectly (besides complaining that it can't find dosdevices in cwd) for notepad, solitaire, and minesweeper. Now to try some games.
orokusaki
2011-09-18, 03:17
Yay! Thats great guys! Very cool indeed! :) I would have not gotten this far myself, without that damion guy.
just as a note I am also compiling newer qemu with NTPL patch which will hopefully allow newer wine :)
Any progress? Would love to try it on a couple of things.
orokusaki
2011-09-18, 12:05
Guys it doesnt take too long. I already had it compiled but I couldnt get it working because I didnt have /usr/gnemul..
Let me see if I still have it =)
Its very easy to compile if you use your phone to compile it. 0.15 with that patch. Then we will need newer x86 binaries that are nptl in /usr/gnemul.
orokusaki
2011-09-18, 15:17
Well I compiled with the patch but it still wont run Wine all the way.
I used Ubuntu 9.10 library files with wine and moved it over.
When I execute wine-pthread it does run, but it has problems forking.???
I can run qemu-i386 /pathtox86/lib/ld-linux.so.2 and it will run instead of crash with the patch. So the patch is working, it just cant run wine????
I will try one more thing.. moving this to my phone that has binfmt support (my hp touchpad doesnot)
http://www.onsitedentalsystems.com/wine_nptl.tar.gz if you want to try.
Mostly interested in running some x86 linux binaries of roguelikes, hoping newer qemu version will be less segfaulty.
My phone shutdown when trying to compile it on it around i386-softmmu/translate.o, not sure if not enough memory or faulty setup.
I assume qemu-i386 in your archive is 0.15? Thanks btw
orokusaki
2011-09-18, 18:19
Mostly interested in running some x86 linux binaries of roguelikes, hoping newer qemu version will be less segfaulty.
My phone shutdown when trying to compile it on it around i386-softmmu/translate.o, not sure if not enough memory or faulty setup.
I assume qemu-i386 in your archive is 0.15? Thanks btw
I am recompiling.. I compiled on my touchpad that had glibc 2.11 which is higher then my ubuntu chroot on my phone.
to compile on phone turn on swap! I gave it 1 gb. retry make on the 3 time it will get past that one file.
Yeah, it cries glibc missing. Sadly the binary from i386-softmmu after compiling dies with 'illegal instruction'. Trying to swap it for the one I had from 009N gives: qemu: --library-path: invalid option
orokusaki
2011-09-18, 19:43
Still getting Unsupportive syscall: 240
I recompiled with my phone with the older glibc and still not happy. It should be doing syscall 254 if its working?
How do you get it to compile? (--disable-kvm and configuring for target linux-user says missing endif in makefile)
orokusaki
2011-09-18, 22:34
I know what I did wrong. We need to install apt-get install libsdl-1.2dev
./configure --targer-list=i386-linux-user --enable-sdl --enable-nptl
=) working on that
orokusaki
2011-09-18, 22:36
I forgot about that when I was compiling last time libsdl1.2-dev
orokusaki
2011-09-19, 03:37
the latest source in git has nptl has an option for configure without a patch! compiling...
You wouldn't happen to care about also compiling a Maemo 4 build would you? :)
orokusaki: any chance for you to up 0.15 user mode binary that is glibc2.0 compatible? I cannot seem to compile it (makefile error sounds like too old autoconf/configure especially as ./configure -M cries unknown option) and it might work with some binaries that 0.12.2 that is available out there segfaults. Thanks in advance.
orokusaki
2011-09-20, 00:35
www.onsitedentalsystems.comm/qemu-i386
orokusaki
2011-09-22, 13:53
Here is qemu-i386... Its 0.14.1 and its faster then the one we are using. We dont get artifacts in solitaire anymore.
http://www.onsitedentalsystems.com/qemu-i386-141n
n means it has the nptl patch.. but still this will only work on posix wine.
Cant get 0.15 to run posix wine.
The previous one gives:
./qemu-i386: /lib/libc.so.6: version `GLIBC_2.10' not found (required by ./qemu-i386)
./qemu-i386: /lib/libc.so.6: version `GLIBC_2.8' not found (required by ./qemu-i386)
./qemu-i386: /lib/libc.so.6: version `GLIBC_2.6' not found (required by ./qemu-i386)
./qemu-i386: /lib/libc.so.6: version `GLIBC_2.9' not found (required by ./qemu-i386)
Will try 14.1 maybe this will work.
EDIT: this one segfaults :(
calamari
2011-09-22, 19:11
I've been wanting to run an x86 binary on my Sprint Epic 4G under Android (sorry, I didn't get the N900, although I really considered it). Anyways, I was running into the same fork problems you guys were having. I asked in the qemu IRC support channel and was referred to this bug:
https://bugs.launchpad.net/qemu/+bug/739785
The relevant comments for a fix are #32 and #34.
I put the patch in a file called nptl-patch, and I extracted qemu and went to the qemu-0.14.1 directory.
# First, I needed more ram to compile translate.c, so I created and mounted a 384MB swap file on my sd card (I'm sure all your paths and such are different, but you can translate):
dd if=/dev/zero of=/sdcard/swap.img count=786432
mkswap /sdcard/swap.img
swapon /sdcard/swap.img
# don't forget to swapoff later when you're done with it!
# apply the patch
patch -p1 < nptl-patch
# configure and build
# note: I had to install a few packages in order to be able to run configure, but I forget what they were now, they were obvious based on the errors tho
./configure --static --target-list=i386-linux-user
make
make install
# I had a debian debootstrap --foreign install in /i386:
cp /usr/local/bin/qemu-i386 /i386/usr/bin
chroot /i386
And "ls" worked :D I proceeded to /deboostrap/debootstrap --second-stage, etc.
I don't know if this is useful or not for wine, but I wanted to share it regardless as another potential avenue for you guys. Good luck!
Is there >=12.2 out there? All I get is glibc problems or segfaults. No luck yet compiling it myself, but as aapo now got new make and autoconf (and gcc in the end) this should be doable at least.Thanks for trying though
orokusaki
2011-09-22, 22:42
12.2 is on page 5. Under damion's unstructions. I am running Android 2.3.. actualyl cyanogenmod7 chrooted with ubuntu9.10 and gcc 4.1 with glib 2.10. But I can move that over to my touchpad running ubuntu 11.04 chroot just fine.
That one I uploaded should work, but who knows.. I dont have your phones.. (14.1)
I am compiling with ./configure --static --target-list=i386-linux-user
orokusaki
2011-09-22, 22:44
Are you guys using files from slackware 10.2? Thats where I got mine with that wine.tar.gz... came from slackeware 10.2.. also check to be sure you DONT have /usr/local/bin/qemu-i386 and /usr/bin/qemu-i386.
WE don't. you're on wrong forum. Compiling/porting to android x.x should be on its forum. As you have problems providing any useful binary, try android forums, they might appreciate your work. Your building efforts are missed here.
orokusaki
2011-09-22, 23:16
szopin your being rather rude. Go **** off. Your of zero help. Not my fault you cant compile your own damn binary. Have you installed your swap file?? :)
Maeme and Android is still running Linux, and if you had a brain you would realize I chrooted into Ubuntu. Dummy.
Oh and lastly, are you using slackware 10.2 library files like the rest of us? From damians advice on page 5???? I followed his advice and got things going for me, regardless of him being on maemo.
"Mine being rude" has nothing to do with your lack of grammar. You also mentioned compiling on the phone, which obviously isn't the case, go starstarstarstar yourself, and mark your binary excrements as android compatible. Thank you.
EDIT: of course its not your damn fault you can't build an executable (or library) for maemo, why would you post in here then? to say android got solitaire without visual artifacts? good for you, change nano to notepad then.
orokusaki
2011-09-23, 00:17
My lack of grammar has nothing to do with your inability to even follow Damians directions. And just because your not happy, doesnt speak for other people who are glad that I posted slackware 10.2 libraries and binaries from posix and posted about /usr/gnemul.
It helped pablo.
Thanks! I misjudged you. Sorry
orokusaki
2011-09-23, 00:21
Its cool! None of the android guys really seem to care either.. I posted it over there and well, you guys just seem to care about getting wine going with qemu more then any place on the net. =)
I don't, like I mentioned I'm more into 386 linux binaries that very often run with 0.12.2 and was hoping more would with 14 or 15.
orokusaki
2011-09-23, 00:25
are you guys running qemu like this without a chroot for test?
./qemu-i386 /usr/bin/wineserver
./qemu-i386 /usr/bin/wine-pthread notepad.exe
with /usr/gnemul/qemu-i386/lib/ with posix libs from slackware?
same with /usr/gnemul/qemu-i386/usr/lib
and /usr/lib/wine
all with poxis stuff? Maybe thats why its griping about glib differences because were using different ELF interpreters.
X86 of course.. just posix x86 instead of ntpl x86.
one cries glibc missing, the other segfaults at start, what version of make/autoconf do you have? aapo is bringing some goodies in this matter to life
orokusaki
2011-09-23, 00:34
try running this...
strace -ff -o /test.log /usr/bin/qemu-i386 blah blah blah. just for fun.. it helped me once. Advice from the qemu launchpad.
gcc 4.4.1
make 3.81-6
pkg-config 0.22 ????
I loaded synaptic and surprising I have that checked and automake and autoconf unchecked...
PS. I remember sefaulting because it didnt like my ld.linux.so2.. try using the ld.linux.so2 thats supposed to be /usr/gnemul/qemu-i386/lib from my wine.tar.gz .. be sure to extract the tar in ext2/3 and not fat or it wont recreate the symlinks.. like I did. =)
I can reproduce it. It sefaulted for me on nptl ld.linux.so2 even with my nptl patch. Though I got it working eventually.. not nptl wine, but the nptl version of ld-linux.so2.. though ubuntu 11.04 segfaults for me no matter what..
orokusaki
2011-09-23, 00:40
what to do with wine.tar.gz www.onsitedentalsystems.com/wine.tar.gz
Move everything from bin into your /usr/bin (careful I have old qemu-i386 in there so maybe mv wine* /usr/bin)
Move gnemul to your /usr
Move wine folder to your /usr/lib so you have /usr/lib/wine
mkdir /user/.wine
unzip wine.zip /user/.wine
fix dosdevices.
cd /user/.wine/dosdevices
ln -s ../c_drive c:
*when I say fix dosdevices make it to where this is a valid path
/root/.wine/dosdevices/c:/windows get it?
*my user is root so mkdir /root/.wine
then run
/usr/bin/qemu-i386 /usr/bin/wineserver
/usr/bin/qemu-i386 /usr/bin/wine-pthread notepad.exe
See what happens.. what errors you get.
are you guys running qemu like this without a chroot for test?
./qemu-i386 /usr/bin/wineserver
./qemu-i386 /usr/bin/wine-pthread notepad.exe
with /usr/gnemul/qemu-i386/lib/ with posix libs from slackware?
same with /usr/gnemul/qemu-i386/usr/lib
and /usr/lib/wine
all with poxis stuff? Maybe thats why its griping about glib differences because were using different ELF interpreters.
X86 of course.. just posix x86 instead of ntpl x86.
chroot and suders and many other packages, first time I find a package that needs its own install/maintenance. None of your solutions work. Really sorry. Last binary was unrecognized by most, Midnght Commander indicated it as ELF 32 bit and then shut down. Are you sure these are armel builds?
orokusaki
2011-09-23, 00:42
I compiled it on my droid trust me its arm. Then copied it too my hp touchpad running webos and setup ubuntu chroot. Ran there too on a snapdragon.. so compiled on my droid a8 and moved to a qualcomm snapdragon....
I couldnt get a good cross-compile going so I gave up. First time I compiled without the --target-list and compiled all the processors.. Took HOURS. lol armv4l
orokusaki
2011-09-23, 00:58
I did find a post where a guy had to echo 2 < /proc/cpu/alignment or something for arm5, but I figure our phones have arm7 instruction sets..
https://bugs.launchpad.net/qemu/+bug/739785
My goal was to compile a posix version of wine that was the same version as Damions and mine is his exact version of slackware and wine. For some reason I could get 0.12.5 working because I was using --enable-sdl but wine wont work for me past 0.12.5 with sdl turned on, and the author made sure to tell me that I dont need it. So --disable-sdl or just be sure it says no for SDL after you compile.. But I never got segfaults only a hang. I segfaulted when armel compiled qemu-i386 didnt like my x86 nptl ld-linux.so2 from ubuntu 11.04 but could run x86 nptl ld-linux.so2 from 9.10.. and lower.
You know its going to work when you see unsuported syscall 254 instead of 240. Thats what I know for sure.. For the posix wine. I figure we need posix wine working on 15.5 before worrying about a newer nptl version of wine...
orokusaki
2011-09-23, 07:15
Something sort of interesting. I get the same fork problems running qemu-i386 and wine when BOTH have been compiled for X86.. Something tells me if X86 cant pull it off, Arm isnt going to either. This is when trying to run nptl wine 1.0.1
pablocrossa
2011-09-24, 11:33
@orokusaki
Sorry, ive been up with my IB crap again, its never over in Y13 with extended assays and wierd stuff :)
Back on topic your site is down, it says account suspended :S otherwise i would start testing the binaries asap :)
NPTL sounds like a no-go unfortunately, people have been battling with qemu and nptl for a while now... its great that you ran ld-linux with nptl, we need to continue investigating that (and when i say we it seems like i mean you on this forum :P )
PLEASE send me the binaries somehow :) thx
http://www.megaupload.com/?d=OXTTU2VM
pablocrossa
2011-09-26, 19:00
@szopin
downloading, that wine tarball includes the new qemu binaries right??
orokusaki
2011-09-29, 12:33
Yeah.. =) I think I should start saying that its linuxthreads wine instead of posix.
I tried to compile up to 0.9.64 so we could specify the resolution before running the application/game. But it wouldnt work, on arm, only on x86, and it wanted the nptl/posix version of glibc instead of the linuxthreads version. Does that sound more accurate? :)
If qemu were multithreaded then maybe we could do wine-pthreads explorer /desktop:1024x768 sol.exe, you will get a windows with a green background that is 1024x768, and a cursor, but no solitaire on arm. I do get solitaire on x86. And I think thats because of qemu not being "multi-threaded".
pablocrossa
2011-10-07, 20:10
Yeah.. =) I think I should start saying that its linuxthreads wine instead of posix.
I tried to compile up to 0.9.64 so we could specify the resolution before running the application/game. But it wouldnt work, on arm, only on x86, and it wanted the nptl/posix version of glibc instead of the linuxthreads version. Does that sound more accurate? :)
If qemu were multithreaded then maybe we could do wine-pthreads explorer /desktop:1024x768 sol.exe, you will get a windows with a green background that is 1024x768, and a cursor, but no solitaire on arm. I do get solitaire on x86. And I think thats because of qemu not being "multi-threaded".
Great, good to hear news :) well, qemu will stay as it is for pretty much a long while so we can only stick with the old linuxthreads versions. I agree with you on the multithreads but i might compile a program to execute another exe file just to check, depends on the time i have :)
to run the desktop you could specify that on the winecfg as it allows that configuration if you really wanted that, but if it was an example understood :) great stuff
and i will try making a deb but currently i also need to finish a big php project for monday so i might have time but im not sure :)
till then
pablocrossa
2011-10-07, 20:13
Great, good to hear news :) well, qemu will stay as it is for pretty much a long while so we can only stick with the old linuxthreads versions. I agree with you on the multithreads but i might compile a program to execute another exe file just to check, depends on the time i have :)
to run the desktop you could specify that on the winecfg as it allows that configuration if you really wanted that, but if it was an example understood :) great stuff
and i will try making a deb but currently i also need to finish a big php project for monday so i might have time but im not sure :)
till then
of course if we can get nptl then we are golden and have achieved the maximum goal (newer linux apps running) but i dont see this happening, we will have to stick with the slower linuxthreads.
what to do with wine.tar.gz www.onsitedentalsystems.com/wine.tar.gz
Move everything from bin into your /usr/bin (careful I have old qemu-i386 in there so maybe mv wine* /usr/bin)
Move gnemul to your /usr
Move wine folder to your /usr/lib so you have /usr/lib/wine
mkdir /user/.wine
unzip wine.zip /user/.wine
fix dosdevices.
cd /user/.wine/dosdevices
ln -s ../c_drive c:
*when I say fix dosdevices make it to where this is a valid path
/root/.wine/dosdevices/c:/windows get it?
*my user is root so mkdir /root/.wine
then run
/usr/bin/qemu-i386 /usr/bin/wineserver
/usr/bin/qemu-i386 /usr/bin/wine-pthread notepad.exe
See what happens.. what errors you get.
Hi, Friends
I followed the instruction.,but I get an error : illegal Instruction.
What's wrong?
(My toys Samsung gio 800 mhz with ubuntu)
Another problem
I downloaded this http://www.onsitedentalsystems.com/ubuntu.rar
In the package there is the ubuntu.tar.bz2 image file.
How exctract this? I get an error with tar
thank you
pablocrossa
2011-10-08, 15:51
Hi, Friends
I followed the instruction.,but I get an error : illegal Instruction.
What's wrong?
(My toys Samsung gio 800 mhz with ubuntu)
Another problem
I downloaded this http://www.onsitedentalsystems.com/ubuntu.rar
In the package there is the ubuntu.tar.bz2 image file.
How exctract this? I get an error with tar
thank you
I seem to recall that ubuntu image was the one i was blaming corrupt, try downloading exclusively wine.tar.gz
as of your illegal instruction that seems to be because that executable isn't compiled properly for your device, have you tried running qemu alone?? if it gives instructions for use then the problem should be elsewhere :)
I seem to recall that ubuntu image was the one i was blaming corrupt, try downloading exclusively wine.tar.gz
as of your illegal instruction that seems to be because that executable isn't compiled properly for your device, have you tried running qemu alone?? if it gives instructions for use then the problem should be elsewhere :)
Yes Qemu along give parameters. This Qemu and Wine are from , that you say: wine.tar.gz
But when I try to run with wineserver:
./qemu-i386 /usr/bin/wineserver
Get: illegal instruction:)
Could you try to upload a working ubuntu.img that has qemu and wine?
pablocrossa
2011-10-09, 11:21
Yes Qemu along give parameters. This Qemu and Wine are from , that you say: wine.tar.gz
But when I try to run with wineserver:
./qemu-i386 /usr/bin/wineserver
Get: illegal instruction:)
Could you try to upload a working ubuntu.img that has qemu and wine?
I do not have that image but are you sure you have the libraries in the right directory and that all binaries are working?? It should work, I have it running, did you create the .wine folder?? I am not sure what the problem is, it seems as though it is running a non native binary, not sure :)
I do not have that image but are you sure you have the libraries in the right directory and that all binaries are working?? It should work, I have it running, did you create the .wine folder?? I am not sure what the problem is, it seems as though it is running a non native binary, not sure :)
Hi , dear Friend:)!
Directories are:
/usr/gnemul/qemu-i386/lib
/usr/gnemul/qemu-i386/etc
/usr/gnemul/qemu-i386/bin
/usr/lib/wine
/usr/bin/wine bin files
/usr/bin/qemu bin files
I am root in the system and I use this
/root/.wine
What is the right structure of directories?
pablocrossa
2011-10-09, 14:30
Hi , dear Friend:)!
Directories are:
/usr/gnemul/qemu-i386/lib
/usr/gnemul/qemu-i386/etc
/usr/gnemul/qemu-i386/bin
/usr/lib/wine
/usr/bin/wine bin files
/usr/bin/qemu bin files
I am root in the system and I use this
/root/.wine
What is the right structure of directories?
i THINK it is right, try running it with -L /usr/gnemul/qemu-i386 (i.e. qemu-i386 -L baldibla).
i THINK it is right, try running it with -L /usr/gnemul/qemu-i386 (i.e. qemu-i386 -L baldibla).
Hi Friend!
I tiredit. Illegal instruction,
I forget, that, when exctract wine.tar.gz I get an error
gzip -dc wine.tar.gz | tar xf -
tar: wine/gnemul/qemu-i386/usr/x116/lib/fonts: Cannot create symlink to X11/fonts File exists
This could make problem?
pablocrossa
2011-10-11, 23:21
Hi Friend!
I tiredit. Illegal instruction,
I forget, that, when exctract wine.tar.gz I get an error
gzip -dc wine.tar.gz | tar xf -
tar: wine/gnemul/qemu-i386/usr/x116/lib/fonts: Cannot create symlink to X11/fonts File exists
This could make problem?
No, I had that problem too, it is only a fonts problem :)
The only thing I can think of is your libraries are incompatible with that qemu binary, otherwise I am stuck, if you know what you are doing you should try compiling qemu yourself :)
I am totally stuck about your problem right now, you're running as root, you have the folders, the binary outputs instructions... :confused:
EDIT: Maybe something missing in your kernel?
No, I had that problem too, it is only a fonts problem :)
The only thing I can think of is your libraries are incompatible with that qemu binary, otherwise I am stuck, if you know what you are doing you should try compiling qemu yourself :)
I am totally stuck about your problem right now, you're running as root, you have the folders, the binary outputs instructions... :confused:
EDIT: Maybe something missing in your kernel?
Yes, you think well, I am root.
what could missing from the kernel:)? How could I compile Qemu from sources, what's the steps?
Illegal instruction is there as this is not N900/maemo build but android based ubuntu chrooted one. Unlikely it can be run. Qemu versions 12.2+ only compile partially (qemu-i386 part throws a lot of errors, no idea if this can be fixed)
majaczek
2011-10-27, 11:47
hey there are wine for n900 (arm) package and qemu-kvm hidden package (it has no category), could those be maked to work together.
i mean using native wine with help of qemu to understand x86.
is there any way to make simple package dependent on those two to make them work together? perhaps some symlinks and some scripts will be enough.
Relevant:
http://www.youtube.com/watch?v=bVYlrv0kbdA
jels108710
2011-12-03, 04:39
Hi Friends
I have followed this post for several days. And I follow orokusaki's method. I use HD2 and Android. I also run ubuntu 9.10 on my hd2.
I use the wine package on this post. But when I run
/usr/bin/qemu-i386 /usr/bin/wineserver
It returns error below
qemu: Unsupported syscall: 254
Any one can give me some suggestion? And How to deal with this error?
Thank you very much
Best
jels108710
2011-12-03, 05:15
Hi Friend
I did it. It's my mistake on some operation. Thank you very much!
Best
what to do with wine.tar.gz www.onsitedentalsystems.com/wine.tar.gz
Hi.
Thanks for the tarball.
It works quite well for me as well.
Do you mind telling us how you built this wine? Is there any special options that has to be enabled or disabled? Or is it just a simple ./configure && make?
Also, any special patches needed? And is that a straight x86 build?
And what about versions of wine? The version from you is 0.9.14. I'm interested in trying a different version of wine too.
Thanks!
FWIW, I've successfully built my own wine, using 0.9.14 source. Plain x86 native build, and managed to run it with the qemu-i386 you provided.
The only extra bit is I had to update my libs (things like X libs, gtk, etc) from my build tree
Got a question regarding wine versions.
While 0.9.14 kinda works, it's pretty old. I tried using newer versions, but they don't split the binaries into wine and wine-pthread anymore. Looking at the changelog, the default should be using pthread, but then when I try to run it, it seems to behave like the "wine" binary of 0.9.14, which doesn't run at all.
Perhaps I haven't been following this thread completely, was there a reason why only wine-pthread works, but not wine?
Thanks.
(Am I the only one still playing with i386 + wine now?)
pablocrossa
2012-03-05, 18:04
Got a question regarding wine versions.
While 0.9.14 kinda works, it's pretty old. I tried using newer versions, but they don't split the binaries into wine and wine-pthread anymore. Looking at the changelog, the default should be using pthread, but then when I try to run it, it seems to behave like the "wine" binary of 0.9.14, which doesn't run at all.
Perhaps I haven't been following this thread completely, was there a reason why only wine-pthread works, but not wine?
Thanks.
(Am I the only one still playing with i386 + wine now?)
You probably are buddy :) This is pretty old :D I still play with it each time in a while but no too much.
If I am not wrong a newer version of wine requires NPTL which doesnt work with qemu (it apparently does with newer versions such as 1.0 or 1.0.1 of qemu where you can force it in the configuration but they dont compile good with the old C compiler/library, havn't looked into it much though, if you compile tell me). Take into account the new wine executable has the wine-pthread shoved into it so running an old wine-pthread is like running an old wine executable which with newer libraries might go all crazy on you.
wine executable is a whole loader that has a way of launching the other apps that qemu doesn't like (just as wine-pthread will not launch wineserver wine will not launch the other). Of course i am no expert at this, just thought it might help :) .
If one digs into the wine-pthread code of wine 1.0.18 or 17 (the last version with wine-pthread) and the new wine they might be able to recode it so that launching it with a new parameter (such as --do-pthread or something shorter) it acts as an old wine-pthread but with new features. I am just speculating as I have not looked into the code of any.
So basically if you compile a newer version of qemu against the old N900 glibc then newer wine and the wine command might work, if not one needs to edit the source of the wine executable to get it to work. Does this make any sense or have I made it more confusing?? :D
ivgalvez
2012-03-05, 18:29
Relevant:
http://www.youtube.com/watch?v=bVYlrv0kbdA
Well that video is indeed very interesting and promising. Is there any more information of such a project anywhere else?
pablocrossa
2012-03-05, 19:27
Well that video is indeed very interesting and promising. Is there any more information of such a project anywhere else?
I am mailing them, probably a newer or patched QEMU, that's all :)
ivgalvez
2012-03-06, 08:35
I am mailing them, probably a newer or patched QEMU, that's all :)
I would say it's not the same, it says to be using binary translation, which means that the x86 binary has been converted to ARMv7 code previously and thus, execution speed is much higher.
pablocrossa
2012-03-06, 08:49
I would say it's not the same, it says to be using binary translation, which means that the x86 binary has been converted to ARMv7 code previously and thus, execution speed is much higher.
I believe Wine for ARM is available on the repositories and is not something new, I believed they were running real x86 apps without conversion or recompilation or whatnot. If I am mistaken then if they use some cool binary translation then, if it works, it would give higher speeds than the QEMU patchy hack we use :)
orokusaki
2012-10-10, 00:28
Hey guys.. I got an email from One Laptop For a Child over this and told them to go here!
We actually did help someone! :)
orokusaki
2012-10-10, 04:11
Works on my droid 4. Just ran notepad... Droid 4 has binfmt compiled into the kernel... unlike cyanogenmod 7 and the droid1... I had to compile that in...
The HP Touchpad did not have binfmt_support..
If you do not have binfmt support and binfmt in the kernel, you will have to run wineserver first, then wine-pthread, every time you run an app.
If you do have binfmt, then you can do the directions on page5 and and echo and registry qemu and then you can run wine-pthread every time you run an app without having to run wineserver first.
I used my http://www.onsitedentalsystems.com/wine.tar.gz
DO not upgrade to my 1.40 as it will not seem to run on my droid4.. Probably will run on my droid1... I remember for that I may have used the Arm ToolChain from a site you download.
************************************************** *****************
Directions I used for wine.tar.gz if you do not have binfmt
what to do with wine.tar.gz
Move everything from bin into your /usr/bin
Move gnemul to your /usr
Move wine folder to your /usr/lib so you have /usr/lib/wine
mkdir /user/.wine
unzip wine.zip /user/.wine
fix dosdevices.
cd /user/.wine/dosdevices
ln -s ../c_drive c:
*when I say fix dosdevices make it to where this is a valid path
/root/.wine/dosdevices/c:/windows get it?
*my user is root so mkdir /root/.wine
then run
/usr/bin/qemu-i386 /usr/bin/wineserver
/usr/bin/qemu-i386 /usr/bin/wine-pthread notepad.exe
See what happens.. what errors you get.
Dont forget the files you copy into /usr/bin must be executable
chmod 755 wine*
Dont forget you may need to export display
=============================================
If you do have binfmt
mount -t binfmt_misc none /proc/sys/fs/binfmt_misc
echo ':i386:M::\x7fELF\x01\x00\x00\x00\x00\x00\x00\x00\ x00\x00\x00\x00\x02\x00\x03:\xff\xff\xff\xff\xff\x fe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfb\xff \xff:/home/user/qemu-i386:' >/proc/sys/fs/binfmt_misc/register
then you can just do
/usr/bin/qemu-i386 /usr/bin/wine-pthread notepad.exe
everytime.
These are my notes.
orokusaki
2012-10-13, 20:15
HOW TO COMPILE ON ARM AND UBUNTU 12.04
This will run wine if you compile with 0.13 or 0.14
sudo apt-get install zlib1g-dev
sudo apt-get install libsdl1.2-dev
./configure --target-list=i386-linux-user --enable-sdl --prefix=/usr --cross-prefix=arm-linux-gnueabi- --host-cc=gcc4.6 --extra-cflags=-marm --cpu=armv4l
make
sudo make install
Works great on Droid4 with Ubuntu 12.04 Chroot.
one cries glibc missing, the other segfaults at start, what version of make/autoconf do you have? aapo is bringing some goodies in this matter to life
What was the solution to this? I'm using the files from the wine.tar.gz archive, and have gcc, make and pkg-config installed (though slightly different versions) as suggested. I'm using orokusaki's instructions in the post above.
What was the solution to this? I'm using the files from the wine.tar.gz archive, and have gcc, make and pkg-config installed (though slightly different versions) as suggested. I'm using orokusaki's instructions in the post above.
Don't think I found any solution. The only 386 binaries I managed to run were linux ones with quite old qemu (search tmo for 'ADOM' for a tar.gz containing those)
baggacfreak
2013-03-12, 10:05
Hi,
can I use the qemu-i386 from the wine package to start a kolibri os floppy image? And do I have to set vnc option to get the display?
/opt/bin/qemu-i386 -fda /kolibri.img -m 8 -vnc :0
and then vncviewer on maemo to 127.0.0.1?
pablocrossa
2013-03-12, 10:33
Hi,
can I use the qemu-i386 from the wine package to start a kolibri os floppy image? And do I have to set vnc option to get the display?
/opt/bin/qemu-i386 -fda /kolibri.img -m 8 -vnc :0
and then vncviewer on maemo to 127.0.0.1?
You would probably need to try with qemu-system-i386 ;) Not sure if it is on the repo, you might have to compile it yourself :)
baggacfreak
2013-03-12, 11:41
Hi,
thanks for the reply whats the difference between qemu qemu-i386 and qemu-system-i386? I would not mind if it works with vnc server because if mouse does not work out of the box perhaps via pc mouse will work.
CU!
http://kolibrios.org/en/download.htm if anyone once to help me set up kolibri os with qemu xD
pablocrossa
2013-03-12, 15:07
Hi,
thanks for the reply whats the difference between qemu qemu-i386 and qemu-system-i386? I would not mind if it works with vnc server because if mouse does not work out of the box perhaps via pc mouse will work.
CU!
http://kolibrios.org/en/download.htm if anyone once to help me set up kolibri os with qemu xD
qemu-i386 runs in user-mode, meaning that the only thing it does is translate instructions from one architecture to another; this means that software such as wine can be run, but it will run on the same kernel and hardware you are currently running.
qemu-system-i386 emulates a whole set of harware, so you can 'boot' the virtual machine from the floppy image and it will run its own OS on virtualized hardware.
Hope that helps :)
vBulletin® v3.8.8, Copyright ©2000-2025, vBulletin Solutions, Inc.