Introducing Pi386
In the past, the only way to run x86 on the Pi was to use QEMU to emulate a x86 OS (very slow) or purchase ExaGear Desktop.
That was until someone calling himself mikerr came along and built a Raspbian image preconfigured to use WINE.
However, being able to use this required you to flash the image to a microSD card. You may have had Raspbian (or another Linux distro) installed on your microSD for a couple of months now, and don't want to overwrite it or buy a new microSD just to try this out.
I found out about something called qemu-user-static, which allows you to 'chroot' into a filesystem from a different architecture. I've heard of this being used to configure a Raspbian image to your needs and then flash it to your Pi. But a couple of weeks ago, I found out that you can also 'chroot' into i386 filesystems from the Raspberry Pi using qemu-user-static. When I tried using WINE in it, I got a segmentation fault. I was confused.
I asked about why I was getting a segfault on the forums, and a couple of people told me to just not bother trying to run i386 programs on the Pi. mikerr replied to the forum topic, saying that it was because WINE required a 3G/1G memory split, but the Pi by default used a 2G/2G memory split. I decided to recompile the RPi's kernel, enabling 3G/1G and Virtualisation in the kernel config before compiling.
I decided it was time to start a project, so I called it Pi386. It's basically going to be the free version of ExaGear, and will be released soon.
Thanks for reading!
That was until someone calling himself mikerr came along and built a Raspbian image preconfigured to use WINE.
However, being able to use this required you to flash the image to a microSD card. You may have had Raspbian (or another Linux distro) installed on your microSD for a couple of months now, and don't want to overwrite it or buy a new microSD just to try this out.
I found out about something called qemu-user-static, which allows you to 'chroot' into a filesystem from a different architecture. I've heard of this being used to configure a Raspbian image to your needs and then flash it to your Pi. But a couple of weeks ago, I found out that you can also 'chroot' into i386 filesystems from the Raspberry Pi using qemu-user-static. When I tried using WINE in it, I got a segmentation fault. I was confused.
I asked about why I was getting a segfault on the forums, and a couple of people told me to just not bother trying to run i386 programs on the Pi. mikerr replied to the forum topic, saying that it was because WINE required a 3G/1G memory split, but the Pi by default used a 2G/2G memory split. I decided to recompile the RPi's kernel, enabling 3G/1G and Virtualisation in the kernel config before compiling.
I decided it was time to start a project, so I called it Pi386. It's basically going to be the free version of ExaGear, and will be released soon.
Thanks for reading!
Ubuntu 18.04 LTS desktop images for the Raspberry Pi 3.
https://github.com/CodeExecution/Ubuntu-ARM64-RPi
https://github.com/CodeExecution/Ubuntu-ARM64-RPi
Re: Introducing Pi386
How are you going to provide 4G of ram ? Seems a non-starter.
PeterO
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson
Re: Introducing Pi386
Not entirely sure what 3G/1G means, all I know is that WINE requires a 3G/1G kernel to run.
Ubuntu 18.04 LTS desktop images for the Raspberry Pi 3.
https://github.com/CodeExecution/Ubuntu-ARM64-RPi
https://github.com/CodeExecution/Ubuntu-ARM64-RPi
Re: Introducing Pi386
Seems it's to do with kernel/user memory split not the absolute amounts of RAM (my misunderstanding).
PeterO
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson
Re: Introducing Pi386
2G/2G and 3G/1G refer to how the virtual memory space is split, not physical memory space.
3G/1G means userspace addresses are always in the lowest 3G and kernelspace addresses are always in the upper 1G.
WINE's requirement for the 3G/1G spilt has something to do with it wanting to allocate memory with an address in the upper half of memory which isn't available to userspace in a 2G/2G split.
3G/1G means userspace addresses are always in the lowest 3G and kernelspace addresses are always in the upper 1G.
WINE's requirement for the 3G/1G spilt has something to do with it wanting to allocate memory with an address in the upper half of memory which isn't available to userspace in a 2G/2G split.
She who travels light — forgot something.
Please note that my name doesn't start with the @ character so can people please stop writing it as if it does!
Please note that my name doesn't start with the @ character so can people please stop writing it as if it does!
Re: Introducing Pi386
OkayPaeryn wrote: ↑Wed Nov 07, 2018 12:22 am2G/2G and 3G/1G refer to how the virtual memory space is split, not physical memory space.
3G/1G means userspace addresses are always in the lowest 3G and kernelspace addresses are always in the upper 1G.
WINE's requirement for the 3G/1G spilt has something to do with it wanting to allocate memory with an address in the upper half of memory which isn't available to userspace in a 2G/2G split.
Ubuntu 18.04 LTS desktop images for the Raspberry Pi 3.
https://github.com/CodeExecution/Ubuntu-ARM64-RPi
https://github.com/CodeExecution/Ubuntu-ARM64-RPi
Re: Introducing Pi386
I managed to get WINE working. Here's a screenshot of the Pi running WINE Wordpad.
https://codeexecution.files.wordpress.c ... _scrot.png
https://codeexecution.files.wordpress.c ... _scrot.png
Ubuntu 18.04 LTS desktop images for the Raspberry Pi 3.
https://github.com/CodeExecution/Ubuntu-ARM64-RPi
https://github.com/CodeExecution/Ubuntu-ARM64-RPi
Re: Introducing Pi386
Excellent work. Well done. Keep it up.
One thing I would suggest is keep a document which describes all the steps you had to do, as detailed as possible, so others can follow in your footsteps later. It's always easier to document as you go.
Looking forward to seeing what Visual Basics it will run.
Re: Introducing Pi386
Some more info about Pi386:
1. Its chroot environment will be based on Debian Stretch.
2. Don't expect snappy, fast performance. It took about 15 seconds just for WINE Wordpad to start on a Pi 3.
3. It will be able to run 32-bit x86 (i386) programs, but it won't be able to run 64-bit x86 (amd64) programs.
1. Its chroot environment will be based on Debian Stretch.
2. Don't expect snappy, fast performance. It took about 15 seconds just for WINE Wordpad to start on a Pi 3.
3. It will be able to run 32-bit x86 (i386) programs, but it won't be able to run 64-bit x86 (amd64) programs.
Last edited by code_exec on Thu Nov 08, 2018 9:27 pm, edited 1 time in total.
Ubuntu 18.04 LTS desktop images for the Raspberry Pi 3.
https://github.com/CodeExecution/Ubuntu-ARM64-RPi
https://github.com/CodeExecution/Ubuntu-ARM64-RPi
Re: Introducing Pi386
I managed to get both Lightshot and LibreOffice 6.1 working through Pi386!


