- How To Install a Linux OS On Your Android Phone
- What Is Root?
- Use Apps to Root Your Android Device
- BusyBox
- Linux Deploy
- VNC Viewer
- Install a Linux OS On Your Android Mobile Phone With UserLAnd
- AnLinux: простой способ установить Linux-окружение на Android-телефон без рута
- Что такое AnLinux?
- С чего начать?
- Что же, приступим
- А что с графической оболочкой?
- Linux on your smartphone: everything you need to know in 2021
- Raffaele T.
- Buying a Linux smartphone
- Hardware requirements
- Software requirements
- What are the Linux distributions for smartphones, and how should I choose one?
- Porting Linux to your device
- Conclusion
How To Install a Linux OS On Your Android Phone
Carry your desktop in your pocket
The general trend for technology is to become smaller and smaller. From desktops to watches, users see value in having a mobile computer without having to carry around a bag of wires and adapters.
This article will show you how to install a fully functioning Ubuntu Linux operating system (OS) on your mobile phone. The first method we will describe requires you to root your device.
What Is Root?
Android phones use Linux file-system ownership and permissions. The root is the superuser.
When you log into your device, there are certain functions you can perform on your phone based on user permissions. The root user or superuser has permissions to do anything to any file such as uninstall an application.
Before you can grant yourself superuser permissions, you must unlock the bootloader and install a custom recovery.
Rooting your device adds a standard Linux function that was removed by placing a small file su (switch user) with permissions in the system.
When you run a file without any other parameters, your permissions and credentials are switched from a regular user to a superuser with complete control.
Use Apps to Root Your Android Device
For this method, you will need to install three apps from the Google Play Store.
BusyBox
BusyBox gives your phone access to Linux commands that you wouldn’t typically have. It is necessary to enable many root apps to work.
Linux Deploy
Linux Deploy is an open-source program used to easily and quickly install Linux OS on your Android mobile phone.
It works by creating a disk image on a flashcard, mounting it, and installing an OS distribution.
Open the app to make sure you have root access (you should after installing BusyBox). Click the download button on the top or bottom right-hand side of your screen.
- You will now see the options menu. Leave most of the settings as the default. Under Properties: Linux, select your distribution.
- Change the flavor of Linux by selecting an option from the Distribution suite.
- Select the desktop you want under Desktop environment to change the look and feel of the app.
- Under the GUI setting, tick off Enable to ensure your device will have a graphical interface. Go into the GUI settings to change options such as the screen resolution.
- Under Properties, give yourself superuser privileged access by setting your Username to root.
To open the menu, click the three dots at the top right-hand side of your screen. Select Install and click OK to start installing the app on your phone.
The process takes a little time as it is installing the entire Linux distribution on your Android device.
After the installation is complete, click START to open fruit (a sub-compartment), then hit STOP when finished.
VNC Viewer
The final app to install is VNC Viewer. It will turn your Android device into a remote desktop and allow you to view the GUI.
Open the app, add a new connection, use localhost:5900 for Address, and click Create. This will open a new window for localhost. Click CONNECT.
Enter the password you set earlier when asked for Authentication and click Done. You will now be able to see Linux and use it.
Install a Linux OS On Your Android Mobile Phone With UserLAnd
Another way to install a Linux OS on your Android mobile phone is to use the UserLAnd app. With this method, there is no need to root your device.
Go to the Google Play Store, download, and install UserLAnd. The program will install a layer on your phone, enabling you to run the Linux distribution you choose.
Launch the app, we will choose Ubuntu, and then tap OK. Grant app permissions by clicking ALLOW.
Provide user login details. Enter a Username, Password, and VNC Password for the Ubuntu session, then tap CONTINUE > VNC > CONTINUE.
UserLand will download all the required assets for Ubuntu. The process will vary in length depending upon your Internet speed.
You will use this for VNC and ssh access. Wait for the installation to complete, progress will be displayed.
At this point, UserLAnd will download all the necessary assets for the Ubuntu session. How long the process takes will depend upon the speed of your connection.
When the installation is complete, you will be redirected to the Google Play Store to download bVNC.
Click Install, then Back to return to the UserLAnd app. Give permission to bVNC to access your files if asked and then click Allow.
If an option is available for Ubuntu, tap on it to start a Linux session. If there is no option, click on Sessions at the bottom of your screen, then tap the + sign at the top right-hand corner.
Name the new session Ubuntu > select apps:Ubuntu for Filesystem > choose ssh for Service Type > Done.
To launch a Linux session, tap Sessions on the bottom of your screen. The new session will open to a desktop environment.
To open applications, tap the start menu located at the bottom-left side of your screen. Install new Linux programs using the command terminal by tapping System Tools > LXTTerminal.
If you want to close the desktop, tap anywhere on your screen > the three vertical dots > Disconnect.
The methods above show you how to install a Linux OS on your smartphone. Linux is more flexible than Android by enabling users to perform functions such as advanced image editing, app development, and working in a real desktop environment.
The downside is that you are working on a tiny screen. However, if you want the ability to carry your desktop in your pocket, give it a try.
David has a background in small business and lives in Australia. He is a WordPress and Ubuntu Developer who enjoys design, CSS and tech tool integration. Read David’s Full Bio
Источник
AnLinux: простой способ установить Linux-окружение на Android-телефон без рута
Любой телефон или планшет, работающий на Android, — это устройство, которое управляется ОС Linux. Да, очень модифицированной ОС, но все же основа Android — ядро Linux. Но, к сожалению, для большинства телефонов опция «снести Android и поставить дистрибутив по своему вкусу» недоступна.
Поэтому, если хочется Linux на телефоне, приходится покупать специализированные гаджеты вроде PinePhone, о котором мы уже писали в одной из статей. Но есть еще один способ получить Linux-окружение практически на любом смартфоне, причем без root-доступа. Поможет в этом инсталлятор, который называется AnLinux.
Что такое AnLinux?
Это специализированное ПО, которое дает возможность использовать Linux на телефоне при помощи монтирования образа, содержащего root-файловую систему любого из дистрибутивов, включая Ubuntu, Kali, Fedora, CentOS, OpenSuse, Arch, Alpine и многих других. Инсталлятор использует PRoot для эмуляции root-доступа.
PRoot перехватывает все выполняемые пользователем вызовы, которые требуют в обычной ситуации root-доступа, и обеспечивает их работоспособность в обычных условиях. В PRoot используется системный вызов ptrace для отладки ПО, который помогает достичь цели. С PRoot все это можно сделать как с chroot, но без root-прав. Кроме того, PRoot предоставляет фейковый доступ пользователю для пседвофайловой системы.
AnLinux — небольшая программа. Но этого достаточно, ведь единственное ее предназначение — установка образов систем и запуск скриптов, поднимающих пользовательское окружение. Когда все сделано, пользователь получает вместо смартфона Linux-ПК, причем Android продолжает работать на фоне. Подключаемся к устройству при помощи VNC-вьювера или терминала, и можно работать.
Конечно, это не идеальный вариант «завести» Linux на смартфоне, но он вполне рабочий.
С чего начать?
Основное — Android-смартфон с версией ОС не ниже Lollipop. Кроме того, пойдет и 32-битное или 64-битное ARM или x86-устройство. Кроме того, потребуется солидный объем свободного файлового пространства. Для этого можно использовать карту памяти или просто устройство с большим объемом внутренней памяти.
Кроме того, потребуется:
- AnLinux (вот ссылка на Google Play).
- Termux (снова понадобится Google Play).
- VNC Client (VNC Viewer — хороший вариант).
- Bluetooth-клавиатура (опционально).
- Bluetooth-мышь (опционально).
- HDMI кабель для мобильного телефона (опционально).
Termux и VNC нужны для получения доступа к своему «компьютеру на Linux». Последние три элемента требуются лишь для того, чтобы обеспечить комфортную работу с телефоном и установщиком. HDMI-кабель нужен только в том случае, если пользователю удобнее работать с большим экраном, а не вглядываться в дисплей телефона.
Что же, приступим
Как только установлен Termux, получаем полноценную консоль. Да, рута нет (если телефон не рутован), но ничего страшного. Следующий шаг — установка образа для дистрибутива Linux.
Теперь нужно открыть AnLinux и затем — выбрать Dashboard из меню. Всего есть три кнопки, но выбрать можно лишь одну, первую. После этого появляется меню выбора дистрибутива. Можно выбрать даже не один, а несколько, но в этом случае понадобится большой объем свободного файлового пространства.
После выбора дистрибутива активируются две другие кнопки. Вторая позволяет загрузить в буфер обмена команды, необходимые для загрузки и установки Linux. Обычно это pkg, wget команды и скрипт для их выполнения.
Третья кнопка запускает Termux, так что команды можно вставлять в консоль. Как только все сделано, запускается скрипт, позволяющий загрузить окружение дистрибутива. Для вызова дистрибутива нужно каждый раз запускать скрипт, но установку проводим только один раз.
А что с графической оболочкой?
Если она нужна, то следует лишь выбрать меню для десктопного окружения и использовать больше кнопок — появится не три, а больше. Кроме самого дистрибутива, нужно выбрать еще и оболочку, например, Xfce4, Mate, LXQt или LXDE. В целом, ничего сложного.
Потом кроме скрипта, который запускает дистрибутив, потребуется еще один — он активирует сервер VNC. В целом, весь процесс простой и понятный, он вряд ли способен вызвать затруднения.
После запуска сервера VNC подключаемся со стороны клиента, воспользовавшись вьювером. Требуется знать порт и localhost. Все это сообщает скрипт. Если все сделано правильно, то пользователь получает доступ к своей виртуальной Linux-системе. Производительность современных телефонов на высоте, так что особых проблем не будет. Конечно, вряд ли смартфон сможет полностью заменить десктоп, но, в целом, все это работает.
Этот способ может пригодиться, если вдруг нужно срочно подключиться к серверу, а вы в машине, без ноутбука (конечно, в этом случае все описанные выше операции с AnLinux уже должны быть выполнены). Виртуальная Linux-машина позволяет подключиться к рабочему или домашнему серверу. А если в автомобиле по какой-то причине оказался дисплей и беспроводная клавиатура, то за считанные секунды в салоне можно организовать рабочий кабинет.
Источник
Linux on your smartphone: everything you need to know in 2021
Raffaele T.
One of the main issues with modern smartphones is the extremely short lifespan of this category of devices, which makes even high-end ones painfully slow within years. In fact, studies have shown that it takes the average European, American or Asian user less than two years to dump their old smartphone and buy a newer, more powerful (yet arguably very similar feature-wise) model.
This, however, is quickly changing thanks to projects like postmarketOS, bringing potentially lightweight Linux environments to new and old (also very old) mobile devices. While it is still early, in most cases, to have an usable Linux «daily driver» smartphone, this page should answer some of your questions regarding how Linux on smartphones work, whether your phone is likely to boot it properly and, if it does, how to choose a Linux distribution and whether it’s the case to switch now or to wait some months.
Do not forget that most of the procedures below might void warranty or cause temporary or permanent damage. Any content of this page is to be performed at your own risk.
2009 Nokia N900 running postmarketOS
Buying a Linux smartphone
Thankfully, getting your hands on a Linux smartphone in 2021 is much easier than it used to be. Many Librem 5s and PinePhones have already been shipped, and mature releases will probably be available for sale within this summer. We maintain a small list of native Linux smartphones that might be a good starting point if you are willing to buy one.
If, however, you are not ready to go for a full Linux smartphone yet, Can My Phone Run Linux? is a search engine for most known smartphones that can boot Linux. Make sure, however, to check the support level on the distro page in detail before getting one, as most features, like mainline kernel, modem and hardware acceleration are still not supported by most devices.
Hardware requirements
Sure, a lightweight Linux desktop environment might be much faster than most heavily manufacturer-customized Android spins, but there’s no black magic in «pure» Linux either. Which means that expecting to achieve more with your device than what the manufacturer initially designed it to is possible, but not very realistic. Especially if we consider that most smartphones are sadly not designed to be future-proof when it comes to their technical specifications, with tough competition for higher specifications every year leading to progressively heavier and slower OS releases.
Therefore, if your smartphone isn’t equipped with at least 1GB of RAM, 8GB of ROM (SD cards also count, but might be less reliable and slower especially on newer devices) and a 32-bit, 1GHz ARM CPU, the device will probably boot, but still be unsuitable for most kinds of smartphone features, such as desktop-like web browsing. In other words, anything older than 2012 will probably not render modern websites faster or more accurately than it did on its original OS. In case you are not willing to sacrifice Android applications, you should as well consider the relevant overhead of Android abstraction layers like Anbox.
In addition, you should make sure that your device’s mobile modem, GPU, power management and all kinds of hardware drivers you need are available on Linux. This step requires a minimum level of hardware and Linux knowledge, but for most users checking «what works» and «what doesn’t» from the wiki page of your device for the distribution you would like to install should already give a basic idea of the usability status.
If there is already a mature Android port for your smartphone, however, libhybris might allow Android drivers to run on Linux and get a GUI running quickly over it.
Software requirements
Another thing to remember is that running Linux on an iPhone or iOS device is almost impossible. Apart from the work-in-progress Project Sandcastle, there is currently no usable Linux distribution or porting for modern iDevices. Windows Phone devices that already received unofficial Android support, such as the Lumia 520, 525 and 720, might be able to run Linux with full hardware drivers in the future. In general, if you can find an open source Android kernel (e.g. via LineageOS) for your device, booting Linux on it will be much easier.
If your device is SIM-locked, you might want to unlock your device if possible before flashing Linux on it, as in some cases the necessary proprietary software handles for modem unlock codes might not be implemented in Linux.
You should also check if the bootloader for your device is unlocked, and if it isn’t, how the bootloader unlock procedure works, preferably from an official source (which means avoiding shady paid «unlocking services» unless you really have no other choice). If it is permanently locked by a carrier or manufacturer, or can’t be unlocked for whatever reason, you will not be able to run Linux or any other unsigned custom kernel on it, with the exception of limited chroot subsystems.
What are the Linux distributions for smartphones, and how should I choose one?
Several Linux distributions are specifically designed for smartphones, tablets and wearables, the most relevant of which are also listed on a dedicated page.
- Your best bet at the moment would surely be Ubuntu Touch by Ubports, which is the only distribution to provide a fully-functional Linux desktop environment with a relatively large app ecosystem. To check if your device is one of the lucky ones to be actively (and officially) maintained, you can check the Ubuntu Touch Devices section.
- Another Linux distribution which is currently in very active development is postmarketOS, which can boast a wide community of users and developers and over 250 booting devices (including smartwatches, x86 tablets and Raspberry Pi boards) at the time of writing. KDE enthusiasts will be happy to hear that postmarketOS is officially recommended by the Plasma Mobile website, and some of its main developers are also active members of its community. This, however, does not mean that postmarketOS is primarily KDE oriented: several Gtk desktops, including Purism Librem 5’s «Phosh«, are already fully working in postmarketOS on several devices.
Also the pmbootstrap tool makes porting postmarketOS to new smartphones easier than ever.
- Last but not least, if your device is one of the few supported ones (spoiler: few Xiaomi and Nexus phones only), you might consider trying LuneOS, a project that brings new life to HP WebOS, the futuristic HTML5-based, open-source iOS competitor that didn’t truly make it against the Android hegemony in the first 2010s. Still, chances are it’ll be lighter than most Android versions, while open source and fully respectful of your privacy.
Porting Linux to your device
postmarketOS live porting to Nokia 1If your device is currently not supported by any of the distros mentioned above, porting postmarketOS to it might be a relatively easy task, provided you have experience with compiling Android and Linux kernels, and possibly some minimal knowledge of the C programming language. And, of course, provided that there is already one stable Android or Linux kernel you can find the source code for. If you feel brave enough, you can check this guide from the postmarketOS wiki and start getting your hands dirty. And if you ever get stuck, you can always ask their community for help and guidance.
And if, by chance, you arrive to the point of getting the real, «mainline» Linux kernel and the device modem (calls, SMS, mobile data. ) to fully work on your phone, you might have just created one of the very few modern «true Linux» smartphones. But that’s clearly beyond the point of this article.
Live porting of Ubuntu Touch to Fairphone2Conclusion
As the brightest reader might have noticed, «real» Linux on most smartphones isn’t exactly mature yet. So is it worth installing on your daily driver? Probably not, unless it’s one of the few Ubuntu Touch or postmarketOS officially supported devices. But if you’ve got an older device that’s been sitting idle for years, why not experiment with software that might give it new life, without the limits of the OS it was originally released with? Testing and development is essential at a stage where Linux for smartphones is being more actively developed than ever.
You can follow TuxPhones on Twitter and Mastodon.
Источник