We install a Linux distribution on an Android phone and tablet. Linux or Android - which is better on TV? How to run Linux on Android (detailed description)

Televisions have long ceased to be a simple screen for broadcasting images from an antenna. Now they are a rather complex and multifunctional device. For a long time now on TV you can view various sites, include videos in open access and even play games. For this, almost everyone modern TVs Smart TV technology is present. This technology is based on existing OS. These can be either existing operating systems or manufacturers’ own developments. Of the most popular operating systems, two can be distinguished: Linux and Android.

Linux OS

This operating system for Smart TV is a remake of the OS of the same name for PCs. Development Sony allows you to watch videos and surf the Internet with high quality. It is also possible to install additional applications from the available directory. The downside is that, unlike a similar system on a PC, this OS does not have the same flexibility. On such a Smart TV you cannot install third-party applications and various extensions not provided by the developer. There is also a problem with updating applications. However, this can also be a plus, since closed code allows you to protect users from various kinds of interventions and risks of incompatibility and incorrect operation.

Android OS

This system is the most popular because it is easy to learn and universal. On a TV with this OS you can install almost any application and run many games. The list of applications is the same as on modern smartphones. Both operating systems are almost the same and are interchangeable.

The downside may be certain risks that arise if the user decides to install applications from third-party developers. And, although the system warns about possible instability when installing applications not provided by the manufacturer, users often carry out this procedure and encounter various kinds of difficulties.

Android OS is an open source system, which creates a lot of opportunities for attackers. Installation third party applications At best, it may result in the fact that the installed option will not work correctly or will not work at all. IN worst case the TV may simply turn into a “brick”, losing its functionality. In this situation, only the help of specialists can come to the user’s aid.

What's better?

Both Linux and Android systems provide the user with a lot of possibilities, turning the TV into a kind of computer with a lot of options. When choosing a TV OS, the user should decide what is more important to him: versatility or reliability.

Android OS provides the owner with much more opportunities than Linux, however, these opportunities are accompanied by risks, especially for users unfamiliar with the world of technology. Linux on the TV, in turn, allows the owner to enjoy all the main advantages of Smart TV, without the risk of catching malware or damage the TV. However, many features are limited by developers, and some options are not available to users of this particular operating system.

As an inveterate lover of OS Linux, I would of course like to have a phone with this operating system. But unfortunately you can’t find such a phone in a store. But still there are craftsmen who manage to install Linux on the phone.

To do this, they create special firmware, usually for specific model phone. In this case we have regular phone, where you can buy spare parts if you need anything, and if something doesn’t work, return the phone to its original appearance.

What phone models can, for example, install Linux on? The website www.linuxmobile.org has firmware for at least several models. These models can be equipped with firmware based on Android. If you didn't know, Android is also Linux.

What phones can you install it on? Linux?

Motorola Atrix Motorola Razr HD Cyanogen Mod 10 Cyanogen Mod 9 Cyanogen Mod 7

Perhaps one of these models is in your store and you can buy this phone and install Linux on it. How will it look like? This is what stripped down Android looks like Linux on the phone:

Of course, the developers warn that you use these firmwares at your own risk, and this is understandable. But on the other hand, would an ordinary user undertake to install Linux on a phone? He simply doesn’t need it, this is the lot of people who are well versed in the topic. Yes, it would be great to install on mine old phone Linux, it's a pity it's not on the list...

Linux on a tablet - is it worth installing?

Linux on a tablet is the dream of many Linux lovers. I wrote some time ago that they had already made a tablet with Ubuntu, but so far in small quantities and buy a tablet with Linux today is not so easy. But this is just the beginning, as there is no doubt that there will be new products in the future mobile phones and tablets will increasingly use Linux on their devices. But today everyone can install Lynx on a tablet, if they are comfortable with Linux, of course.

The first question that arises for those who want to load Linux on a tablet is the question of which Linux to install? Here you should immediately take off your rose-colored glasses: any Linux that you install on regular computer, cannot be installed on the tablet.

The fact is that most tablets today are made based on processors that have an ARM structure. Therefore, the easiest option to install Linux on your gadget is to buy a tablet with the usual x86 architecture. Finding such a tablet is not difficult, since it will most likely have Windows 7 or something similar pre-installed on it. By purchasing such a tablet, you can install any Linux on it.

