search

linux deploy is used to deploy a Linux environment on Android devices. The principle is probably to run a chroot or proot container on the Linux layer of Android, and then run what we prepared in the container. Another Linux system. You must obtain root permissions on your phone before you can use Linux Deploy.

Linux Deploy is an application that can deploy a Linux environment on Android devices. Its principle is to run a chroot or proot container on the Linux layer of Android, and then run it in the container when we are ready. Another Linux system. It is worth noting that this is different from the virtual machine technology we are familiar with. The new Linux system will run in parallel with the Android system (don’t delve into the explanation for non-professionals).

Before using Linux Deploy, we need to obtain the Root permission of the mobile phone (required) . After obtaining the Root permission, because the Linux command set that comes with the original machine is incomplete, we need Install Busybox to expand the Linux command set (you can not install it) .

Linux Deploy needs to be installed in the Google Store, which is not available in other Android app stores. The software mentioned below can only be installed in the Google Store
linux deploy的作用是什么

After the installation is completed, we will use Linux Deploy to deploy the Ubuntu system on the Android device:

Click the "Download" icon at the bottom right of the interface to enter the configuration file setting interface and make the following settings (I I don’t know why the developer would use such a "download" icon as the icon of the configuration file setting interface):

 Containerization method:"chroot"

 Distribution version:"Ubuntu"

Architecture: Keep the default value

Distribution version: "yakkety" (i.e. Ubuntu 16.10)

Source address: http://mirror.tuna.tsinghua.edu.cn/ubuntu -ports/(Here we use the default method of deployment, that is, download Linux components and necessary software packages from the software source. Because the default source speed is not good, in order not to download all day and night, we use the open source of Tsinghua University here. Mirror source, if you use Repository to deploy (will be discussed in a later article), the "source address" here should fill in the local or remote path of the Repository file (suffix is ​​tgz/tar.gz) file)

Installation type: There are two suggestions for this option, "directory" and "file". If you are not familiar with Linux and the remaining space of the /data partition is ≥ 2g, it is recommended to use the "directory" installation method. If you are familiar with Linux Or if the remaining space of the /data partition is

Installation path: When "Installation Path" selects "Directory", this option will define the path in which the system is installed. The default path is ${ENV_DIR}/rootfs/linux, that is, installation In the /data/user/0/ru.meefik.linuxdeploy/env/rootfs/linux directory. When "Installation Type" selects "File", this option will define which image file the Linux system is installed in. The default value is External Storage/linux.img.

