HOME

TheInfoList



OR:

Android devices have the ability to run
virtual machine In computing, a virtual machine (VM) is the virtualization/ emulation of a computer system. Virtual machines are based on computer architectures and provide functionality of a physical computer. Their implementations may involve specialized h ...
s or
emulate Emulate, Inc. (Emulate) is a biotechnology company that commercialized Organs-on-Chips technology—a human cell-based technology that recreates organ-level function to model organs in healthy and diseased states. The technology has applications ...
other
operating system An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs. Time-sharing operating systems schedule tasks for efficient use of the system and may also i ...
s. It does this either via
desktop virtualization Desktop virtualization is a software technology that separates the desktop environment and associated application software from the physical client device that is used to access it. Desktop virtualization can be used in conjunction with applicati ...
,
platform virtualization Hardware virtualization is the virtualization of computers as complete hardware platforms, certain logical abstractions of their componentry, or only the functionality required to run various operating systems. Virtualization hides the physica ...
, or emulation via
compatibility layer In software engineering, a compatibility layer is an interface that allows binaries for a legacy or foreign system to run on a host system. This translates system calls for the foreign system into native system calls for the host system. With so ...
.


Desktop virtualization

Desktop virtualization Desktop virtualization is a software technology that separates the desktop environment and associated application software from the physical client device that is used to access it. Desktop virtualization can be used in conjunction with applicati ...
apps are the least resource and space intensive compared to other virtualization types, since the Operating System that is being displayed on the Android device is actually located on another computer on the
local network A local area network (LAN) is a computer network that interconnects computers within a limited area such as a residence, school, laboratory, university campus or office building. By contrast, a wide area network (WAN) not only covers a larger ...
or elsewhere like on the internet. Depending upon how the desktop virtualization app works, they use RDP or can use another protocol of their own. Most business oriented desktop virtualization apps require specific types of equipment or services in order for the app to fully function. For example, VMware Horizon Client requires specific VMware equipment for the app to work. A major downside that desktop virtualization apps have compared to other types of virtualization or emulation technologies is that they require a network connection to the server as stated previously above.


Platform virtualization

Platform virtualization Hardware virtualization is the virtualization of computers as complete hardware platforms, certain logical abstractions of their componentry, or only the functionality required to run various operating systems. Virtualization hides the physica ...
allows more leverage to the developer as anything that relates to the guest operating system only affects the guest operating system, and not the host operating system. Due to this it is possible for the guest operating system to be rooted, where as the host operating system remains unrooted. Due to the nature of platform virtualization and the fact that it can virtualize a rooted guest OS, it has a greater advantage over emulators as it can run applications or utilize packages that require access to the underlying system itself. As with all platform virtualization software and applications, they take up a lot of resources of the host in order to do the virtualization.


Emulation


Types of emulations


Emulation of other operating systems

Emulation of other operating systems on Android require the usage of some form of compatibility layer, where the compatibility layer must utilize some form of technologies or APIs to run the OS inside of the app container. This does come with limitations as some emulators utilize PRoot which is a chroot like environment. Unlike terminal emulators that emulate the internal OS with/without any extension package support, it can install actual (for example) Ubuntu packages, as it does not rely too much on the Android system limitations. However, not all packages and applications can run.


Terminal emulation of internal operating system

Terminal emulation of the Android device itself is done via either an actual local loopback to the device, or an emulation that seems to be a local loopback. Most of these terminal emulations of the device itself utilize the native terminal
Toybox Toybox is a free and open-source software implementation of over 200 Unix command line utilities such as '' ls'', '' cp'', and '' mv''. The Toybox project was started in 2006, and became a 0BSD licensed BusyBox alternative. Toybox is used for mo ...
toolchain's library and functions that come with every android device. However due to the fact that the majority of the functions that are readily available without utilizing a compatibility layer, means that Toybox functions can only be utilized. In order for a user to add any other functions or libraries would require the user to root their own device and add the functions or libraries manually. Some of these terminal emulators allow users to enter Toybox commands implicitly, where those that don't require the usage of "toybox COMMAND".


= With enhancements via semi-emulation

= Some terminal emulators like
Termux Termux is a free and open source terminal emulator for Android which allows for running a Linux environment on an Android device. In addition, various software can be installed through the application's package manager. Termux installs a minim ...
allow users to add packages. This is done via semi-emulating a different environment via the usage of PRoot and/or Toybox in the back-end. With the semi-emulating, some predefined ported packages can be used and installed without the need of rooting the device, as they do not utilize Android system files, and reside and run in the apps' own data containers and directories. Because Toybox is used mostly in the back-end, it depends on how the app was developed, for Toybox to be accessed from the semi-emulated enhanced terminal.


Extensions

Many emulators of other OSes allow the use of extensions. Aside from the use of standard
SSH The Secure Shell Protocol (SSH) is a cryptographic network protocol for operating network services securely over an unsecured network. Its most notable applications are remote login and command-line execution. SSH applications are based on ...
, some emulators allow the use of technologies like VNC and XSDL. Via the use of these extensions, the user can have the emulated/virtualized OS running in a desktop-like environment.


Limitations