But finding such a tablet today is not so easy, and even if you find it, you may not like it in appearance or characteristics.

Running Linux on Android

What is the way out? And there is only one way out: find OS Linux, which has already been ported to ARM processor. There are not many such developments today, and one of the options is Kali Linux. But this is only one of the options. If you type in search engine the phrase “Linux ARM”, you can see which Linuxes are already running on this processor. Here are some of them:

Arch LinuxARM Debian Linux on ARM Ubuntu Linux on ARM Gentoo Linux on ARM

So you have a choice and you can try installing Linux on your tablet. But I have a question: are there enough ports of Linux programs for this platform? Is the game worth the candle? After all, it’s not enough to just port Linux; it’s also important to port applications for it.

In general, I admire the abundance of applications for Android, which are no less numerous than for Linux. And I would like to see many of them in Linux. But won't it turn out that by installing Linux on my tablet, I will deprive myself of this variety of applications that Android has?

In general, you need to think a thousand times before installing Linux on your tablet. Maybe his time has not come yet?

18+ © Seclub.org 2003-2018

In this article we will tell you in detail how to install Linux to an Android device. For installation and full operation alternative system you will need: a smartphone or tablet, a software emulator, root rights and several gigabytes of free space.

1. Installation applications complete linux installer

Enter into the menu Google search Play the word “emulator” and get a list of several dozen approximately identical utilities. They are all good, but we focused on the Complete Linux Installer application. It is completely free, perfectly localized and equipped with detailed instructions for beginners.

The program can be downloaded from http://goo.gl/5C6Xa. The installation algorithm for Complete Linux Installer is no different from installing any other software, so we will not dwell on this point.

2. Working with the Complete Linux Installer application

Before starting to work with the program, I would like to emphasize once again: what we are describing in this article is not installing Linux instead Android, but emulation of the operation of one system in another.

So, we launch the application and agree to install additional software components. It is working with these modules that will subsequently make it much easier for you to use the operating room. Linux systems.

As mentioned earlier, Complete Linux Installer requires root rights to fully function, which the application will remind you of in a pop-up window.

We provide the program with full access to the system functions of the mobile device.

This completes the initial preparation of the emulator for work. The main application menu will open in front of you. Go to the sub-item “Installation Guide”.

The emulator will scan the hardware of your gadget and display a list of operating systems that are guaranteed to run on your mobile device. We choose Ubuntu 13.10 as an example.

From this moment on, the program begins to “guide” you through the stages of installing the operating system, accompanying each necessary action detailed instructions. For example, after reading the emulator requirements in the first step, be sure to install “Terminal” and “VNCViewer” in the second. Only after this select “Download image”.

Read the description of the differences between distributions of the Linux operating system and choose the one you need.

Create at the root external storage gadget folder with the name of the future system. This will make the search much easier for the program. necessary files. In our case, we create the “ubuntu” directory. Unpack the downloaded archive into this folder.

As a result, two files should appear in the “ubuntu” directory. One of them is with the .img extension.

Is it possible to install Linux on a phone?

This is the image of the Linux system being launched.

After completing these steps, go to the “Launch” sub-item of the main menu of Complete Linux Installer and click the “Settings” auxiliary menu in the upper right corner of the window. By selecting the “Edit” option, provide the application with the full path to the system executable file. Confirm your choice by clicking on the “Save Changes” button.

This completes the next stage of installing an alternative operating system into the memory of your gadget. Feel free to select the “Run Linux” option.

Application in background will launch a terminal to execute test commands and request root access to the device’s system functions. We allow it.

Now your smartphone or tablet will be able to work as an emulator of the Linux operating system and you will have access to all the capabilities of the operating system with a penguin on the logo - from executing simple commands in the terminal to installing a full-fledged graphical environment. Linux installation on Android is complete.

Why :

So this is so that you clearly understand the difference between an actively developing system in a relatively highly profitable market and a decaying platform for hairdressers.

It’s just that Android has a lot of things and actively uses interfaces in the form of file systems.

Happenes.

Is it possible to install Linux on a phone?

Development always comes through mistakes.
Maybe just not do this?

Yes, anywhere. This is more of an android question than a unix forum question. The absence of lines in fstab does not prohibit mounting simply by command.