Image size (MB) (available when the installation type "selects "File"): This option will define the size of the image file where the system is located. Before system installation, a file with the set image size will be created in the installation directory. Empty files are used to store system files and data (equivalent to the total disk space of the new Linux system). It is recommended not to use the default value, filling in 2048m is enough.

File system (available when the installation type "Select "File" ): Select "Auto".

Username: This option is the username when logging into the system. The default is "android" and can be changed at will.

User password: This option is the password of the user in the Ubuntu system, which can be filled in according to your own habits.

Privileged Users: Keep the default value

DNS server: You can keep the default value, or you can customize the DNS server address (such as 114.114.114.114, etc.)

Localization: It is recommended to keep the default value POSIX. If there are other requirements, such as making the ssh return result in Chinese or making the display language of the graphical interface Chinese, select "zh_CN.UTF8"

INIT/MOUNTS item: If necessary It can be set when required and can be ignored if not required.

Allow SSH server to start: turn on this option

SSH settings: Keep the default

Allow the graphical interface to start: You can set it if necessary, but this option will not be turned on here for the time being (the following article will introduce how to deploy the graphical interface).

linux deploy的作用是什么

After the setting is completed, press the return key to return to the main application interface, press the menu key, and select "Install" to start the Linux system. Installation, you need to maintain a network connection during the installation process (it is recommended to install under WIFI, which requires about a few hundred megabytes of traffic).

When you see the terminal output ">>>deploy", it means the installation has started:

linux deploy的作用是什么
## When you see the terminal output "
linux deploy的作用是什么
Click the "Start" button below the main interface to start the newly installed system, click "Stop" to stop it system.

linux deploy的作用是什么
At this point, the system deployment part is described.

After deployment, we need to use SSH tools such as lJuiceSSH/ConnectBot to log in to the system (JuiceSSH is used as an example here).

After successfully starting the system, we open JuiceSSH, click the "Connect" - " button in the lower right corner to enter the new connection interface:

Nickname: You can fill it in at will, we use "Localhost - Android" as Example type: SSH Address: 127.0.0.1

linux deploy的作用是什么
Authentication: Select "New" to jump to the "New Authentication" interface: Nickname: You can also fill it in at will, we also use " Localhost - Android" as an example. User name: fill in the "user name" in the "Profile Settings" interface. The default is android. Password: fill in the "User Password" in the "Profile Settings" interface.

linux deploy的作用是什么
Click the "√" icon in the upper right corner to save and return to the "New Connection" interface, click the "√" icon again to save, and click the newly created one in the "Connection List" This project is connected to the system we just deployed. After the connection is successful, the interface is as follows:

linux deploy的作用是什么## Because we are logging in through ordinary users android System, next we need to set the super user (root) password and log in to the system as the super user:

Type in the terminal:

sudo passwd root

The terminal will prompt the user to enter the password of the root user and enter it again to confirm (the password will not be visible when entering the password, and even * will not be displayed). After the setting is completed, type the command su in the terminal and enter the root user you just set. Password to switch to the root user.

File management: If you deploy the Linux system through the "directory" method, then you can directly use the R.E. manager to access /data/user/0/ru.meefik.linuxdeploy/env/rootfs/linux You can manage the files in the new system. If you deploy the Linux system through the "file" method, you have to rely on SFTP to manage files and other operations (of course there is no problem using SSH, but I still think SFTP is more convenient. ). When we log in to SFTP as a normal user, we do not have permission to operate most files due to permission reasons. So we need to log in to SFTP as superuser. However, the default configuration does not allow the root user to log in to SSH and SFTP, so we need to make the following settings:

Start the deployed system in Linux Deploy, log in to SSH as the android user, and execute in the terminal:

sudo apt-get install -y vim #Install vim editor

Of course, you can also use the vi editor that comes with the system. If you are familiar with the vi editor, you can also use it. vi editor to edit files. After the vim editor is installed, we continue to execute in the terminal:

vim /etc/ssh/sshd_config #Use the vim editor to open the /etc/ssh/sshd_config file

After opening the file, type i Enter the editing mode, click on any blank position of the terminal to pop up the special key keyboard, use the up and down cursors to scroll through the file, find the PermitRootLogin item in the #Authentication section of the file, change it to yes, after the change is completed, click on the special key keyboard "ESC" key to exit the editing mode, type: wq! on the keyboard to save and force exit the file to complete the editing operation of the file.

linux deploy的作用是什么

Open Linux Deploy, stop and then start the Linux system. Open "Turbo Client" - Sidebar - Create a new account - SFTP to create a new SFTP connection (some file managers, such as ES File Explorer (ESFile Explorer) and SE File Manager (Solid Explorer) also have SFTP functions, If you don’t want to install TurboFTP, you can use them instead):

linux deploy的作用是什么
## Where:

Username: root The password is the password of the root user just set. The host name is: 127.0.0.1

. Keep other items as default. Click the "Save" icon in the upper right corner to save the configuration. In the connection list in the sidebar, we will use The root user connects to SFTP and manages files:

linux deploy的作用是什么
Of course, after modifying the sshd_config file and stopping and starting the Linux system, you can also Connect to SSH directly as root user. After introducing the installation, let’s introduce the uninstallation~ You can completely uninstall Linux Deploy through the following methods:

 1. If you use the "directory" method to deploy the Linux system, then "stop" the Linux system in Linux Deploy , then directly uninstall Linux Deploy and restart the phone to completely uninstall; 2. If you use the "file (mirror)" method to deploy the Linux system, you need to "stop" the Linux system first, and then delete the image file placed in the built-in storage , the image file path is the "installation path" mentioned above before deploying the Linux system. If this item has not been modified, the image path is

External storage/linux.img, and then uninstall Linux Deploy and restart your phone to completely uninstall.

Install the graphical environment

Modify the following configuration items:

INIT: Check: Enable custom script execution (other configurations of INIT remain unchanged )

Graphical interface:

Tick: Allow graphical interface to start

Graphics subsystem: VNC

Graphical interface settings: Keep the default configuration

Desktop environment: Choose as needed, the one chosen here is LXDE

linux deploy的作用是什么
linux deploy的作用是什么
linux deploy的作用是什么
# After the configuration is completed, return to the main interface, press the "Menu key", and select "Configuration" to make the settings we just made take effect:

linux deploy的作用是什么
linux deploy的作用是什么
After the configuration is completed, click the "Stop" button at the bottom to stop the Linux system, and then click the "Start" button to start Linux. System, then we log in to SSH and execute in the terminal:

sudo apt-get install ttf-wqy-zenhei #Install Chinese font library
After the Chinese font library is installed, execute the following command to start VNC:

vncserver
The terminal will return the following results:

New 'X' desktop is localhost:1 Starting applications specified in /home/android/.vnc/xstartup Log file is /home/android/.vnc/localhost:1.log

Copy

Proves that vncserver has been started successfully.

 (Note that at some point, the first time you execute the

vncserver command, the system will ask you to set a VNC password less than 8 digits. You need to enter the password twice and submit it. , there will be a prompt after the VNC password setting is completed, ignore it, type n to submit)

Enter the graphical interface:

Then we use VncViewer to connect to the graphical interface we just deployed:

Open VncViewer, click the " " button in the lower right corner to add a VNC session:

Address: 127.0.0.1:5901 Name : Localhost - Ubuntu@Xfce

Among them, the "Address" item is the address of the VNC server. Since we need to connect to the local VNC server, just fill in 127.0.0.1. In addition, we also need to specify the VNC port after the address, because the information just returned by the terminal:

New 'X' desktop is localhost:1The desktop session number is specified as 1, so the port is 5900 1=5901. If we open multiple virtual desktops and their session numbers are 2, 3, 4..., then their respective ports are 5902, 5903, 5904... and so on. Moreover, the server address and port need to be separated by an English colon. The "Name" item is the address specified by the user for this VNC session. In order to distinguish it from other sessions, we fill in Localhost - Ubuntu@Xfce. In fact, you can fill in anything you want.

After filling in this information, click the "CREATE" button to submit:

linux deploy的作用是什么
linux deploy的作用是什么## After confirming that the information is correct, click the green "CONNECT" button below to start connecting to the VNC session (if you have not set a VNC password before, you still need to enter it during the VNC connection process password, then you can try entering the password of the android user):
linux deploy的作用是什么
linux deploy的作用是什么
#Okay...the deployment process of the graphical interface is over Until now, you can do the rest by yourself (/doge face)~

Possible problems:

 1. When you open a VNC session, After stopping the Linux system and restarting the Linux system, execute the vncserver command again. The system may report the following error:

linux deploy的作用是什么
At this time, you You can execute the following two commands:

rm -rf /tmp/.X[1-9]-lock
rm -rf /tmp/.X11-unix/X[1-9]
After the execution is completed, execute

vncserver again, and the session number will be reset to 1. In order to prevent this problem caused by stopping and restarting the Linux system every time, we can edit the /etc/rc.local file and insert these two commands before exit 0 in this file:

sudo vim /etc/rc.local #Edit/etc/rc.local
linux deploy的作用是什么## After editing is completed, save it. After performing this step, Linux Deploy will execute these two commands for us after starting the Linux system and before stopping the Linux system, so that no more errors will be reported~

 2. vncserver default The resolution is 1024×768, but the resolution of most mobile phone screens on the market is 720P (1280×720), 1080P (1920×1080), or even 2K (2560×1440). The default resolution of vncserver is 1024×768. It may be the case that the VNC image cannot fill the screen. At this time, we need to modify the VNC resolution to adapt to the screen. After testing, taking the 1080P screen as an example, setting the resolution to 720P can make the VNC image fill the screen and not fit the screen. affect the display effect. The adjustment method is to add the

-geometry

parameter after each execution of the vncserver command. For example, if I need to adjust the VNC resolution to 720P (1280×720), then start vncserver , execute: vncserver -geometry 1280x720

to set the screen resolution of the newly opened VNC virtual session to 1280×720. It is worth noting that the
x

in 1280x720 in the command is the lowercase letter x, not the multiplication sign × in mathematics. The following is a comparison between 1280×720 resolution and 1024×768 resolution (reducing the VNC Viewer screen to the minimum):

linux deploy的作用是什么
linux deploy的作用是什么 Obviously, on a 1080P screen, setting the VNC resolution to 1280×720 can make the image fill the screen and provide better visual effects. .

If you find it a bit troublesome to enter such a long list of commands every time you start vncserver, you can edit the

~/.bashrc

file and add a line of alias definition at the location shown in the figure below: vim ~/.bashrc #Edit~/.bashrc

alias vncserver='vncserver -geometry 1280x720'
Copy


linux deploy的作用是什么 After that, every time the
vncserver

command is executed, the resolution of the newly opened VNC session will be set to 1280×720. <h3 id="strong-Upgrading-ubuntu-strong"><strong>Upgrading ubuntu</strong></h3> <p data-pid="mGD1_aOi">You will find that ubuntu can only be installed to 18.04</p> <p data-pid="VAMIrQXy">The way to upgrade is to install Ubuntu and then upgrade directly. </p> <p data-pid="kkln5K-O">After logging into the desktop using VNC, use the terminal to install the updater</p><pre class='brush:php;toolbar:false;'>sudo apt install update-manager-core</pre><p data-pid="60gRnUq3">Update all packages to the latest version</p><pre class='brush:php;toolbar:false;'>sudo apt update &amp;&amp; sudo apt upgrade sudo do-release-upgrade</pre><p data-pid="vbrcayHf">If authenticate 'focal.tar.gz' against ' appears focal.tar.gz.gpg' Authentication failed error, first install gnupg and execute the following instructions: </p><pre class='brush:php;toolbar:false;'>sudo apt install gnupg gnupg1 gnupg2 sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 871920D1991BC93C</pre><h4 id="Execute-sudo-do-release-upgrade-again-enter-y-to-start-updating-the-system-and-follow-the-terminal-instructions-to-update">Execute sudo do-release-upgrade again, enter y to start updating the system, and follow the terminal instructions to update. </h4> <p data-pid="AHGX18es">If prompted Please Install All Available Updates Before Upgrading</p><pre class='brush:php;toolbar:false;'>apt clean apt autoclean sudo apt update sudo apt upgrade -y sudo apt dist-upgrade</pre><h4 id="Execute-sudo-do-release-upgrade-again-enter-y-to-start-updating-the-system-and-follow-the-terminal-instructions-to-update">Execute sudo do-release-upgrade again, enter y to start updating the system, and follow the terminal instructions to update. </h4> <p data-pid="UIeefVlm">If nothing else goes wrong, the system has been upgraded normally. </p> <p data-pid="sw0Qe6Hi">After the upgrade, you need to go back to the linux deploy configuration item and change the username to root. The password can remain unchanged. The reason is that after the upgrade, the original android username does not have root permissions</p> <blockquote data-pid="Q8L66PKi">After modifying the user name, be sure to click the configuration option of linux deploy to reconfigure</blockquote> <p data-pid="7_t4ca32"><strong># Updated on 2023.3.8 If you encounter "The required dependency 'apt (>= 2.0.4)' is not installed." Need to modify the /etc/apt/source.list file</strong></p><pre class='brush:php;toolbar:false;'>## /etc/apt/source.list deb http://ports.ubuntu.com/ focal multiverse main universe deb-src http://ports.ubuntu.com/ focal multiverse main universe deb http://ports.ubuntu.com/ focal-updates main universe multiverse deb-src http://ports.ubuntu.com/ focal-updates main universe multiverse deb http://ports.ubuntu.com/ focal-security main universe multiverse deb-src http://ports.ubuntu.com/ focal-security main universe multiverse</pre>

The above is the detailed content of What is the function of linux deploy. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:亿速云. If there is any infringement, please contact admin@php.cn delete
Using Maintenance Mode: Troubleshooting and Repairing LinuxUsing Maintenance Mode: Troubleshooting and Repairing LinuxApr 29, 2025 am 12:28 AM

Maintenance mode is a special operating level entered in Linux systems through single-user mode or rescue mode, and is used for system maintenance and repair. 1. Enter maintenance mode and use the command "sudosystemctlisolaterscue.target". 2. In maintenance mode, you can check and repair the file system and use the command "fsck/dev/sda1". 3. Advanced usage includes resetting the root user password, mounting the file system in read and write mode and editing the password file.

Linux Maintenance Mode: Understanding the PurposeLinux Maintenance Mode: Understanding the PurposeApr 28, 2025 am 12:01 AM

Maintenance mode is used for system maintenance and repair, allowing administrators to work in a simplified environment. 1. System Repair: Repair corrupt file system and boot loader. 2. Password reset: reset the root user password. 3. Package management: Install, update or delete software packages. By modifying the GRUB configuration or entering maintenance mode with specific keys, you can safely exit after performing maintenance tasks.

Linux Operations: Networking and Network ConfigurationLinux Operations: Networking and Network ConfigurationApr 27, 2025 am 12:09 AM

Linux network configuration can be completed through the following steps: 1. Configure the network interface, use the ip command to temporarily set or edit the configuration file persistence settings. 2. Set up a static IP, suitable for devices that require a fixed IP. 3. Manage the firewall and use the iptables or firewalld tools to control network traffic.

Maintenance Mode in Linux: A System Administrator's GuideMaintenance Mode in Linux: A System Administrator's GuideApr 26, 2025 am 12:20 AM

Maintenance mode plays a key role in Linux system management, helping to repair, upgrade and configuration changes. 1. Enter maintenance mode. You can select it through the GRUB menu or use the command "sudosystemctlisolaterscue.target". 2. In maintenance mode, you can perform file system repair and system update operations. 3. Advanced usage includes tasks such as resetting the root password. 4. Common errors such as not being able to enter maintenance mode or mount the file system, can be fixed by checking the GRUB configuration and using the fsck command.

Maintenance Mode in Linux: When and Why to Use ItMaintenance Mode in Linux: When and Why to Use ItApr 25, 2025 am 12:15 AM

The timing and reasons for using Linux maintenance mode: 1) When the system starts up, 2) When performing major system updates or upgrades, 3) When performing file system maintenance. Maintenance mode provides a safe and controlled environment, ensuring operational safety and efficiency, reducing impact on users, and enhancing system security.

