Setting up Raspberry Pi to work with your M1 iPad Pro

Setting up Raspberry Pi to work with your M1 iPad Pro

After buying my M1 iPad Pro, I decided to use it for more of my work. However, there are many limitations that Apple has on the iPadOS that makes it very painful to work on the iPad even though it clearly has as much power (if not more) as existing laptops. So I decided to get a portable local server where I can do some local development on. Enter the Raspberry Pi.

In this article, I would document how I got the iPad connected to the Raspberry Pi and how I use it for my local development. Since I got the Raspberry Pi 4, the article will refer to this particular device, but I think it is also applicable for other Pi versions.

Setting up the Raspberry Pi

The first thing to do will be to set up the Raspberry Pi by installing an operating system. For me, I decided to go with the Raspberry Pi OS 64bit version that is still in beta, but you can choose whatever version you want. Just note that this is based on Raspberry Pi OS and other operating systems may require different steps.

First, you need to download the Raspberry Pi imager for your computer. Connect your Pi's SD card to your computer and start the imager software.


Choose the OS to load into the SD card and select the SD card as the storage device, then click "Write". After this is done, safely eject the SD card drive from your computer then reinsert it again.

Next, open the Terminal app and run the following commands in there:

# Creates a new SSH file in the drive
$ touch /Volumes/boot/ssh

Next, if you want to be able to connect the Pi to the internet using WiFi, run the following command:

$ nano /Volumes/boot/wpa_supplicant.conf

and in the new text field, paste the following code:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev


Replace DE with your country short code e.g NG for Nigeria, WIFI_NAME and WIFI_PASSWORD with the appropriate values and then save the file. Now you can eject the SD card drive and insert it into your Raspberry Pi.

Connecting the Raspberry Pi to the M1 iPad Pro

Now that we have added the boot drive to the SD card, we can now boot up the Pi. Connect the Raspberry Pi to your iPad Pro using a supported USB-C cable as not all USB-C cables will work. Give the Pi about 2 minutes to fully boot up and connect to the WiFi.

Using an SSH client for the iPad, like Blink, connect via SSH to the Pi.

$ ssh pi@raspberrypi.local

The default password is raspberry but be sure to change that later. You can use sudo raspi-config for this or follow a guide online.

Next, lets update Pi OS

$ sudo apt update
$ sudo apt upgrade -y

Activating Ethernet Connection from the Raspberry Pi to the iPad Pro

Right now, the iPad Pro really just serves as a power source to the Pi. If we want to make a local connection from the iPad to the Pi as an Ethernet provider, we need to prepare the Pi for this.

First, let's install DNSMasq on the Pi:

$ sudo apt install dnsmasq -y

Next, let's add some configurations to the Pi. First let's make sure the files have the correct execution rights:

$ sudo chmod ugo+rwx /boot/config.txt
$ sudo chmod ugo+rwx /boot/cmdline.txt
$ sudo chmod ugo+rwx /etc/modules
$ sudo chmod ugo+rwx /etc/dhcpcd.conf

Next, open (or create if not existing) the files one after the other and insert the lines below into the files respectively:

# In /boot/config.txt add the following to the end of the file

# In /boot/cmdline.txt add the following to the end of the file (make sure there is a space between the existing commands and this)

# In /etc/modules add the following to the end of the file

# In /etc/dhcpcd.conf add the following to the end of the file
denyinterfaces usb0

Next, create the following files and add the following content

$ sudo nano /etc/dnsmasq.d/usb

then in the file add:


Next file we will create will assign a static IP address which you will use to SSH locally to your Pi from the iPad:

$ sudo vim /etc/network/interfaces.d/usb0

then add into the file:

auto usb0
allow-hotplug usb0
iface usb0 inet static

Next file,

$ sudo vim /root/
$ sudo chmod +x /root/

then add into the file:

cd /sys/kernel/config/usb_gadget/
mkdir -p pi4
cd pi4
echo 0x1d6b > idVendor # Linux Foundation
echo 0x0104 > idProduct # Multifunction Composite Gadget
echo 0x0100 > bcdDevice # v1.0.0
echo 0x0200 > bcdUSB # USB2
echo 0xEF > bDeviceClass
echo 0x02 > bDeviceSubClass
echo 0x01 > bDeviceProtocol
mkdir -p strings/0x409
echo "fedcba9876543211" > strings/0x409/serialnumber
echo "John Doe" > strings/0x409/manufacturer
echo "PI4 USB Device" > strings/0x409/product
mkdir -p configs/c.1/strings/0x409
echo "Config 1: ECM network" > configs/c.1/strings/0x409/configuration
echo 250 > configs/c.1/MaxPower
# Add functions here
# see gadget configurations below
# End functions
mkdir -p functions/ecm.usb0
HOST="00:dc:c8:f7:75:14" # "HostPC"
SELF="00:dd:dc:eb:6d:a1" # "BadUSB"
echo $HOST > functions/ecm.usb0/host_addr
echo $SELF > functions/ecm.usb0/dev_addr
ln -s functions/ecm.usb0 configs/c.1/
udevadm settle -t 5 || :
ls /sys/class/udc > UDC
ifup usb0
service dnsmasq restart

Change John Doe to your name and PI4 USB Device to whatever you want.

Next, add sh /root/ to the /etc/rc.local file, right before the exit 0 line. Now we can reboot the Raspberry Pi:

$ sudo reboot

After rebooting your Raspberry Pi, it will show up as a ethernet device with an IP and will assign the device you plug it into an IP address via DHCP.

iPad Ethernet Raspberry Pi

Connect the Pi back to the iPad and in Blink, run the command:

$ ssh pi@

If you are also trying to use HTTP, you can access this IP from Safari with whatever port your Pi's HTTP exposes.

Optional: Activating VNC

If you are using the Desktop version of the Raspberry Pi OS then you might benefit from using a VNC to connect to the frontend of the Raspberry Pi. To activate VNC, run the following command:

$ sudo raspi-config


Navigate to Interfacing Options > VNC and turn it on to enable this feature. Another thing you can update is your Localisation Options.

Hopefully, you are able to set up your Pi and use it for some local development after this.