SkywalkerSW5
Posts: 60
Joined: Fri Apr 19, 2019 3:54 pm

Re: piRoot: A way to run x86_64 Debian apps on Raspbian

Sun Oct 06, 2019 7:41 pm

Yeah, that's what I was thinking.
Random dude. Likes dogs. And Linux. Complete NOOB.

sparkyhall
Posts: 141
Joined: Mon Aug 27, 2012 9:14 am

Re: piRoot: A way to run x86_64 Debian apps on Raspbian

Sun Oct 06, 2019 8:01 pm

Maybe ReactOS would be an alternative to Windows XP, I've never tried or used ReactOS though.

https://reactos.org/

SkywalkerSW5
Posts: 60
Joined: Fri Apr 19, 2019 3:54 pm

Re: piRoot: A way to run x86_64 Debian apps on Raspbian

Sun Oct 06, 2019 8:03 pm

That's not a bad idea, I will have to try that.
Random dude. Likes dogs. And Linux. Complete NOOB.

mikerr
Posts: 2778
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: piRoot: A way to run x86_64 Debian apps on Raspbian

Sun Oct 06, 2019 8:31 pm

Not sure why the mystery/ total lack of description here ...?

So I'll add the main parts:

- Emulate x86 code using qemu.
- Create a full chroot filesystem of x86 Debian using debootstrap
- Use binfmt bintools tools to recognise x86 binaries so they can be auto directed to qemu for emulation.

https://wiki.debian.org/QemuUserEmulation

You can go further by installing wine in the chroot system to run basic Windows programs (very slowly)
Android app - Raspi Card Imager - download and image SD cards - No PC required !

SkywalkerSW5
Posts: 60
Joined: Fri Apr 19, 2019 3:54 pm

Re: piRoot: A way to run x86_64 Debian apps on Raspbian

Sun Oct 06, 2019 8:33 pm

Would you guys be happier if I switched to pure emulation (Qemu), or just stick with Linux being chroot?
Random dude. Likes dogs. And Linux. Complete NOOB.

hippy
Posts: 5941
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: piRoot: A way to run x86_64 Debian apps on Raspbian

Sun Oct 06, 2019 8:39 pm

hippy wrote:
Sun Oct 06, 2019 7:16 pm
1) Make what you have released work as is
Well it does seem I have managed to make it work. Not sure why it works, and must guess there's something auto-magical going on once 'qemu-user-static' is installed and, as jdonald, suggested, nothing needs copying into the /usr/piRoot/debian tree...

Added : I guess mikerr explained the magic above.

Code: Select all

sudo apt-get install ./piRoot.deb
sudo apt-get install qemu-user-static
sudo chroot /usr/piRoot/debian/ /bin/su -l root

Code: Select all

[email protected]:~# uname -a
Linux Pi3B 4.19.75-v7+ #1270 SMP Tue Sep 24 18:45:11 BST 2019 x86_64 GNU/Linux
[email protected]:~# ls /
bin   dev  home  lib64  mnt  proc  run   snap  sys  usr
boot  etc  lib   media  opt  root  sbin  srv   tmp  var
[email protected]:~# file /bin/sleep
/bin/sleep: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=d4ab980e7d895d7eef7bdeb093648a6a1e080c19, stripped
[email protected]:~# time /bin/sleep 10
real    0m10.215s
user    0m0.174s
sys     0m0.043s
[email protected]:~# python3
Python 3.5.3 (default, Sep 27 2018, 17:25:39) 
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> quit()
[email protected]:~# exit
exit
[email protected]:~ $
It would be interesting to see if anyone else gets the same result or whether it was something I happened to do along the way.
sparkyhall wrote:
Sun Oct 06, 2019 8:01 pm
Maybe ReactOS would be an alternative to Windows XP, I've never tried or used ReactOS though.
Nor me. Of all the things I tried to install on a PC while trying to figure out what I'd use that for, Raspberry Pi Desktop, Chromium OS, Android X86, React OS was the only thing which crashed and/or hung during install, utterly failed to install. YMMV.
Pulsar33 wrote:
Sun Oct 06, 2019 6:42 pm
This is why I spoke about Hiren Boot CD. Since many years, this tool embed a "Mini Windows XP", with a lot of usefull tools, without the need of a license. But I don't know how they do and how they can skip over the license problem.
They say they are complying with all licensing terms, and probably are. This is similar to what I recall of when I was creating XP PE images -