Sick of Android? Don't want to be in a private ecosystem? Security and privacy are becoming increasingly important to smartphone users, but what is the answer?

Is it possible to abandon Android and iOS in favor of another mobile operating system?

If you need an alternative operating system, Linux is usually the answer. But which Linux operating systems for smartphones are available to install today?

1. Ubuntu Touch

Ubuntu Touch

Originally released by Canonical developers, Ubuntu Touch is currently supported by UBports. This means that the abandoned Ubuntu Touch mobile operating system lives on.

Ubuntu Touch's approach to smartphones is smart, dealing with the lack of apps by providing social, news and photo tools natively. This is done under the guise of areas, different home screen pages that provide customizable news, weather, apps and social media.

All this works well, although there are always missing applications.

The greatest strength of Ubuntu Touch is convergence.

This is a system very similar to Microsoft Continuum and , in which a mobile device is connected to a monitor, keyboard and mouse and used as a desktop computer. The only real difference between this and desktop Linux devices is that the phone has an ARM processor.

Currently supported devices include phones that have Ubuntu Touch pre-installed, as well as OnePlus One, Fairphone 2 and Nexus 5 (Hammerhead). Many others are in active development, such as OnePlus 2 and OnePlus 3.

2. Sailfish OS


Sailfish OS

Co-developed by Jolla, Mer (middleware stack developer), Sailfish Alliance (a group of corporations) and community members, Sailfish OS is a continuation of the abandoned MeeGo operating system based on Maemo and Moblin.

The latest version of Sailfish OS is known as Sailfish X, which runs on devices Sony Xperia X. Unfortunately, Sailfish OS does not have open source code, A free version is limited in time.

The full version of Sailfish X will set you back around $50 and is only available in the European Union, Norway and Switzerland. As noted on the website:

“...use of our website and Sailfish X purchase services outside of Authorized Countries is prohibited.”

Sailfish OS has support for Android apps, so if those calls, this OS is worth a try.

3. Plasma Mobile

Plasma Mobile

One of the best options is Plasma Mobile, which is aimed at smartphones. Plasma itself is considered one of the best Linux desktop environments.