Ubuntu 18.04 LTS desktop images for the Raspberry Pi 3.
https://github.com/CodeExecution/Ubuntu-ARM64-RPi
https://github.com/CodeExecution/Ubuntu-ARM64-RPi
Re: Introducing Pi386
Do you have an ETA for a release version?
"L'enfer, c'est les autres"
G fytc hsqr rum umpbq rm qyw rm rfc kmbq md rfgq dmpsk:
Epmu Sn!
J lnacjrw njbruh-carppnanm vxm rb mnuncrwp vh yxbcb!
G fytc hsqr rum umpbq rm qyw rm rfc kmbq md rfgq dmpsk:
Epmu Sn!
J lnacjrw njbruh-carppnanm vxm rb mnuncrwp vh yxbcb!
Re: Introducing Pi386
I'm building the .deb file now. Expect a release very soon.
Ubuntu 18.04 LTS desktop images for the Raspberry Pi 3.
https://github.com/CodeExecution/Ubuntu-ARM64-RPi
https://github.com/CodeExecution/Ubuntu-ARM64-RPi
Re: Introducing Pi386
Pi386 has been released. Download the .deb file http://www.mediafire.com/file/6j1m9ppcc ... _1.0.1.deb
Download the custom kernel files (which use a 3G/1G memory split rather than the default 2G/2G) http://www.mediafire.com/file/dyho3vj3j ... nel_3g.zip
Once the zip file containing the kernel files has been downloaded, apply the new kernel with the following:
Reboot your Pi for the new kernel to take effect.
Install Pi386 with the following command:
You can then run Pi386 with the following command:
Once you're inside the chroot environment, you can install WINE with the following command:
Download the custom kernel files (which use a 3G/1G memory split rather than the default 2G/2G) http://www.mediafire.com/file/dyho3vj3j ... nel_3g.zip
Once the zip file containing the kernel files has been downloaded, apply the new kernel with the following:
Code: Select all
unzip custom_kernel_3g.zip
sudo cp -rT custom_kernel /boot
Install Pi386 with the following command:
Code: Select all
sudo dpkg -i pi386_1.0.1.deb
sudo apt install -f
Code: Select all
pi386
Code: Select all
apt install wine
Last edited by code_exec on Fri Nov 09, 2018 8:09 pm, edited 2 times in total.
Ubuntu 18.04 LTS desktop images for the Raspberry Pi 3.
https://github.com/CodeExecution/Ubuntu-ARM64-RPi
https://github.com/CodeExecution/Ubuntu-ARM64-RPi
- mahjongg
- Forum Moderator
- Posts: 14480
- Joined: Sun Mar 11, 2012 12:19 am
- Location: South Holland, The Netherlands
Re: Introducing Pi386
You say PI386 is something new, but this: https://www.youtube.com/watch?v=x5-vVgkj8UU was shown two years ago, what is the difference between it, and "PI386"? 
where is the emulation step to execute x86 CPU instructions on the PI's ARM CPU actually happening, not in WINE, Wine is Not an Emulator, so where?
Curious people want to know...