Linux: Essential Commands and OperationsLinux: Essential Commands and OperationsApr 24, 2025 am 12:20 AM

Indispensable commands in Linux include: 1.ls: list directory contents; 2.cd: change working directory; 3.mkdir: create a new directory; 4.rm: delete file or directory; 5.cp: copy file or directory; 6.mv: move or rename file or directory. These commands help users manage files and systems efficiently by interacting with the kernel.

Linux Operations: Managing Files, Directories, and PermissionsLinux Operations: Managing Files, Directories, and PermissionsApr 23, 2025 am 12:19 AM

In Linux, file and directory management uses ls, cd, mkdir, rm, cp, mv commands, and permission management uses chmod, chown, and chgrp commands. 1. File and directory management commands such as ls-l list detailed information, mkdir-p recursively create directories. 2. Permission management commands such as chmod755file set file permissions, chownuserfile changes file owner, and chgrpgroupfile changes file group. These commands are based on file system structure and user and group systems, and operate and control through system calls and metadata.

What is Maintenance Mode in Linux? ExplainedWhat is Maintenance Mode in Linux? ExplainedApr 22, 2025 am 12:06 AM

MaintenanceModeinLinuxisaspecialbootenvironmentforcriticalsystemmaintenancetasks.Itallowsadministratorstoperformtaskslikeresettingpasswords,repairingfilesystems,andrecoveringfrombootfailuresinaminimalenvironment.ToenterMaintenanceMode,interrupttheboo

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),