Having received a lot of attention throughout 2017 (mostly due to Ubuntu's abandonment of Ubuntu Touch), Plasma Mobile's goal is to become "full and open software system for mobile devices."

Currently compatible with Nexus 5 (Hammerhead) and OnePlus One, Plasma Mobile (based on Kubuntu) is also available for PCs and tablets on Intel based, thanks to the Arch Linux-based version.

There is also multiROM support for the Nexus 5 (Hammerhead), allowing you to run Plasma Mobile alongside your preferred custom Android ROM.

Perhaps the best thing about the Plasma Mobile project is that you can run Plasma desktop apps and widgets, as well as Ubuntu Touch apps. This gives the project a wider selection of applications than Ubuntu Touch.

Other mobile Linux projects

As of this writing, there are three other notable Linux mobile projects to note:

Halium

The goal of Halium, conceived as a system to improve future mobile projects Linux, "to unify the hardware abstraction layer for projects running GNU/Linux on mobile devices with Android pre-installed."

There is also an intention to standardize other software and improve Linux access to audio, camera, GPS and other equipment.

If this project is successful, installing Linux on smartphones will be greatly simplified.

PureOS

A more complete project comes in the form of a mobile version of PureOS, Purism's privacy and security-focused Linux distribution.

There's currently no way to download PureOS for mobile devices, but Purism's first phone, the Librem 5, will be released in 2019. It will be the most secure and private mobile device, much of it will be powered by the PureOS operating system.

postmarketOS

Describing itself as a “true Linux distribution on a phone,” postmarketOS (pmOS) is Alpine's version of Linux for smartphones.

Currently in early development, the goal of pmOS is to create a stable mobile OS with long-term support.

pmOS can run a large number of devices, including Amazon Fire HDX, Google devices Nexus and phones and samsung tablets Galaxy.

However, at this early stage of pmOS development, few of these devices have a full feature set. However, by offering multiple desktop environments, the pmOS project looks good enough to fulfill its goal of creating a long-term sustainable Linux-based mobile operating system.

Applications that install Linux on Android

If you're desperate to have Linux in your pocket but don't have any of the devices listed above, there are alternatives.

They allow you to run Linux (or provide appearance Linux) from the comfort of your Android device as an application. Basically, these applications offer emulation.

KBOX

A tool that does not require root access, KBOX is described as “a project to create a miniature Linux distribution for Android devices, providing a Linux-like console environment.”

So it has a lot of utilities command line, but not available in Google Play. Instead, you will have to visit the website to download and install the APK. Before you continue, make sure you understand the pitfalls of installing apps from third-party sites outside of Google Play.

Download: KBOX (free)

Linux Deploy

Instead of a command line environment with some Linux tools you may prefer something like Linux Deploy from Google Play. This is an open source application for easy and quick installation of the GNU/Linux operating system on Android device. Linux Deploy allows you to choose from several different distributions. They are installed into a disk image in the device storage.

Once installed, you will be able to access the Linux desktop environment on your phone or tablet.

Download: Linux Deploy (Free)

Your smartphone deserves Linux

In short, Linux is already available for many smartphones. But there is still a long way to go. Linux distributions on mobile devices are rare and they all need your support.

If you have one of the devices mentioned above, try using a compatible Linux distribution.

Spend a few days with it to see how it works for you. Then, let the community know how it went. Let them know what worked and what didn't.

If you know how to code, why not offer your help to one of the development projects, or better yet, you can even start developing your own mobile version Linux using project

Very little time passed from the release of the first smartphones running Android OS before enthusiasts learned to run full-fledged Linux distributions on them. Today, methods for installing Linux distributions on Android devices are widely known, and the Google Play repository even contains automated systems installations and launch Linux. In this article, I will try to accumulate all the accumulated experience of working with Linux on smartphones, tell you why this is needed, and show how to avoid possible pitfalls when transferring Linux to a smartphone or tablet.

For what?

At first glance, it may seem strange that someone is trying to run an operating system on a mobile device that, in principle, is not designed to work with a small screen and without a sufficiently precise manipulator (mouse) and keyboard. However, you should not make hasty conclusions. A Linux distribution can give a smartphone owner quite a lot of advantages, including a set of old proven tools such as command line utilities, advanced editors, FTP and SSH servers, networking tools and application development tools. By running Linux without a graphical shell on a smartphone with a hardware keyboard (Motorola Droid, for example), you can use all this quite comfortably on the go without having to leave Android itself. All tools are available at any time, and the smartphone continues to be a smartphone, allowing you to receive calls and listen to Internet radio.

The second argument for installing Linux on a smartphone is the ability to use it as a portable workstation, which can be connected to any PC and immediately access the terminal using an SSH/Telnet client or a VNC/RDesktop client. This is by definition better than flash drives with Linux installed, since there is no need, firstly, to reboot the machine, and secondly, to drive data back and forth; the results of your work will be available immediately after you disconnect your smartphone from the computer.

Finally, Linux gives the greatest benefit on tablets, the screen of which allows you to work more or less tolerably in a graphical environment, and the ability to connect a mouse and keyboard via an OTG cable generally gives the chance to turn the tablet into a full-fledged workstation. At the same time, there is no particular difference between installing a Linux distribution on a tablet and a smartphone.

How?

It's really easy to port Linux to Android and the Linux kernel plays a major role here. Any Linux distribution is a set of applications and libraries that run on top of the Linux kernel, and since Android itself is based on an almost unchanged Linux kernel, these applications and libraries can be run inside the Android environment without any problems. You just need to find a distribution for which there is a port to the ARM platform (don’t forget that 99% of all Android devices run on ARM), install it using an ARM emulator on the virtual HDD(that is, to a file), drop this file onto the device’s SD card, open a terminal, mount the image as a loopback device and chroot it inside. All! It's as simple as running an FTP server in a chrooted environment - a simple and decades-tested method.

The only stumbling block when you decide to run a Linux distribution inside Android is the graphical environment. While there are no difficulties with accessing the console thanks to the presence of a full-fledged terminal emulator, problems begin with graphical applications - there is no native X server for Android, and it is impossible to run a regular X server within the distribution itself due to fundamental differences in the graphics architecture green robot subsystems. Although it basically uses standard Linux Framebuffer, on top of which you can run an X server, the exclusive right to use it initially belongs to higher-level Android libraries, so you can either load a Linux distribution instead of Android (which is completely impractical), or come up with workarounds.

Checking the operation of the necessary modules

Keep in mind that support for loopback devices and ext2/ext3 file systems required to mount the image is not available in all Linux kernels installed on smartphones under Android control. You can check for support using the lsmod | grep -e loop -e ext2.

Enthusiasts got out of this situation by using a simple method of “remotely” connecting to the desktop using any VNC client available for Android. Inside the chroot environment, the Xvnc X server runs and all applications run under its control. The user just has to install the VNC client, enter the local address - and voila, a full-fledged desktop appears on the screen.

The only bottleneck when using Remote Desktop is performance. Even when working locally, VNC cannot provide the proper level of power, which would be enough for smooth scrolling or moving windows without lag. It has not yet been possible to solve this problem; projects to develop a native X server that would use the Android graphics subsystem are still very crude and cannot be used to run full-fledged graphical environments. However, no one forbids using them; for example, X Server from Darkside Technologies Pty Ltd (goo.gl/ap3uD) is quite suitable for running simple software.

Initially, Linux for Android existed only as an image with already installed system, as well as explanatory instructions on how to connect and use this image. Then scripts appeared that automated the process of connecting the image and starting Linux, but they also required some brain work. Finally, in Lately installers have appeared, available on Google Play (for example, goo.gl/RSA1j), which to some extent automate the process of launching the distribution, although, in essence, this is still the same installation guide, but interactive, with direct links to downloading images and scripts.

Alternative options

I already mentioned above that the Linux distribution can be loaded instead of Android, thanks to which it will be possible to use Framebuffer for direct access to the video adapter and significantly speed up work GUI. However, doing this on a smartphone is almost pointless - Linux is unsuitable as the main system on small screens, and it will be impossible to receive calls and use the Internet. But on a tablet Linux will look quite decent.

Typically, the so-called native version of the Linux distribution is installed on a device that initially runs Android as follows. An additional partition is created on the internal NAND drive of the tablet, onto which the Linux distribution is copied. The U-Boot boot loader (used by most tablets) is then configured to use this partition as the boot partition. As a result, the tablet will automatically boot into the Linux system after turning on the power.

To leave the possibility of booting Android, the U-Boot boot loader is reconfigured so that the partition with the Linux system is not the main one, but serves as a “recovery partition” (Recovery Mode), accessible by turning on the device with the volume key held down (the same one which is used to flash the device and perform various recovery operations). This way you can get a dual-boot device: Android by default and a Linux distribution when booted into recovery mode. Recovery Mode itself remains accessible only with the help of special tools.

If the NAND memory is not enough to accommodate a full-fledged Linux system, parts of it (usually the /usr partition) are moved to an image or partition on an SD card. By the way, the ext2 partition on the memory card can also be used to install Linux running in a chroot environment.

Installing a native Linux distribution is more difficult than installing one running in a chroot environment, but it's worth it if you have a tablet and an OTG cable with which you can connect a keyboard and mouse.

Practical lesson

As I already said, only distributions ported to Android are suitable for running under Android. ARM architecture. First of all, these are Ubuntu and Debian, and the first, for obvious reasons, is of much greater interest among robotics. You can also install Gentoo and several specialized distributions, such as Backtrack. Let's consider the most typical case, that is installing Ubuntu according to the standard scheme, without using any automated installers or anything else.


First we need image of a tough disk with the installed distribution. You can create it yourself using the QEMU emulator, however, due to the fact that the installation procedure is absolutely standard and typical, I will not describe it, but will simply direct you to the address goo.gl/9nvBi. Here is an archive with an image on which Ubuntu 12.04 with the LXDE graphical environment is preinstalled (it would be unwise to run Unity/Gnome on a phone/tablet). The archive should be unpacked and the ubuntu.img file should be placed on the memory card.

Next, you need to mount the image and chroot it into the distribution environment. To do this, you need root rights, firmware with support for block loopback devices, and busybox installed (search the Market for “busybox installer”; CyanogenMod has it by default). Sequencing:

  1. Open the terminal emulator in Android (if not, you can install Terminal Emulator from the Market). Or we connect the smartphone/tablet to the computer and access the terminal using adb: $ cd path-to-Android-SDK/platform-tools $ sudo ./adb shell

    Do not forget that the debugging mode in this case must be enabled: “Settings -> For developers -> Android Debugging”.

  2. We get root rights:$su
  3. We create a block loopback device, connect a disk image to it and mount it:# mknod /dev/block/loop255 b 7 255 # mount -o remount,rw / # mkdir /mnt/ubuntu # mount -o loop,noatime -t ext2 \ /sdcard/ubuntu.img /mnt/ubuntu

    The contents of the image should appear in the /sdcard/ubuntu directory. Check that this is the case.

  4. We connect all the virtual file systems necessary for the distribution to work:# mount -t proc proc /mnt/ubuntu/proc # mount -t sysfs sysfs /mnt/ubuntu/sys # mount -o bind /dev /mnt/ubuntu/dev
  5. We configure it so that you can get full access to the Network from the chroot environment:# sysctl -w net.ipv4.ip_forward=1 # echo "nameserver 8.8.8.8" > /mnt/ubuntu/etc/resolv.conf # echo "nameserver 8.8.4.4" >> /mnt/ubuntu/etc/resolv.conf # echo "127.0.0.1 localhost" > /mnt/ubuntu/etc/hosts
  6. Let's go to the chroot environment:# chroot /mnt/ubuntu

Actually, this is where the installation ends. Now you can launch console software, update the system, start network services and do almost everything that can be done with a regular desktop Linux system, not forgetting, of course, that some software that directly interacts with hardware and various specialized pseudo-devices will not work. Also, do not forget that virtual FS should be unmounted after completion of work.

Now we need to install and run the Xvnc X server, which exports display and input devices using the VNC protocol. TightVNCserver is already in the presented image and is even configured, but so that you can better understand the process and be able to solve any problems that arise, I will describe in detail the process of installing and launching it.

  1. Update and install TightVNCserver:# apt-get update # apt-get install tightvncserver
  2. Create a file /root/.vnc/xstartup and write the following into it:#!/bin/sh xrdb $HOME/.Xresources xsetroot -solid gray export XKL_XMODMAP_DISABLE=1 icewm & lxsession

    The third command is needed here to fix problems that may arise due to the physical absence of a keyboard on the device.

  3. We launch Xvnc using the vncserver wrapper with root rights: # export USER=root # vncserver -geometry 1024x800

    As a result of executing the last command, a request for a password to access the VNC server will be displayed on the screen; it is better to specify something simple like “123”. You can set virtually any resolution, but it is better if it matches the physical resolution of the device screen.

  4. Install the AndroidVNC application on your smartphone, launch it, specify the IP address and port 5901, and connect. The LXDE desktop should appear on the screen.

In order not to bother with manually entering all the commands, you can use the ubuntu.sh script located here: goo.gl/xSpK4. Just put it and the ubuntu.img image in the ubuntu directory on the SD card and run the script with the command sh ubuntu.sh, and after 5-10 seconds connect to the desktop using AndroidVNC. Keep in mind that the script mounts the image to the /data/local/mnt directory.


Installing Gentoo on an ext2 partition

So, we installed Ubuntu using the image with file system and shamanism with loopback devices and chroot environments. This turned out to be easy to do, and with the use of scripts it is generally very easy, but what if we go further and install a more hardcore distribution, and not using images, but on a dedicated ext2 partition on the memory card? This way we can solve the problem of some firmware and kernels without support for loopback devices and, moreover, we can enjoy a normal distribution installed according to all the rules.


Let's take Gentoo as an experimental system. To install it on an ext2 partition, we need a memory card with a capacity of at least 2 GB and a rooted smartphone with busybox installed. The sequence of actions is as follows.

  1. Let's do data backup from the memory card and create an additional partition on it, with a capacity of at least two gigabytes. This can be done using any disk partitioning program, but keep in mind that if you want to continue to use the SD card for its intended purpose, then you should create a FAT32 partition at the beginning of the card, so that it becomes the first one, and an additional partition for installing the distribution should be the second one.
  2. Formatting SD card partitions:$ sudo mkfs.vfat /dev/sdc1 $ sudo mkfs.ext2 /dev/sdc2
  3. We take the phone, go to “Settings -> About phone” and look at what processor is installed. Next, go to the page goo.gl/PRfux and download stage3 for the desired architecture, for example stage3 for ARM v7 is in the current-stage3-armv7a directory.
  4. We mount the ext2 partition of the memory card on the computer and unpack the contents of the resulting archive into it:$ sudo mount /dev/sdc2 /mnt $ sudo tar -xxpf stage3-*.bz2 -C /mnt

    We immediately edit the configs and everything you need, to your taste, including editing /etc/resolv.conf according to the example from the previous section.

  5. We launch the terminal emulator (or run the “adb shell”), mount everything we need and go to chroot (almost the same as in the case of Ubuntu): # mount -o remount,rw / # mkdir /mnt/gentoo # mount /dev/ block/mmcblk0p2 /mnt/gentoo # mount -t proc proc /mnt/ubuntu/proc # mount -t sysfs sysfs /mnt/ubuntu/sys # mount -o bind /dev /mnt/ubuntu/dev # sysctl -w net. ipv4.ip_forward=1 # chroot /mnt/gentoo

Access to the desktop is done in the same way as in Ubuntu, except that now you will have to assemble a bunch of software directly on the phone :). However, you can set up an environment for cross-compilation on your computer, but this is a topic for a separate article.