where is the emulation step to execute x86 CPU instructions on the PI's ARM CPU actually happening, not in WINE, Wine is Not an Emulator, so where?
Curious people want to know...
Re: Introducing Pi386
The Raspbian image used in that video was preconfigured to use i386 programs, meaning that you had to flash it to an SD card and start fresh rather than be able to install a x86 environment on your existing Raspbian install.mahjongg wrote: ↑Fri Nov 09, 2018 6:54 pmYou say PI386 is something new, but this: https://www.youtube.com/watch?v=x5-vVgkj8UU was shown two years ago, what is the difference between it, and "PI386"?
where is the emulation step to execute x86 CPU instructions on the PI's ARM CPU actually happening, not in WINE, Wine is Not an Emulator, so where?
Curious people want to know...
x86 emulation happens through qemu-user-static, which lets you chroot into filesystems designed for other architectures.
Ubuntu 18.04 LTS desktop images for the Raspberry Pi 3.
https://github.com/CodeExecution/Ubuntu-ARM64-RPi
https://github.com/CodeExecution/Ubuntu-ARM64-RPi
Re: Introducing Pi386
By the way, and just to clarify for anyone else reading this thread, the approach here is the same as in Exagear.
That is, you emulate x86 so that you can run Linux X86 code. Then you layer WINE on top of that so you can run (some) Windows apps.
But what's missing from this formula is actually running Windows - with the familiar desktop and UI.
So to OP, I ask: Is there any possibility of using your setup to actually run Windows as we know it?
Note that other people (e.g., Ric from Delhi) have managed to run actual Windows (Win 95/98) under QEMU on the Pi? How does your effort compare to theirs?
That is, you emulate x86 so that you can run Linux X86 code. Then you layer WINE on top of that so you can run (some) Windows apps.
But what's missing from this formula is actually running Windows - with the familiar desktop and UI.
So to OP, I ask: Is there any possibility of using your setup to actually run Windows as we know it?
Note that other people (e.g., Ric from Delhi) have managed to run actual Windows (Win 95/98) under QEMU on the Pi? How does your effort compare to theirs?
"L'enfer, c'est les autres"
G fytc hsqr rum umpbq rm qyw rm rfc kmbq md rfgq dmpsk:
Epmu Sn!
J lnacjrw njbruh-carppnanm vxm rb mnuncrwp vh yxbcb!
G fytc hsqr rum umpbq rm qyw rm rfc kmbq md rfgq dmpsk:
Epmu Sn!
J lnacjrw njbruh-carppnanm vxm rb mnuncrwp vh yxbcb!
Re: Introducing Pi386
It is possible to run old versions of Windows on the Pi (Windows XP is the most recent version you can run, and it is slow) through QEMU. People have also managed to get Windows 10 WoA running on the RPi 3, but it is slow and lacks drivers for things such as WiFi, preventing it from being acceptable for everyday use.n67 wrote: ↑Fri Nov 09, 2018 8:54 pmBy the way, and just to clarify for anyone else reading this thread, the approach here is the same as in Exagear.
That is, you emulate x86 so that you can run Linux X86 code. Then you layer WINE on top of that so you can run (some) Windows apps.
But what's missing from this formula is actually running Windows - with the familiar desktop and UI.
So to OP, I ask: Is there any possibility of using your setup to actually run Windows as we know it?
Note that other people (e.g., Ric from Delhi) have managed to run actual Windows (Win 95/98) under QEMU on the Pi? How does your effort compare to theirs?
Pi386, on the other hand, is a preconfigured x86 environment for the Pi which doesn't run an entire OS, but it runs i386 Debian software. qemu-i386-static translates x86 code to ARM code, making applications run on the Pi as if they were running natively.
Ubuntu 18.04 LTS desktop images for the Raspberry Pi 3.
https://github.com/CodeExecution/Ubuntu-ARM64-RPi
https://github.com/CodeExecution/Ubuntu-ARM64-RPi
- DarkPlatinum
- Posts: 872
- Joined: Thu Nov 02, 2017 2:30 pm
- Location: Unknown
Re: Introducing Pi386
How much faster is this compared to exegears version? I have run Windows 95 with QEMU, it was slow and I could not get networking working.
1 * Raspberry Pi Zero W, 1 * Raspberry Pi 2, 1 * Raspberry Pi 3, 1 * Raspberry Pi 3B+, 1 * Raspberry Pi 4B 

