iSH is an active project to run a Linux shell on iOS. Offers an Alpine Linux environment, complete with the apk
packaging manager. The application is based on x86 emulation in user mode.
You can download iSH from the App Store. The new facilities include a apk
default. Existing users of the app may need to install it manually apk
following the steps in the documentation.
Starting
Get started by installing iSH from the App Store. Launch the application and you will be sent directly to an Alpine Linux terminal environment.
You can start running familiar Linux commands!! You can use all the Unix utilities provided by BusyBox, including cat
, grep
, ls
, sed
Y wget
.
iSH provides its own keyboard icon strip to simplify the use of the touchscreen terminal. The four buttons to the left of the strip are Tab, Control, Escape and arrows respectively. Slide the arrow key button in the direction you want the cursor to navigate.
The three buttons on the right open the configuration interface, paste text from iOS clipboard and hide keyboard. Tap anywhere to retrieve the keyboard after hiding it.
ISH Settings
The Settings menu allows you to customize some options. The Appearance page enables you to determine the font and switch between light and dark themes. On the app icon page, you can select from various app icons. This option enables you to match iSH with the visual style of the other apps on your iOS home screen.
The external keyboard lets you control how iSH should handle a physical keyboard connected via Bluetooth or a USB adapter. At the same time from the built-in iOS remapping alternatives, you can reassign option and tilde keys to meta iSH and escape keys. You can hide the iSH icon strip when using an external keyboard by enabling the settings “Hide with external keyboard”.
File systems
iSH supports the use of multiple file systems. Go to the page “File systems” in the settings menu to manage them. To start, you will see a single filesystem “predetermined” containing Alpine's built-in installation.
Press “Find files” to open the file system in the iOS Files app. This helps you quickly copy files from iSH to other locations on your iOS device..
You can export the entire file system with the option “To export”. File systems can be imported into iSH using the button “to import” on the main File Systems page.
The practical use case for file systems enables you to run multiple standalone installations. At the moment, only minimal Alpine images similar to iSH original will work.
You can try Alpine’s “Mini root filesystem” – download it, import it and hit "Boot from this file system" to restart iSH using the file system. Return to the default file system by selecting your menu entry and again selecting “Boot from this file system”.
Add packages
You can use regular apk
commands to manage packages in your iSH environment.
# Update the package lists apk update # Upgrade existing installed packages apk upgrade # Install SSH apk add openssh # Remove SSH apk del openssh
Note that iSH uses its own package repositories by default. This makes it possible for the app to pass the App Store review making sure it is absolutely autonomous..
you can change to official Alpine Linux repositories if you prefer. This gives you access to the full list of Alpine software. Many packages will have newer versions in the main Alpine repositories than those offered in the iSH repositories..
grep -v "file:///ish/apk/" /etc/apk/repositories | dd of=/etc/apk/repositories bs=4194304 echo https://dl-cdn.alpinelinux.org/alpine/v3.12/main >> /etc/apk/repositories echo https://dl-cdn.alpinelinux.org/alpine/v3.12/community >> /etc/apk/repositories
Run the above commands to replace the iSH content /ish/apk
pseudo-file system with the repositories offered by Alpine Linux. Then you will need to run apk update
to get the new package lists.
Using SSH
You can install OpenSSH with apk add openssh
.
The client will work immediately, try ssh me@myserver
.
To use your iOS device as an SSH server, run the following commands:
ssh-keygen -A passwd echo "PermitRootLogin yes" >> /etc/ssh/sshd_config sshd
This will generate SSH host keys and ask you to set a password for the root
Username. the sshd
executable is invoked to start the SSH server. You will now be able to connect to your device as the root
Username.
iSH does not support auto-start services by default. You can configure this editing the third line of /etc/inittab
in order to ::sysinit:/sbin/openrc
. Next run rc-update add sshd
for the ssh server to start automatically when you start an ish session.
Running a web server
As seen in the SSH example, iSH uses your device's network stack. You can host a web server that you can browse on your other devices.
To run apk install apache2
to add Apache. Use httpd
to start the Apache procedure. Next, visit the IP address of your iOS device in a web browser; you should see the default Apache message “It works!” text.
Today, iSH does not support background execution. This means that you cannot switch to Safari and browse its web pages while using an iPhone.. In an iPad, it is feasible to open a browser in split view: iSH remains active on your side of the screen.
Apache can be configured as frequently. You will find its configuration file in /etc/apache2/httpd.conf
. The default document root, from where the web pages are served, it is /var/www/localhost/htdocs
.
Now what?
You are now running an Alpine Linux environment on your iOS device. Add the packages that make sense for your work. There is a growing list of job software including Unix staples and full programming languages. Node.js, Python, PHP, Ruby and Git are operational.
Despite this, not all packages will work. Software that makes system calls that have not been translated will be blocked. How iSH is an emulator, performance may also be below average at times.
You can run a VNC server if you want to use graphical applications. Detailed steps are provided in the Wiki the iSH. Performance limitations will clear up with a graphical workload, but it is technically feasible. The procedure involves installation xorg-server
, configuring a headless configuration and subsequently adding a .xinitrc
file to set the window manager to be used. You will get the best results with a lightweight window manager like i3
.
Conclution
It looks like iSH will become a must-have iOS app for developers and sysadmins. There are already quality applications such as as hell that provide basic Unix tools, as well as SSH clients like Termius which enables you to connect to a remote Linux machine. Despite this, iSH is the most comprehensive answer so far, since it offers a Linux environment that supports a growing list of popular software.
With iSH on your iPhone or iPad, you can use the familiar x86 Linux software wherever you are. Pair it with an external keyboard and you have a portable productivity device that could truly replace your laptop..