top | item 22080927

I've been working on X11 on jailbroken iOS

403 points| MaxLeiter | 6 years ago |maxleiter.com | reply

87 comments

order
[+] ilammy|6 years ago|reply
You just reminded me of jwz’s portability efforts to keep XScreenSaver from being rewritten from scratch™ in the newest fad every time it comes around. He literally implemented X11 on top of Cocoa on top of UIKit on top of OpenGL on top of OpenGL ES just so that his hacks can still run. Though I wonder what will happen when Vulkan becomes the substrate API.
[+] rs23296008n1|6 years ago|reply
Good for him. Each to their own. That said, those hacks must be legendary for him to go to those lengths. Frankly I'm surprised xscreensaver is still around given all the various changes to window managers.

I've probably still got a few machines with a locally compiled version of xscreensaver lying around.

[+] qalmakka|6 years ago|reply
OpenGL is probably going to be around forever, there's just too much stuff written around it that has 0 benefit from being completely rewritten in Vulkan. What is going to probably happen is that native OpenGL drivers will stop being developed as soon as implementations on top of Vulkan such as Zink become stable and competitive. After all, the fact that modern APIs such as DX12 and Vulkan are so low level has made reimplementing older, clunky APIs such as OpenGL and DX11 on top of them not only possible, but pretty much doable (see DXVK for instance).
[+] badsectoracula|6 years ago|reply
OpenGL proper (not ES) wont go anywhere for at least the next 3-4 decades - there is way too much software written against it and keep getting written against it for it disappear. At worst, it will be reimplemented on top of something else (be it Vulkan or whatever), but this will be transparent to the applications using it.

Now if he wants to port XScreenSaver to a platform that doesn't have support for either OpenGL or OpenGL ES, my guess is that he'll write a wrapper.

[+] heavyset_go|6 years ago|reply
Cool! I gave up on hacking on the iOS and macOS platforms because of how hostile Apple is towards it.

It's nice to see projects like this, I just hope that the rug doesn't get pulled out from under you after sinking time into it.

[+] MaxLeiter|6 years ago|reply
checkra1n (current jailbreak for devices with A10 or older chips) is based on a BootROM exploit, so thankfully I can keep my iPad on newer iOS versions and remain jailbroken.
[+] rs23296008n1|6 years ago|reply
Being ignorant of all things jailbreaking, is there a reason why X11 the display can't run on iOS? Surely an ios app can run a persistent background server, eg web? Or is it the swapping out/pausing that is the problem? Or is the answer to these simply a sharp edged and loud NO? We-say-so etc.

I fully get why Vnc/X11 as a screen sharing facility wouldn't work - no access. I also get why running a full devel environment would be pain for a "normal" developer to implement - again, no access.

This is all ironic because Apple market their iPad Pro as a professional device AND the cpu/ram is obviously plenty good enough (they themselves said so). The thing is more powerful than a Pi. And it meekly manages to compile quite a lot. My little Pi collection is now at 5 members and growing.

So, Apple, why can't I compile apps for ios on ipados? Hmmm? Wheels for the mind, think different etc

[+] Someone|6 years ago|reply
For some definition of “server”, yes. https://www.raywenderlich.com/5817-background-modes-tutorial...:

”Your app is only allowed to keep running in the background in very specific cases. For example, these include playing audio, getting location updates or fetching the latest content from a server.

If your task does not fall into these categories, backgrounding may not be for you. You may even find yourself with an App Store rejection if you try to cheat the system by using background modes outside the realm of their purposes, so consider yourself warned!”

If you read that, your ‘server’ either will only run for a finite time determined by the OS (in practice 3 minutes), or only run at highly granular times determined by the OS (”the system uses usage patterns to determine when to best fire off a background fetch. For example, if your user opens the app at 9 AM each morning, it’s likely that a background fetch will occur sometime before that time.”)

I think a X11 server that tracks updates for those three minutes of inactive time, and has a window manager that requests window updates where needed when the app becomes active could work, though.

(Disclaimer: these restrictions get relaxed over time on iOS. I may have missed some recent improvements)

[+] josteink|6 years ago|reply
> Surely an ios app can run a persistent background server, eg web? Or is it the swapping out/pausing that is the problem?

I don’t know technical details, but trying to use ssh tunnels on iOS, the tunnel won’t forward until I swap iSH into the foreground, so I have to constantly swap between the browser and the terminal.