- DarkPlatinum
- Posts: 872
- Joined: Thu Nov 02, 2017 2:30 pm
- Location: Unknown
Re: Introducing Pi386
You need to state what version of kernel this requires, I had not updated my system, and downloaded your kernel, and when I boot it up I get cant load kernel module error.code_exec wrote: ↑Fri Nov 09, 2018 5:15 pmPi386 has been released. Download the .deb file http://www.mediafire.com/file/6j1m9ppcc ... _1.0.1.deb
Download the custom kernel files (which use a 3G/1G memory split rather than the default 2G/2G) http://www.mediafire.com/file/dyho3vj3j ... nel_3g.zip
Once the zip file containing the kernel files has been downloaded, apply the new kernel with the following:
Reboot your Pi for the new kernel to take effect.Code: Select all
unzip custom_kernel_3g.zip sudo cp -rT custom_kernel /boot
Install Pi386 with the following command:
You can then run Pi386 with the following command:Code: Select all
sudo dpkg -i pi386_1.0.1.deb sudo apt install -f
Once you're inside the chroot environment, you can install WINE with the following command:Code: Select all
pi386
Code: Select all
apt install wine
1 * Raspberry Pi Zero W, 1 * Raspberry Pi 2, 1 * Raspberry Pi 3, 1 * Raspberry Pi 3B+, 1 * Raspberry Pi 4B 