Native installation

Having launched Ubuntu using a VNC server, you will notice the slowness of its operation, which is associated with the VNC protocol overhead for transmitting images “over the network”. To avoid this problem, you can install Ubuntu as the main system next to Android so that it can use the video adapter directly. Unfortunately, universal method do this does not exist. Each device is unique in its own way, including the different partition tables of the NAND memory on which it is installed, various devices and drivers for their operation.


Fortunately, the process of installing the native version of the distribution is well described for many devices in Russian-language forums, so finding instructions will not be difficult. However, it is worth immediately paying attention to several features of this type of installation:

  • Separate or main NAND partition. The Linux distribution can be installed either in a pre-created partition in NAND memory or in the main boot partition. In the first case, the firmware developer usually leaves the option of loading Android using a special script or by loading a Linux distribution in recovery mode; in the second, it will be installed instead of Android and to return the ability to download the robot, you will have to reflash the device again.
  • Dual boot capability. If the Linux distribution is installed on a separate partition, the developer can leave the option to boot Android. However, you should immediately pay attention to how this download occurs: using recovery mode or a script launched from a regular computer. Still, the second method will be inconvenient on the road.
  • Hardware support. The original Linux kernel of the Android firmware already includes all the necessary drivers that may be needed for the operation of a full-fledged Linux system, but not all Linux firmwares will start everything by itself. Problems often arise with the Wi-Fi adapter and touch screen who reacts inappropriately to touch. Therefore, before installing the firmware, you should carefully read about possible complications.