Not very practical.

[+] ericlewis|6 years ago|reply
I would guess it depends on how this was implemented really. If you’re using private apis then it is a no go. But if you were to somehow only use public apis to fill the x11 apis then it would maybe be okay.
[+] 0xff00ffee|6 years ago|reply
This makes me happy. I have so much X11 code written over the past few decades, and I always fall back to X programming when I need to do something fast and in C. I've written a few simple iOS apps, but was frustrated with GStreamer support. Of course I have no idea what Cydia is... off to wikipedia.
[+] sudosysgen|6 years ago|reply
For anyone else, Cydia is a dpkg based package manager for jailbroken iOS
[+] marinhero|6 years ago|reply
Very cool, I wish jailbreak wasn't needed! Hopefully this shows Apple that people want to use their iPad as coding machines too...
[+] rock_artist|6 years ago|reply
Apple will eventually give you some kind of Xcode.

BTW, few years ago this guy made some Xcode remote before joining Apple Xcode team :) - https://twitter.com/LouisDhauwe/status/1008071487721439233/v...

But that's only part of the problem. Still until Apple would give us the ability (similar to Android) running unsigned / not from App Store / no timebombs certs (similar to Android unknown sources), iOS is the most propriety platform and that's a shame.

[+] divbzero|6 years ago|reply
I have recently been coding on iPad using a combination of Working Copy [1] and Termius [2].

[1]: https://workingcopyapp.com/

[2]: https://www.termius.com/

Working Copy is an amazing graphical Git client and integrates fully with iOS Files.

But for now SSH/Mosh via Termius feels closer to a traditional dev environment. It gives me full access to the command line, tmux, vim, etc., and mapping caps lockesc sidesteps the lack of an iPad escape key and would be my default on a computer anyway.

I would love to have the best of both worlds: a traditional dev environment local to my iPad and integrated with native iOS APIs.

[+] hatch_q|6 years ago|reply
I find it ironic that the best tablet to run full-fledged Linux is Microsoft Surface.
[+] prox|6 years ago|reply
What are you missing right now? I have been very happy with Buffer and the new files system, panes for multitasking, + VNC.
[+] inoop|6 years ago|reply
This is an absolutely batshit crazy idea. I love it.
[+] jasonhansel|6 years ago|reply
Add it to my list of "nice things we can't have inside the walled garden"
[+] kbumsik|6 years ago|reply
I am confused, so is a X11 stack/server runs in an iOS device natively (not remotely) but you need a VNC client since a X11 client is not implemented yet?
[+] minxomat|6 years ago|reply
You can do the same today, without a jailbreak using https://ish.app/ which is an x86 emulator capable of running on the latest iOS / iPadOS versions. I do actually use it for work. Plus it works with standard x86 alpine Linux packages.
[+] MaxLeiter|6 years ago|reply
Yep. Someone more familiar with Swift/iOS internals can probably write a proper client as an app, but I can't do that at the moment
[+] djsumdog|6 years ago|reply
Oh is that it? I thought x11vnc was needed so you could do input/output (keyboard/mouse and such).
[+] mnem|6 years ago|reply
An iPad is certainly a thin client...

More seriously though, while I am (or have been) persuaded that the restricted environment of iOS generally does make sense for the majority of people, I’d love to see official “blank” iDevices or an open developer mode available for them. Perhaps something similar to being able to install Linux on PlayStation’s. They make very nice portable computing platforms for prototyping and development.

[+] wyxuan|6 years ago|reply
Shame that newer devices can’t have this
[+] rvz|6 years ago|reply
Interesting porting effort here for X11 on iOS. I'm not sure why I would use this but wouldn't it be beneficial for more iPhone jailbreak users to have Android dual-booting on their iDevice device?

If that were to happen, I would never need to buy a second phone like I would just use my single Macbook to triple-boot Windows, Mac and Ubuntu.

[+] _jal|6 years ago|reply
Well, for starters, you'd need to reverse engineer drivers for custom Apple hardware, some of which is hardened against that.

...And about 37 other extremely difficult things later, Apple would sue you.

[+] dmarinus|6 years ago|reply
Wouldn't porting Wayland be easier and more future proof than porting X11?
[+] MaxLeiter|6 years ago|reply
Wayland is linux only, and will require significantly more work. Some work has been done on macOS, so maybe one day...
[+] rijoja|6 years ago|reply
What about RDP would that be a possibility?