- DarkPlatinum
- Posts: 872
- Joined: Thu Nov 02, 2017 2:30 pm
- Location: Unknown
Re: Introducing Pi386
I ran a sudo apt-get update and dist-upgrade. I then reinstalled your kernel. It does not work. You need to continuously update it to the latest raspbian kernel for it to work with everyone system.
1 * Raspberry Pi Zero W, 1 * Raspberry Pi 2, 1 * Raspberry Pi 3, 1 * Raspberry Pi 3B+, 1 * Raspberry Pi 4B 

Re: Introducing Pi386
Hmm, that's strange. I compiled the kernel by following the instructions here:DarkPlatinum wrote: ↑Sun Nov 18, 2018 7:13 pmI ran a sudo apt-get update and dist-upgrade. I then reinstalled your kernel. It does not work. You need to continuously update it to the latest raspbian kernel for it to work with everyone system.
https://www.raspberrypi.org/documentati ... iguring.md
https://www.raspberrypi.org/documentati ... uilding.md
I haven't touched the kernel for a couple of weeks though, so it may be an old version. I'll recompile it ASAP.
Alternatively, you can try building the kernel yourself with a 3G/1G memory split, though this takes some time.
Ubuntu 18.04 LTS desktop images for the Raspberry Pi 3.
https://github.com/CodeExecution/Ubuntu-ARM64-RPi
https://github.com/CodeExecution/Ubuntu-ARM64-RPi
Re: Introducing Pi386
Also, what Pi model are you using? For the best and most stable results, I'd suggest using a Pi 3B.DarkPlatinum wrote: ↑Sun Nov 18, 2018 7:13 pmI ran a sudo apt-get update and dist-upgrade. I then reinstalled your kernel. It does not work. You need to continuously update it to the latest raspbian kernel for it to work with everyone system.
Ubuntu 18.04 LTS desktop images for the Raspberry Pi 3.
https://github.com/CodeExecution/Ubuntu-ARM64-RPi
https://github.com/CodeExecution/Ubuntu-ARM64-RPi
- DarkPlatinum
- Posts: 872
- Joined: Thu Nov 02, 2017 2:30 pm
- Location: Unknown
Re: Introducing Pi386
code_exec wrote: ↑Mon Nov 19, 2018 6:26 amAlso, what Pi model are you using? For the best and most stable results, I'd suggest using a Pi 3B.DarkPlatinum wrote: ↑Sun Nov 18, 2018 7:13 pmI ran a sudo apt-get update and dist-upgrade. I then reinstalled your kernel. It does not work. You need to continuously update it to the latest raspbian kernel for it to work with everyone system.
Using a 3B+
1 * Raspberry Pi Zero W, 1 * Raspberry Pi 2, 1 * Raspberry Pi 3, 1 * Raspberry Pi 3B+, 1 * Raspberry Pi 4B 

Re: Introducing Pi386
Okay.DarkPlatinum wrote: ↑Mon Nov 19, 2018 8:51 amcode_exec wrote: ↑Mon Nov 19, 2018 6:26 amAlso, what Pi model are you using? For the best and most stable results, I'd suggest using a Pi 3B.DarkPlatinum wrote: ↑Sun Nov 18, 2018 7:13 pmI ran a sudo apt-get update and dist-upgrade. I then reinstalled your kernel. It does not work. You need to continuously update it to the latest raspbian kernel for it to work with everyone system.
Using a 3B+
Ubuntu 18.04 LTS desktop images for the Raspberry Pi 3.
https://github.com/CodeExecution/Ubuntu-ARM64-RPi
https://github.com/CodeExecution/Ubuntu-ARM64-RPi
- DarkPlatinum
- Posts: 872
- Joined: Thu Nov 02, 2017 2:30 pm
- Location: Unknown
Re: Introducing Pi386
Have you updated everything to the latest version? And have you updated the links above so that I don't get the same version when I download it?
1 * Raspberry Pi Zero W, 1 * Raspberry Pi 2, 1 * Raspberry Pi 3, 1 * Raspberry Pi 3B+, 1 * Raspberry Pi 4B 