In any case, be prepared for the fact that during the installation of the Linux distribution all your data will be destroyed. There is no way without this.

What's next

Linux distribution, installed nearby with the original Android system, can become a very convenient working tool, however, this moment“Linux inside Android” is considered more of a toy and a way to show off to friends than a serious solution. I am sure that soon, when a full-fledged implementation of the Wayland graphical server appears for Android, the situation will begin to change and we will see distributions with an interface adapted for small screens, as well as full-fledged Linux applications distributed in the form of regular APK packages. Also, don’t forget about the “Ubuntu for Android” project - within its framework, work is underway on an official port of Ubuntu for Android, which will allow you to use your smartphone as a portable system unit connected to any monitor.

Hello, I have a mini PC ug 802, how can I install Linux on it? teltar

This is a very interesting topic for me, friends, since I professionally administer Linux servers. On servers it’s interesting, but for me it’s already everyday and ordinary. And here is the installation Linux distributions for devices with ARM architecture - this is an order of magnitude more interesting.

What is the difference between a computer and a smartphone or tablet?

In fact, conceptually, the difference is small - both mobile and desktop devices, or even servers, are made according to the same principles. However, for mobile devices a different processor architecture is used. Desktop CPUs are designed on x86 or amd64 architectures. And most mobile devices have a processor based on ARM architecture. Historically, this is due to the fact that such processors have significantly lower power consumption, which is a vital necessity for mobile devices.

