- Guide: Installing and Running a GNU/Linux Environment on Any Android Device
- Setting Up GNU/Linux on Android
- Step-by-Step Guide
- Installing Linux Applications
- Run Linux on Android Devices
- Linux Over Android
- How to Run Linux on Android Devices?
- Conclusion
- About the author
- Simran Kaur
- 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
Guide: Installing and Running a GNU/Linux Environment on Any Android Device
As many of you mayВ well be aware, the Android operating system is powered by the Linux kernel underneath. Despite the fact that both Android and GNU/Linux are powered by the same kernel, the two operating systems are vastly different and run completely different types of programs.
Sometimes, however, the applications available on Android can feel a bit limited or underwhelming, especially when compared to their desktop counterparts. Fortunately, you can get a GNU/Linux environment up and running on any Android device, rooted or non-rooted. (The following instructions assume a non-rooted device.)
For those power users on Android tablets, or other Android devices that have largeВ screens (or can plug into a bigger screen), the ability to run desktop Linux software can go a long way towards increasing the potential that an Android device has for productivity.
Setting Up GNU/Linux on Android
To get a GNU/Linux environment set upВ on your Android device, you only need to install two applications from the Google Play store:В GNURoot Debian and XServer XSDL.В After you do that, you will only need to run a small handful of Linux commands to complete the installation.
GNURoot Debian provides a Debian Linux environment that runs within the confines of the Android application sandbox. It accomplishes this by leveraging a piece of software called proot, a userspace re-implementation of Linux’s chroot functionality, which is used to run a guest Linux environment inside of a host environment. Chroot normally requires root access to function, but by using proot you can achieve similar functionality without needing rootВ privileges.
GNURoot comes with a built-in terminal emulator for accessing its Debian Linux environment. This is sufficient for runningВ command-line software, however, running graphical software requires an X server to be available as well. The X Window System was designed to have separate client and server components in order to provide more flexibility (a faster, more powerful UNIX mainframe could act as the client to X server instances running on much less powerful and less sophisticated terminals).
In this case, we will use a separate application, XServer XSDL, that GNURoot applications will connect to as clients. XServer XSDL is a complete X server implementation for Android powered by SDL that has many configurable options such as display resolution, font size, different types of mouse pointer behavior, and more.
Step-by-Step Guide
1. Install GNURoot Debian and XServer XSDL from the Play Store.
2. Run GNURoot Debian. The Debian Linux environment will unpack and initialize itself, which will take a few minutes. Eventually, you will be presented with a “root” shell. Don’t get misled by this – this is actually a fake root account that is still running within the confines of the Android application sandbox.
3. Run apt-get update and apt-get upgrade to ensure you have the most up-to-date packages available on your system. Apt-get is Debian’s package management system that you will use to install software into your Debian Linux environment.
4. Once you are up-to-date, it’s time to install a graphical environment. I recommend installing LXDE as it is simple and light-weight. (Remember, you’re running Debian with all the overhead of the Android operating system in the background, so it’s best to conserve as many resources as you can.) You can either do apt-get install lxde to install the desktop environment along with a full set of tools, or apt-get install lxde-core to only install the desktop environment itself.
5. Now that we have LXDE installed, let’s install a few more things to complete our Linux setup.
• XTerm – this provides access to the terminal while in a graphical environment
• Synaptic Package Manager – a graphical front-end to apt-get
• Pulseaudio – provides drivers for playing back audio
Run apt-get install xterm synaptic pulseaudio to install these utilities.
6. Finally, let’s get the graphical environment up and running. Start XServer XSDL and have it download the additional fonts. Eventually you will get to a blue screen with some white text – this means that the X server is running and waiting for a client to connect. Switch back to GNURoot and run the following two commands:
Then, switch to XServer XSDL and watch the LXDE desktop come up onto your screen.
I recommend putting the above two commands into a shell script so that you can easily restart LXDE if you close the session or if you need to restart your device.
Installing Linux Applications
Congrats! You’ve successfully gotten Debian Linux up and running on your Android device, but what good is running Linux without apps? Fortunately, you’ve got a massive repository of Linux applications at your fingertips just waiting to be downloaded. We’ll use the Synaptic Package Manager, which we installed earlier, to access this repository.
Click the “start” button at the lower-left hand corner, click Run, and then type synaptic . The Synaptic Package Manager will load. From here, simply press the Search button at the top and then type the name of the application you’d like to install. Once you’ve found an application, right click it and select “Mark for Installation”. When you are finished marking packages, click the Apply button at the top to start the installation. Uninstalling packages follows the same procedure, except by right-clicking and selecting “Mark for Removal” instead.
Of course, since this isn’t a real Linux installation but rather a Linux environment running on top of, and within the constraints of, Android, there are a couple of limitations to be aware of. Some applications will refuse to run or will crash, usually due to the fact that some resources that are usually exposed on GNU/Linux systems are kept hidden by Android. Also, if a regular Android app can’t do something, then usually a Linux application running within Android can’t as well, so you won’t be able to perform tasks such as partitioning hard drives. Lastly, games requiring hardware acceleration will not work. Most standard everyday apps, however, will run just fine. Some examples include Firefox, LibreOffice, GIMP, Eclipse, and simple games like PySol.
I hope that you find this tutorial useful. While I personally performed these steps on my Google Pixel C, you can do this on most Android devices. Preferably on a tablet device with access to keyboard and mouse peripherals, of course. If you already run a GNU/Linux distribution on your Android device, let us know what you are using it for below!
Источник
Run Linux on Android Devices
You can optimize your Android device for the Linux features like powering the LAMP server, troubleshooting tool, use your device as a portable network, and pen-testing device. Linux gives you good performance and good UI so that you can do anything you want to do. In case you are looking for a way to install and run Linux on Android devices, there are actually several options for it.
If you want to run any application that is not available on Android, you can go for Linux because it is a good way to access any application. Currently, Android devices offer an ideal system so you can easily run Linux on Android devices. In case you are looking to improve multitasking, you should go for the recent version of Android, but if you want to enhance the feature quality and performance, you should go for Linux.
Linux Over Android
Android is created on the Linux Kernel, a software stack that interfaces with your device’s hardware. There is no doubt that Linux offers more flexibility than Android because you can do so many things on Linux that you can’t do on Android. Linux offers more app development features, such as working in a real desktop environment and advanced image editing.
The smartphone’s little form factor makes it hard to mold an entire desktop GUI on the small screen. It would help if you used the finger for moving the mouse cursor, and you can’t use the phone app while your Linux desktop is running.
How to Run Linux on Android Devices?
Linux can be installed by rooting your device like tablets, TV boxes, or phones. You may also easily run the Linux desktop e without rooting it. So you have two choices to run Linux on Android devices, and it is totally up to you. This is mostly the case in the Android environment. Apart from it, you can also install the Linux command-line tool on your Android device.
You can run Linux on Android devices by the process given below:
1. On a rooted Android device by:
- using Linux Deploy
- installing Kali Linux for penetration testing
2. On a rooted Android device by:
Let’s see the complete details and procedure to run Linux on Android devices.
How to Run Linux on Android Devices (For Rooted Devices)?
If you have a rooted device, then install BusyBox that offers some improved root abilities.
First, you have to install and tap Start to ensure that all root permissions are enabled and then tap on the Settings from the bottom-right corner.
Second, follow the options menu for selecting the preferred Distribution. You will see Debian, Ubuntu, Gentoo, Fedora, etc. that are available for installation. In this case, Arch Linux is used for further operations.
Third, you have to check that Enable box, which is located below GUI for viewing Linux desktop on an Android phone. Additionally, you need to ensure VNC is also selected for all graphics subsystems.
Fourth, check screen resolution below GUI settings, make sure that the Desktop environment is appropriate.
Fifth, find the username and password section and save those details.
Sixth, come back to the menu and tap on three dots, then select install, and click OK.
Finally, after completing this process:
- Install VNC Viewer (you can download it by Play Store).
- At the Linux Deploy, tap on the Start for running Linux.
- Then open VNC Viewer, connect to localhost:5900 to view the Linux desktop with credentials you have entered earlier.
How to Run Linux on Android Devices (For Unrooted Devices)?
This process of installing Linux on an Android device is done through Ubuntu.
First, download and install UserLand in the Play Store, then start this app.
Next, tap on the Ubuntu, then OK, and tap on Allow for granting all of the required app permissions.
After that, for the Ubuntu session, enter the Username, Password, and the VNC Password, then tap on Continue.
Then, select the VNC and tap on Continue. The UserLAnd will download the required assets for your Ubuntu session (you can use Wi-Fi because it will take a high amount of data and speed to be downloaded).
After downloading all of the required files, you will be redirected to your Play Store, where you need to download and install bVNC: Secure VNC Viewer.
Once you downloaded bVNC, press the Back button to return to UserLAnd (in case bVNC requires any permission, tap on Allow to do it).
Now, on the bottom of your screen, tap on the Plus(+) icon at the upper-right corner. In case you see the option for Ubuntu, tap on it to start your Linux session.
Once you’re done, name this session “Ubuntu”. Now, select apps: Ubuntu by the file system drop-down menu, then choose SSH for your Service Type. At last, tap on the Save to save all the details.
Finally, tap on the Sessions and Ubuntu for launching the Linux session.
Conclusion
In this article, we have offered complete information on how to run Linux on Android devices. Based on what we have previously discussed, there is no doubt that Linux offers more flexibility than Android because you can do so many things on Linux that is not possible on Android. Linux offers more app development features, such as working in a real desktop environment and advanced image editing.
This article contains the Linux installation process for both rooted and unrooted devices so that you can run Linux on any android device. Apart from those, it informs you of some factors that can also help you understand why you should go for Linux instead of Android if you wish to perform different tasks without any trouble.
About the author
Simran Kaur
Simran works as a technical writer. The graduate in MS Computer Science from the well known CS hub, aka Silicon Valley, is also an editor of the website. She enjoys writing about any tech topic, including programming, algorithms, cloud, data science, and AI. Travelling, sketching, and gardening are the hobbies that interest her.
Источник
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.
Источник