The majority of limitations are seen in emulation-based apps rather than the platform virtualization based apps, as the emulation apps must utilize a compatibility layer. Thus for libraries and packages to work as expected like in a real OS, the compatibility layer must work properly and must be able to provide accurate information. However, this requires that the compatibility layer or any predefined software it uses (ex. Docker) to have access to many types of system- and device-related information. This can either be done via Toybox or programing language libraries that Android apps can be made from (e.g.,
Java Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's mos ...
, C#). However, starting with Android 8, many new security restrictions have been placed on apps; due to these restrictions, some API libraries/classes are no longer available or have been replaced by more restrictive API libraries/classes. One of the known limitations that was implemented is that apps can only natively access only their own sandbox root directory or sub-directories on an SD card. Apps wanting to access files or folders outside that on the SD card, are required to use Android's own system file selector. Due to this limitation, guest OSes running on, emulation, platform virtualization, or compatibility apps are no longer allowed to access files outside of their own SD card Sandbox. The majority of these limitations can be bypassed by rooting the Android device. However, utilizing Linux via utilizing an emulator or virtualization app would be redundant at that point as one could turn the device itself into a Linux environment.


OS internal security enhancements

More modern versions of Android have been seen having more internal system security enhancements, such that some system folders and files are no longer accessible or even viewable for that directory's existence. Versions of Android before 9 allowed terminal apps to view Android's root "/" directory (although not allowing modifications or execution).


SELinux

Android utilizes
SELinux Security-Enhanced Linux (SELinux) is a Linux kernel security module that provides a mechanism for supporting access control security policies, including mandatory access controls (MAC). SELinux is a set of kernel modifications and user-space ...
; due to this, all system configuration files are not editable and some are not even readable. Thus, apps can only utilize Android API's to learn about the device's or system's configuration or settings. However, not all information is available to apps; due to this, many OS compatibility layers or emulation apps are not able to run every package or application. Here are some known applications and packages that are unable to run: * Udisks2 requires udev which does not work well in most compatibility layer environments, as stated in the sub-sub-section below. * Snort *
Open vSwitch Open vSwitch, sometimes abbreviated as OVS, is an open-source implementation of a distributed virtual multilayer switch. The main purpose of Open vSwitch is to provide a switching stack for hardware virtualization environments, while supporti ...
* mininet (requires open vSwitch to run) Here are some commands that do not work, due to SELinux: * ip link show


ADB, PRoot, $HOME and $PREFIX usage

Because all Android apps run in a non-privileged container space, the virtualization or emulation apps must utilize their own app space to do the virtualization or emulation. This can be done either by ADB, PRroot, or the usage of $HOME and $PREFIX, however majority of these three are utilized by emulation apps as platform virtualization apps usually use different methods. Each of these is used for a different purpose. ADB is used for the emulation of a terminal-like environment for the entire Android system, but usually as an unprivileged user. $HOME and $PREFIX can be using $HOME as "~" and $PREFIX for ".". However, $HOME can not be set outside of the "/data/apps data space" directory on the Android file system, nor can $PREFIX be moved to another place like the SD Card. For emulators or compatibility layers to emulate or virtualize a Linux-based OS on Android, PRoot must be used. However, when PRoot is used, the environment inside of Proot can act like a
Chroot A chroot on Unix and Unix-like operating systems is an operation that changes the apparent root directory for the current running process and its children. A program that is run in such a modified environment cannot name (and therefore normall ...
environment, and/or a separate mounted environment. In this scenario (especially in the case of compatibility layer and emulator for Guest OSes), there are packages and applications that can not run as they were never designed to run inside a chroot like environment. Some of these are well known, prominent packages, applications, or commands, including the following: * Systemd *
Libudev udev (userspace ) is a device manager for the Linux kernel. As the successor of devfsd and hotplug, udev primarily manages device nodes in the directory. At the same time, udev also handles all user space events raised when hardware devices a ...
(Works alongside Systemd). * Init *
Mutter (software) Mutter is a window manager initially designed and implemented for the X Window System, but then evolved to be a Wayland compositor. It became the default window manager in GNOME 3, replacing Metacity which used GTK for rendering. Window manage ...
relies upon systemd


= Alternatives

= Due to the issue of SeLinux and PRoot, alternatives must be used and not all of the unusable packages or applications have alternatives. Being an alternative, they don't necessarily have all the functions of the original packages or applications. Some of these alternatives include: *
Eudev systemd is a software suite that provides an array of system components for Linux operating systems. Its main aim is to unify service configuration and behavior across Linux distributions; Its primary component is a "system and service manage ...
* Elogind *
Metacity Metacity was the default window manager used by the GNOME 2 desktop environment until it was replaced by Mutter in GNOME 3. It is still used by GNOME Flashback, a session for GNOME 3 that provides a similar user experience to the Gnome 2.x seri ...
(Predecessor of Mutter)


Android itself being a modified Linux kernel

Because Android is a modified Linux kernel, not all configuration or system files exist or are the same in Android.{{Cite web, url=https://unix.stackexchange.com/questions/25463/does-android-really-use-the-same-kernel-as-linux, title=Does Android really use the same kernel as Linux?, website=Unix & Linux Stack Exchange, access-date=2019-11-21 Because of this, emulation apps either need to provide either their own version of the configuration or system files in the application's data space, use a pre-modified distribution of ported Linux libraries that do not require the usage of the missing configuration or system files, or not support the usage of those packages. Some well known configuration and system files that are not in Android include: * /etc/resolv.conf


See also

*
Comparison of OS emulation or virtualization apps on Android There are many apps in Android that can run or emulate other operating systems, via utilizing hardware support for platform virtualization technologies, or via terminal emulation. Some of these apps support having more than one emulation/virtual ...
*
Virtualization In computing, virtualization or virtualisation (sometimes abbreviated v12n, a numeronym) is the act of creating a virtual (rather than actual) version of something at the same abstraction level, including virtual computer hardware platforms, stor ...


References

Android (operating system) software Virtualization software Emulation software