What OS can be installed on mobile devices?

So, all programs, including the operating system, must be developed specifically for this architecture in order to work on this hardware. Therefore, regular versions Linux installed on desktops or servers will not work here. Fortunately, there are many distributions and versions for this architecture. Starting with the notorious Android, which most smartphones are equipped with, and ending with exotic distributions, like the specialized Backtrack (now Kali Linux). But of greater interest, of course, are some more well-known distributions.

What is Android?

Android is an operating system on Linux based , developed by Google for mobile devices. The world's most popular mobile operating system. It should be understood that in fact LInux is just the kernel of the operating system. And many operating systems are built on its basis, and Android is just one of them.

The kernel is the basic functionality that allows you to use all devices and options of the hardware platform - that is, drivers and device management. Also included in the core are some basic programs and command line utilities. The fact is that in the Linux family (this is the meaning most often meant - a family of operating systems based on this kernel, and not the kernel itself) - the graphical shell is a separate part, its own level of abstraction.

And the minimum configuration of these OSs is precisely without a graphical shell, just a text command line interface. This allows these OSes to be embedded into the most unusual places. For example, in network equipment, machine tools, computers and other complex devices, for example in airplanes and cars. Even in your washing machine Something similar can be installed in a microwave too :)

This is an Android device. Accordingly, Android should be installed by default. Which, in fact, is Linux. But with some serious restrictions. Installing some other Linux can significantly expand the capabilities of a mobile device. The possibilities of use become virtually limitless. Well, imagine using a mobile phone as a server! Many tools are becoming available. If it's a tablet, connect it to peripherals via an OTG cable, you can use it as a full-fledged computer! For what? That's another question. I hope our reader will share his ideas in the comments.

