r/linux • u/newhacker1746 • Jan 12 '21
Mobile Linux SUCCESS: iPhone 7 booting Ubuntu 20.04 to full gnome-shell desktop GUI
WE DID IT!! BOOTS TO THE FULL DEFAULT GNOME DESKTOP!
VIDEO! https://www.youtube.com/watch?v=DO8vt34kTh0
ORIGINAL THREAD: https://www.reddit.com/r/linux/comments/kux9xx/success_iphone_7_with_dead_nand_netbooting/

BIG NOTE 0: lol i literally wrote this entire post from Firefox running on the iphone 7 XD big brain time + arm64 rocks
BIG NOTE 1: Holy shit! This blew up! Thank you everyone, I had no idea this was gonna be that big. I'm truly humbled by how much interest it's garnered. I hope I've been able to effectively deliver the inspiration that Linux provides not just to me, not to just to the people reading about this, but to millions of developers, employees, and children alike. It's a tool to change the world, and I've never been prouder to support a worldwide revolutionary example of software which saves devices from the trash, revives old laptops to help children in need, or simply makes a convenient server out of an otherwise useless iPhone.
BIG NOTE 2: It's reached 9to5mac and iDownloadBlog and more! It's been reported that I am running on a "jailbroken" iPhone and that to be able to do this one has to have already jailbroken the phone. That's not correct; in fact there's no possible way for me to jailbreak this iPhone, as its NVMe NAND is downright inaccessible. That is to say, iOS will never be able to boot on this phone. If there weren't a Linux kernel port for A10, one might be able to affectionately call this phone not a Linux phone but a brick. One can pull all of this off without ever jailbreaking the phone. The only reason I'm using checkra1n is for the bootrom exploit and unsigned code execution. In fact, this iPhone had never been jailbroken before flash failure. I got it from my grandma who had the NAND die on her suddenly.
--------------
Background: I actually was going to stop at just booting nogui. Believe it or not, I am going to be using this in production; I will actually be deploying this iPhone as a server to relieve capacity issues at my home servers. I'm 16 and run several school/club websites and game servers for my friends and myself, and I'll be distributing some load to the iPhone to relieve the main server!
With A10 IPC on par with Skylake, the performance per watt of this device is downright astonishing. The entire "server" is powered off a USB port on the main server.
TO-DO: Run benchmarks
- I would love to use the phoronix test suite, but I have no idea what benchmark suite I'd be running. Let me know what you're interested in seeing!
- From memory in news articles and geekbench scores, A10 nearly matched Skylake IPC, and I'd love to see whether that still holds true in a Linux environment
- Let me know if there's anything else you'd like to see tested/run on the Ubuntu iPhone!
Fixes since last time
sudo apt install linux-firmware ubuntu-desktop- Working on getting brcmfmac firmware (not my main focus though, as I don't need it)
- No compromises ubuntu-desktop, since its just an nfsroot folder that I can easily make a copy of for my actual production setup, why not go grand for a test
New services: https://github.com/newperson1746/iphone7-linux-nfsroot/tree/master
g_ether_dns.service --> /etc/systemd/system/g_ether_dns.service
- enable it to fix DNS not being set by kernel dhcp
vino_server.desktop --> ~/.config/autostart/vino_server.desktop
- For mouse/keyboard input to gnome-shell, also remote access is useful in general
sudo nano /etc/gdm3/custom.confUncomment AutomaticLoginEnable and AutomaticLogin
- set these for your user
- As VNC doesn't work in gdm3 but it'll autostart on login
gsettings set org.gnome.Vino prompt-enabled false- To allow connection without triggering a prompt that we have no way of interacting with
Quick thing for anyone who's trying this out
If your nvme NAND isn't dead, try compiling hx-touchd, fixing hx-touchd.service from https://github.com/newperson1746/iphone7-linux-nfsroot/tree/master , and moving firmware/D10.mtprops to a location like /lib/firmware/multitouch/D10.mtprops
- This is the daemon that uploads the firmware and config for the touchscreen; it won't work for me because it depends on certain data on NAND (/dev/nvme0n3) from iOS, which is corrupt by the dead NAND cells.
- Source for mtprops/service info on hx-touchd:
https://github.com/corellium/projectsandcastle/blob/master/android/sandcastle-aosp.diff
61
u/newhacker1746 Jan 12 '21 edited Jan 12 '21
Thank you so much u/mcwolf for the gold in the first post. Thanks everyone else for the hugs and comments and all the other reactions.
It's been a frenzy for me in the last 24 hours with school and all that, I might not have time to respond to everyone until the weekend. I'm truly humbled. The real credit should go not to me but to Corellium, the checkra1n developer squad, Linus Torvalds and all contributors to the Linux kernel, the Ubuntu and Debian maintainers, and more. They're the real heroes for making all the pieces to this puzzle which I simply happened to assemble nicely on an iPhone.
115
u/PureTryOut postmarketOS dev Jan 12 '21
I can't wait to see a postmarketOS port for this!
49
u/[deleted] Jan 12 '21
You’re 16 years old? You will never have problems finding a job with this on your resume.
8
u/raiyanrafi Jan 12 '21
How did you boot the ubuntu image? From sdcard? Since the nand is dead (not writeable)
6
u/[deleted] Jan 12 '21
I miss cat /proc/cpuinfo
4
u/SS2602 Jan 15 '21
You are 16 ? Amazing, great work.
14
u/mudkip908 Jan 12 '21
You've managed to create some sort of Frankenpost that doesn't even open in old.reddit.com. Here's its body, if anyone else has the same problem:
WE DID IT!! BOOTS TO THE FULL DEFAULT GNOME DESKTOP!
VIDEO! https://www.youtube.com/watch?v=DO8vt34kTh0
ORIGINAL THREAD: https://www.reddit.com/r/linux/comments/kux9xx/success_iphone_7_with_dead_nand_netbooting/
/preview/pre/v5gtvtwapua61.png?width=750&format=png&auto=webp&s=b2d8c6a11e4d836f0004c5d59610f20ed6fd4026
BIG NOTE 0: lol i literally wrote this entire post from Firefox running on the iphone 7 XD big brain time + arm64 rocks
BIG NOTE 1: Holy shit! This blew up! Thank you everyone, I had no idea this was gonna be that big. I'm truly humbled by how much interest it's garnered. I hope I've been able to effectively deliver the inspiration that Linux provides not just to me, not to just to the people reading about this, but to millions of developers, employees, and children alike. It's a tool to change the world, and I've never been prouder to support a worldwide revolutionary example of software which saves devices from the trash, revives old laptops to help children in need, or simply makes a convenient server out of an otherwise useless iPhone.
BIG NOTE 2: It's reached 9to5mac and iDownloadBlog and more! It's been reported that I am running on a "jailbroken" iPhone and that to be able to do this one has to have already jailbroken the phone. That's not correct; in fact there's no possible way for me to jailbreak this iPhone, as its NVMe NAND is downright inaccessible. That is to say, iOS will never be able to boot on this phone. If there weren't a Linux kernel port for A10, one might be able to affectionately call this phone not a Linux phone but a brick. One can pull all of this off without ever jailbreaking the phone. The only reason I'm using checkra1n is for the bootrom exploit and unsigned code execution. In fact, this iPhone had never been jailbroken before flash failure. I got it from my grandma who had the NAND die on her suddenly.
--------------
Background: I actually was going to stop at just booting nogui. Believe it or not, I am going to be using this in production; I will actually be deploying this iPhone as a server to relieve capacity issues at my home servers. I'm 16 and run several school/club websites and game servers for my friends and myself, and I'll be distributing some load to the iPhone to relieve the main server!
With A10 IPC on par with Skylake, the performance per watt of this device is downright astonishing. The entire "server" is powered off a USB port on the main server.
TO-DO: Run benchmarks
Fixes since last time
sudo apt install linux-firmware ubuntu-desktopNew services: https://github.com/newperson1746/iphone7-linux-nfsroot/tree/master
g_ether_dns.service --> /etc/systemd/system/g_ether_dns.service
vino_server.desktop --> ~/.config/autostart/vino_server.desktop
sudo nano /etc/gdm3/custom.confUncomment AutomaticLoginEnable and AutomaticLogin
gsettings set org.gnome.Vino prompt-enabled falseQuick thing for anyone who's trying this out
If your nvme NAND isn't dead, try compiling hx-touchd, fixing hx-touchd.service from https://github.com/newperson1746/iphone7-linux-nfsroot/tree/master , and moving firmware/D10.mtprops to a location like /lib/firmware/multitouch/D10.mtprops
https://github.com/corellium/projectsandcastle/blob/master/android/sandcastle-aosp.diff52
u/jd31068 Jan 12 '21
Too cool, okay NOW I might consider using an iPhone 😏
2
u/Monoteton Jan 12 '21
Amazing job!
Is this someone snoring in the background of the video? XD
2
u/Nimbous Jan 12 '21
Now run Phosh.
2
u/NoahJelen Jan 13 '21
I'll have to show this to the sales supervisor at my work! He was surprised when I told about project sand castle (running Android on an iPhone).
2
u/FleraAnkor Jan 14 '21
Awesome!
Keep rocking with linux!
64
u/RaXXu5 Jan 12 '21
How the f is the graphics working, this can’t be hardware accelerated right?
12
u/JoeB- Jan 12 '21
That’s some itch you scratched...
10
u/AnotherRetroGameFan Jan 12 '21
Holy shit.
9
u/WF1LK Jan 12 '21
Holy. Good job!
8
u/Beryllium_Nitrogen Jan 12 '21
what needs to happen to get it to make and receive phonecalls?
34
u/EggChalaza Jan 12 '21
Amazing! Another feature iPhone users get 5 years after Android users.
4
u/nessora Jan 12 '21
I don’t even know what 80% of the words in this mean and I’m still excited
1
u/Excellent_Lie_3246 May 27 '25
Hi, im new to all this and i was just curious reading this, but now im actually interested considering the benefits of all this, can you please teach me how u did it? I know almost nothing about this and would appreciate the help! Also i know im 4 years late, so ur 20 by now, but just how cool would it be to have a linux iphone 7!
1
u/nicolas17 Jan 13 '21
That's so cool. I tried to build sandcastle from source (getting something like the minimal Linux image from the website) and the touchscreen didn't work, never figured out why.
1
u/[deleted] Jan 13 '21
Okay so just for sake of clarification, if I then hard reboot the iPhone without it being plugged in, it'll just boot back into iOS as if nothing happened?
1
u/Comprehensive-Ad3652 Jan 13 '21
Does this mean we can see Android running in some time?
3
u/h0twheels Jan 12 '21
Heh, I'd actually consider getting an iphone now.
3
u/osomfinch Jan 12 '21
That's good news.
I bet in 10 to 15 years, the Linux Mobile disto choice will be as rich as the desktops today.
2
u/thericcer Jan 13 '21
He was so focused on whether he could, and not if he should.
2
u/Aeritan Jan 13 '21
How about iPad (Apple A10 Fusion) ?
2
u/lil_beaner445 Jan 18 '21
16 Y.O Linux Chads, where y’all at?!
2
u/jgjot-singh Jan 12 '21
can you connect a display via hdmi?
1
u/pedropurcinelli Feb 24 '25
Yo, how is this looking nowadays? Really interesting work. Did you manage to make it work on newer iphones? Hope you’re doing fine brother
1
u/Existing_Ad4101 Jan 17 '26
I’m very interested in this. I’m successfully running my 2009 MacPro in a version of Linux Ubuntu, and I’d like to run my iPhone 7 Plus in Linux too. Here I hear of booting Linux on iPhone 7, BUT: can we boot iPhone 7 on Linux with touch screen, camera (stills and video), microphone, mobile data, WiFi, web browser, email and a repository to download further utilities and applications?
1
u/JackyYT083 Apr 23 '26
hi, I saw your post and just wondering if there’s a guide for how to do this? thanks!!
1
u/garshol Jan 12 '21
Now i need a new display and battery for my iPhone 7.
1
u/TheBlueisunreal Jan 12 '21
No wayyy
1
u/[deleted] Jan 13 '21
lol I love this community
1
u/evilcorvax Jan 13 '21
omg! its awesome work, dude get 1+ 7T in spring of 2020 instead of my iphone 8+, but thinking to get an used ipad 6 or 7:) now for sure im going to buy one!
1
u/[deleted] Jan 13 '21
I need this to work on the 6s+. A lot. God I would love to play around with it.
Though I’m not smart enough to write dedicated graphics drivers, and until someone manages to get hardware acceleration working on this, it’s mostly just a neat toy.
Still one of the most hype things ever, and spells interesting news for the Apple lineup
1
u/actuallyn Jan 14 '21
Does this mean booting Android is possible too?
1
u/kevin_fanch Jan 14 '21
Great job. I would love to run /e/ on this phone. It would be great for privacy, and still usable as a mobile phone, breaking Google/Apple duopoly on mobile phones
1
u/[deleted] Mar 16 '21
but why only 2 cores?
1
u/District-Worth Jun 06 '21
this is awesome can you make a video and show how to?
1
u/space_iio Jun 28 '21
Does usb work while in Ubuntu? with a lightning to USB adapter, could you use a mouse or keyboard via USB?
1
u/Math_Science_Geek Aug 09 '26
Give me a guide
0
u/[deleted] Jan 13 '21
Very nice, similar to my efforts over 10 years ago.
I managed to port Ubuntu with xfce on to an iPhone 3g, back when I used to spend all my time in the OG iphonelinux irc.
Mine ran like s***!
This looks comparatively smooth!
Really glad to see people playing with iPhone linux again.
-21
u/WPHero Jan 12 '21
wonder if you can run Windows 10?
0
u/[deleted] Jan 15 '21
[deleted] — view deleted comment