https://docs.microsoft.com/en-us/window ... inpe-intro

"Windows PE is not a general-purpose operating system. It may not be used for any purpose other than deployment and recovery. It should not be used as a thin client or an embedded operating system".

hippy
Posts: 5941
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: piRoot: A way to run x86_64 Debian apps on Raspbian

Sun Oct 06, 2019 9:49 pm

One mystery someone may be able to explain to me - since 'sudo apt-get install qemu-user-static' I can now run any X86 Linux binaries. Eg FASM and FASMARM, outside the chroot piRoot sets up. Why ?

Is it that installing qemu-user-static has enabled doing that or is it something which installing and using the ./piRoot.deb has allowed ?

SkywalkerSW5
Posts: 60
Joined: Fri Apr 19, 2019 3:54 pm

Re: piRoot: A way to run x86_64 Debian apps on Raspbian

Sun Oct 06, 2019 11:41 pm

ReactOS keeps bringing up the blue screen of death. Any other operating systems that will run Windows programs?
Random dude. Likes dogs. And Linux. Complete NOOB.

SkywalkerSW5
Posts: 60
Joined: Fri Apr 19, 2019 3:54 pm

Re: piRoot: A way to run x86_64 Debian apps on Raspbian

Sun Oct 06, 2019 11:48 pm

Nevermind, I’ll try Lindows.
Random dude. Likes dogs. And Linux. Complete NOOB.

User avatar
Paeryn
Posts: 2657
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: piRoot: A way to run x86_64 Debian apps on Raspbian

Mon Oct 07, 2019 1:41 am

hippy wrote:
Sun Oct 06, 2019 9:49 pm
One mystery someone may be able to explain to me - since 'sudo apt-get install qemu-user-static' I can now run any X86 Linux binaries. Eg FASM and FASMARM, outside the chroot piRoot sets up. Why ?

Is it that installing qemu-user-static has enabled doing that or is it something which installing and using the ./piRoot.deb has allowed ?
From the qemu-user-static package description:
This package provides the user mode emulation binaries, built statically. In this mode QEMU can launch Linux processes compiled for one CPU on another CPU.

qemu-user-static package will register binary formats which the provided emulators can handle, so that it will be possible to run foreign binaries directly.
So it sounds like it registers itself with binfmt_misc so when an ELF file says it is an x86 (or x64) executable the kernel will automatically pass it to qemu to run it (just like having a shebang line at the start of a file).
She who travels light — forgot something.

hippy
Posts: 5941
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: piRoot: A way to run x86_64 Debian apps on Raspbian

Mon Oct 07, 2019 9:52 am

Paeryn wrote:
Mon Oct 07, 2019 1:41 am
So it sounds like it registers itself with binfmt_misc so when an ELF file says it is an x86 (or x64) executable the kernel will automatically pass it to qemu to run it (just like having a shebang line at the start of a file).
Thanks, it's starting to make sense now ...

Code: Select all

[email protected]:~ $ ls /proc/sys/fs/binfmt_misc
python2.7   qemu-i386        qemu-mipsel      qemu-riscv64      qemu-sparc64
python3.7   qemu-m68k        qemu-ppc         qemu-s390x        qemu-x86_64
qemu-alpha  qemu-microblaze  qemu-ppc64       qemu-sh4          qemu-xtensa
qemu-armeb  qemu-mips        qemu-ppc64abi32  qemu-sh4eb        qemu-xtensaeb
qemu-cris   qemu-mips64      qemu-ppc64le     qemu-sparc        register
qemu-hppa   qemu-mips64el    qemu-riscv32     qemu-sparc32plus  status
[email protected]:~ $ cat /proc/sys/fs/binfmt_misc/status
enabled
[email protected]:~ $ sudo cat /proc/sys/fs/binfmt_misc/qemu-x86_64 
enabled
interpreter /usr/bin/qemu-x86_64-static
flags: OCF
offset 0
magic 7f454c4602010100000000000000000002003e00
mask fffffffffffefefcfffffffffffffffffeffffff

User avatar
sakaki
Posts: 343
Joined: Sun Jul 16, 2017 1:11 pm