How to install Linux on an android device?

So, installation.

There are two options - you can do a full-fledged installation, as they say, on hardware. This is actually a flashing of the device. At the same time, we lose the native functionality of the device provided by the manufacturer. And this may not be at all what we wanted. For example, the UG 802 mini-computer, which our reader is interested in, is a device designed to expand the functionality of televisions. Because it can be inserted directly into the HDMI port of any TV, turning it into Smart.

Fortunately, there is a second way to install Linux - right inside the device's main operating system, in this case Android case. This allows you to run a so-called chroot environment inside Android. In this case, you will receive two related operating systems running in parallel on one core - Android. And you can switch between them.

This approach is convenient for smartphones and tablets, but may not be suitable for the UG 802. In this case, you may need to flash the required operating system. And this is already some risk that the device can be damaged.

Unfortunately, I have no experience with such experiments. But there is enough information on the Internet about this. Study, try to install.

Therefore, I will provide a few links from which you can begin your acquaintance with the world of mobile device hacking :)

Who are hackers?

Yes, yes, don’t be surprised, this is exactly hacking - non-standard interference in the operation and design of systems and programs, changing them and expanding functionality. This is precisely the original meaning of this word. And a hacker is not a cracker or a virus writer, as most people are used to thinking. This is first and foremost a researcher. Yes, he breaks systems, reveals what was not intended to be opened, but he does this with the goal of learning, not harm.

https://xakep.ru/2012/10/22/android-tablet-linux-install/ - an article about installing Linux on smartphones in the oldest magazine, which is precisely a reflection of the essence of hacking.

https://habrahabr.ru/post/221543/ - Habr, an equally old and even more famous resource. And the article here is fresh, and describes in great detail the experience of installing Arch Linux on top of Android, in the form of a chroot environment.

https://geektimes.ru/post/44220/ - Giktimes - a site from the creators of Habr, and I found it on it detailed manual By installing Debian over Android on a smartphone. The article, although very old, touches on fundamental things that need to be understood before embarking on such an operation. Even if this does not help you establish, it will help you gain knowledge, without which further development of the topic and solution to the problem is impossible. And after studying such articles, you will feel more confident and will be able to search for information on the topic more specifically, on specific issues that will need to be addressed during installation.

For example, these articles on the topic are probably not the only ones on the above-mentioned sites. You can always try to look for more articles about this on such specialized resources. I found and looked at a couple of topics about installing Linux on mobile devices on 4pda.ru like this, For example

That's all for today. But it may always happen that I want to continue the banquet of this topic :)

If problems arise (and they will arise with a 99% probability :)), you can also ask questions here, we will collect information, solve problems together, I am also very interested in this.