Re: piRoot: A way to run x86_64 Debian apps on Raspbian

Mon Oct 07, 2019 8:13 pm

Paeryn wrote:
Mon Oct 07, 2019 1:41 am
hippy wrote:
Sun Oct 06, 2019 9:49 pm
One mystery someone may be able to explain to me - since 'sudo apt-get install qemu-user-static' I can now run any X86 Linux binaries. Eg FASM and FASMARM, outside the chroot piRoot sets up. Why ?

Is it that installing qemu-user-static has enabled doing that or is it something which installing and using the ./piRoot.deb has allowed ?
From the qemu-user-static package description:
This package provides the user mode emulation binaries, built statically. In this mode QEMU can launch Linux processes compiled for one CPU on another CPU.

qemu-user-static package will register binary formats which the provided emulators can handle, so that it will be possible to run foreign binaries directly.
So it sounds like it registers itself with binfmt_misc so when an ELF file says it is an x86 (or x64) executable the kernel will automatically pass it to qemu to run it (just like having a shebang line at the start of a file).
That's essentially how this type of approach works, yes.

You can read a (slightly granular!) guide to putting a binfmt_misc handler together (albeit for the other direction - to allow chrooting into an arm64 userland on a PC - and targeted at Gentoo, but easily adapted) in my wiki page here.

Best, sakaki

SkywalkerSW5
Posts: 60
Joined: Fri Apr 19, 2019 3:54 pm

Re: piRoot: A way to run x86_64 Debian apps on Raspbian

Tue Oct 08, 2019 10:44 pm

Beta 2 is here!

In this Beta, piRoot adds the ability to choose what OSes you can run. You can choose Debian, or Ubuntu. Ubuntu is being run from an iso, and QEMU. I was going to add ReactOS, but that is coming in a later update.
In order to run the other OSes, you need to download the Beta 2 first. Here is the link to the website. https://skywalkersw5.github.io/piRoot/

Any other ideas or suggestions?

Also, you run the app through typing piRoot in the terminal.
Random dude. Likes dogs. And Linux. Complete NOOB.

SkywalkerSW5
Posts: 60
Joined: Fri Apr 19, 2019 3:54 pm

Re: piRoot: A way to run x86_64 Debian apps on Raspbian

Wed Oct 09, 2019 12:09 am

I have just uploaded the source code to GitHub in the Source Code branch
Random dude. Likes dogs. And Linux. Complete NOOB.

hippy
Posts: 5941
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: piRoot: A way to run x86_64 Debian apps on Raspbian

Wed Oct 09, 2019 12:22 am

SkywalkerSW5 wrote:
Tue Oct 08, 2019 10:44 pm
In order to run the other OSes, you need to download the Beta 2 first. Here is the link to the website. https://skywalkersw5.github.io/piRoot/
You might want to clarify the instructions. I removed the old beta, downloaded and installed Beta 2 piRoot.deb, worked, installed lots of qemu stuff. Running /usr/piRoot/app/PiRoot gave a Debian/Ubuntu option but then terminated with a syntax error near done.

Trying to install piRoot-debian.deb reported that piRoot was already the latest, then terminated.

Removed that, installed piRoot-debian.deb, but then there's no /usr/piRoot/app/piRoot, typing piRoot gave command not found.

Trying to then install piRoot.deb reported it's already the latest.

SkywalkerSW5
Posts: 60
Joined: Fri Apr 19, 2019 3:54 pm

Re: piRoot: A way to run x86_64 Debian apps on Raspbian

Wed Oct 09, 2019 12:35 am

I had that error. Since then, I have updated it. Try downloading it again.
Random dude. Likes dogs. And Linux. Complete NOOB.

hippy
Posts: 5941
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: piRoot: A way to run x86_64 Debian apps on Raspbian

Wed Oct 09, 2019 10:42 am

SkywalkerSW5 wrote:
Wed Oct 09, 2019 12:35 am
I had that error. Since then, I have updated it. Try downloading it again.
It would still help to state exactly what needs to be done to install and use piRoot.

It appears /usr/piRoot/app/piRoot no longer works, though it is still installed, and one has to use a "piRoot" command. But that fails after selecting Debian, as does an explicit chroot -

Code: Select all

[email protected]:~ $ sudo chroot /usr/piRoot/debian/ /bin/su -l root
initgroups: Operation not permitted
[email protected]:~ $ 

SkywalkerSW5
Posts: 60
Joined: Fri Apr 19, 2019 3:54 pm

Re: piRoot: A way to run x86_64 Debian apps on Raspbian

Wed Oct 09, 2019 8:16 pm

Try running it without sudo
Random dude. Likes dogs. And Linux. Complete NOOB.

hippy
Posts: 5941
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: piRoot: A way to run x86_64 Debian apps on Raspbian

Wed Oct 09, 2019 11:06 pm

Pretty much as expected -

Code: Select all

[email protected]:~ $ chroot /usr/piRoot/debian/ /bin/su -l root
chroot: cannot change root directory to '/usr/piRoot/debian/': Operation not permitted

SkywalkerSW5
Posts: 60
Joined: Fri Apr 19, 2019 3:54 pm

Re: piRoot: A way to run x86_64 Debian apps on Raspbian

Thu Oct 10, 2019 12:52 am

That's weird. Fixing it now
Random dude. Likes dogs. And Linux. Complete NOOB.

SkywalkerSW5
Posts: 60
Joined: Fri Apr 19, 2019 3:54 pm

Re: piRoot: A way to run x86_64 Debian apps on Raspbian

Sat Oct 12, 2019 3:44 pm

Version 1 is here!

Download it here - https://skywalkersw5.github.io/piRoot

Some things:

- piRoot has Xubuntu and Manjaro Linux

- To launch it, run piRoot in the terminal. No more /usr/piRoot/app/piRoot

- You can't just download piRoot Xubuntu, and run piRoot in the terminal. You have to download piRoot 1 first.
Random dude. Likes dogs. And Linux. Complete NOOB.

SkywalkerSW5
Posts: 60
Joined: Fri Apr 19, 2019 3:54 pm

Re: piRoot: A way to run x86_64 Debian apps on Raspbian

Sat Oct 12, 2019 7:08 pm

Does anyone know of an operating system (besides ReactOS) that can run .exe files? Anytime I try to run ReactOS, it gives me a driver error.
Random dude. Likes dogs. And Linux. Complete NOOB.

hippy
Posts: 5941
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: piRoot: A way to run x86_64 Debian apps on Raspbian

Sat Oct 12, 2019 10:12 pm

Another day, another adventure. Uninstalled all the old stuff, checked /usr/piRoot had gone

Downloaded and installed the new, first piroot1.deb, then piroot-xubuntu.deb

Eventually, up pops the selector -

1) Xubuntu with ISO
2) Manjaro with ISO
3) ReactOS with ISO
4) Xubuntu

Tried (1) and five minutes later it's merely repeatedly throwing "BUG: soft lockup" errors.

Tried (4) and that started something but just ends with "No bootable device".

Thought I'd try with Manjaro but attempting to download that from your link won't let me unless I sign-up for a Microsoft account.

And what has either got to do with "piRoot: A way to run x86_64 Debian apps on Raspbian" - seeing as neither are "Debian" ?

And does it really require a 1.4GB install just to do that ?

From having X86-64 Debian working a week ago; nothing seems to be working now and we don't even have X86-64 Debian

SkywalkerSW5
Posts: 60
Joined: Fri Apr 19, 2019 3:54 pm

Re: piRoot: A way to run x86_64 Debian apps on Raspbian

Sat Oct 12, 2019 11:09 pm

I don't know about the soft lockup issue, but the reason Xubuntu without the iso wouldn't boot is because you were supposed to be able to install Xubuntu on to that virtual hard drive. Currently, it has nothing to boot. x86_64 Debian will be up in a bit, and sorry about not being able to download the Manjaro .deb . I will put that somewhere else.
Random dude. Likes dogs. And Linux. Complete NOOB.

SkywalkerSW5
Posts: 60
Joined: Fri Apr 19, 2019 3:54 pm

Re: piRoot: A way to run x86_64 Debian apps on Raspbian

Sat Oct 12, 2019 11:12 pm

hippy wrote:
Tried (1) and five minutes later it's merely repeatedly throwing "BUG: soft lockup" errors.
From a google search, it says to try to update your machine. That probably isn't the answer, but I would suggest trying it.
Random dude. Likes dogs. And Linux. Complete NOOB.

Return to “General discussion”