termux 安裝linux


# 🍭Tmoe-linux
```shell
. <(curl -L gitee.com/mo2/linux/raw/2/2)
```
> If you do not understand the following readme, please report an issue, or open README.en.md
> 化繁為簡,讓 GNU/Linux 的樂趣觸手可及。
如需反饋 bug,請前往github
如需了解 tmoe 配置的容器環境的擴展用法,那就閱讀此文檔吧!
~~注:新版很有可能用 rust 重寫。
之后開發者可能只維護 github 上的倉庫了。
咕咕咕,等到 2022 年應該就能完成了吧?
舊版的功能有點多,重寫將會很花時間。開發者已經不想動了,甚至想要一直咕下去。゚・ (>﹏<) ・゚。~~
## 介紹 Introduction
GNU/LinuxAndroid TermuxWindows10 的 linux 子系統上配置 GNU/Linux chroot 或 proot 容器環境,並 configure remote desktop、pulseaudio 音頻服務和 system。
> Support multiple systems and virtualized environments
map
### Preview
#### install alpine arm64 chroot container (Nihongo ver.)
install alpine arm64 Nihongo.ver
#### Support multiple architectures
arch
#### Support multiple languages
tmoe-linux tools
main menu English.ver
#### Enjoy gnome40 on arm64 device
gnome40_p1
gnome40_p2
### 一.Installation
You can run tmoe-linux manager not only on termux, but also on GNU/Linux.
您不僅可以在 WSL 運行本工具,亦可在 Android 手機上運行。
#### 1.Windows 10/11
Tutorial:
##### 第一章 WSL 篇
002
Read this doc, and then install wsl2.
您需要先安裝 WSL。
關於 WSL2 的安裝,您可以閱讀 此文檔
enable
---
打開子系統,然后根據提示更新 WSL2 的 linux 內核。更新完成后,重新打開子系統。
> It is recommend to use windows terminal.
```shell
sudo apt update
sudo apt install -y curl
bash -c "$(curl -L gitee.com/mo2/linux/raw/2/2)"
```
If you do not live in China, please enter
```shell
bash -c "$(curl -L git.io/linux.sh)"
```
> 您如果在使用過程中,遇到了部分字符顯示異常的問題,那么可以試一下 windows terminal
> 注:當提示 tools or manager 時,請選擇 tools。
> 建議 WSL 用戶直接安裝 gui ,不要在里面先套娃安裝 chroot 容器,再裝 gui,因為這將導致 windows 程序調用失敗。
> 雖然 WSL 支持自定義導入 rootfs, 但是 tmoe 沒有適配這個功能。(咕,后期可能會支持)
#### 2.Android-Termux
> 1.安裝安卓版TermuxTermux:api
> 2.打開 termux,輸入以下命令
If you are using bash/zsh,then type
```shell
. <(curl -L gitee.com/mo2/linux/raw/2/2)
```
If you are using fish,then type the following commands.
```bash
apt update
apt install -y curl
curl -Lo manager.sh gitee.com/mo2/linux/raw/2/2
bash manager.sh
```
> 3.若為 manager,則您可使用觸摸屏進行點擊; 若為 tool,則您可使用觸摸屏進行滑動,回車鍵進行確認。
> When you are using the manager, you can use the touch screen to click. When you are using the tools, you can use the touch screen to swipe and press the Enter to confirm.
>
> 4.如需使用 gui,可能還需要安裝 VNC apk,您可以前往 Google play 或使用 Tmoe-linux 的 debian-i 來下載。
> 注:web 端的 novnc 無需安裝 apk,但觸控操作體驗不佳。
#### 3.Debian/Ubuntu/Mint/Kali
```shell
sudo apt update
sudo apt install -y curl
bash -c "$(curl -L gitee.com/mo2/linux/raw/2/2)"
```
不兼容 debian 8 jessie 及更低版本
#### 4.Fedora/CentOS Stream
```shell
sudo dnf install -y curl
bash -c "$(curl -L https://gitee.com/mo2/linux/raw/2/2)"
```
不兼容 CentOS 7/RHEL 7 及更低版本
#### 5.Arch/Manjaro
```shell
[[ $(command -v curl) ]]
bash -c "$(curl -L https://gitee.com/mo2/linux/raw/2/2)"
```
#### 6.OpenWRT/Entware
202010 不再支持 OpenWRT ,請路由器用戶自行解決依賴關系。
```shell
opkg update
opkg install libustream-openssl ca-bundle ca-certificates wget bash
bash -c "$(wget --no-check-certificate -O- https://gitee.com/mo2/linux/raw/2/2)"
```
#### 7.Alpine
```shell
apk update
apk add wget bash sudo
cd /tmp
wget -O .tmoe-linux.sh https://gitee.com/mo2/linux/raw/2/2
bash .tmoe-linux.sh
```
#### 8.Void
```shell
[[ $(command -v wget) ]]
bash -c "$(wget -O- https://gitee.com/mo2/linux/raw/2/2)"
```
#### 9.Gentoo/Funtoo
202010 不再對 gentoo 進行支持和維護。
```shell
[[ $(command -v sudo) ]]
[[ $(command -v curl) ]]
bash -c "$(curl -L https://gitee.com/mo2/linux/raw/2/2)"
```
#### 10.OpenSUSE
```shell
[[ $(command -v curl) ]]
bash -c "$(curl -L https://gitee.com/mo2/linux/raw/2/2)"
```
#### 11.Other
其它 system 未測試!!!
例如:GuixSD等發行版
若您需手動克隆本倉庫,則請自行解決依賴關系。
I think you can resolve dependencies manually.
The dependencies of the old version before 2020-10(v1.10beta) are git aria2 pv curl grep procps less tar xz(xz-utils) newt(whiptail) sudo
In addition, the new version has more dependencies, please check the source code yourself to understand the dependencies.
After resolving the dependencies,you can git clone this repo manually
```bash
case $(uname -o) in
Android) TMOE_LINUX_DIR="${HOME}/.local/share/tmoe-linux" ;;
*) TMOE_LINUX_DIR="/usr/local/etc/tmoe-linux" ;;
esac
TMOE_GIT_URL="https://gitee.com/mo2/linux"
TMOE_GIT_DIR="${TMOE_LINUX_DIR}/git"
[[ -e ${TMOE_GIT_DIR}/.git ]]
git clone -b master --depth=1 ${TMOE_GIT_URL} ${TMOE_GIT_DIR}
```
After cloning the repo, you can type bash ${TMOE_GIT_DIR}/share/old-version/share/app/manager to start tmoe-linux manager.
#### 11-2.FAQ
> Q:I don't know how to use it?
A:Type startvnc to start vncserver, type stopvnc to stop it.
You can also type startxsdl to startx.
---
> Q:啟動 VNC 的命令有點復雜,我記不住 🤣,欺負老年人么?st...什么來着 😨
A:完整命令是 startvnc,您只需記住 st,然后就能借助 zsh 的自動補全插件來解決。
輸完 st 后,您可以按下 TAB 鍵(⇆),即可生成補全內容。
您也可以直接按方向鍵 → 或者是 ↑,此操作亦能自動補全。😋
---
> Q:我可以在 Linux Deploy 上使用這個腳本嗎?
A:可以噠!ヾ(≧▽≦*)o 您可以在其它主流的 GNU/Linux 發行版,包括但不限於容器、虛擬機和實體機上使用這個腳本。
注:截止 2020 年 7 月份,LinuxDeploy 配置的 archlinux 容器存在某個問題,導致 libnewt 無法被正確配置,進而導致本腳本無法在上面正常運行。
解決方法很簡單,刪掉某個文件夾再重新配置就可以了。因為本工具開發者已經很久沒用過 LinuxDeploy 了,所以忘記是哪個啦!
---
> Q:我覺得 tmoe-linux tools/manager 的依賴有點多
A: 對於必要依賴,在安裝時會顯示安裝信息,並將依賴關系記錄至 tmoe-linux 目錄 /usr/local/etc/tmoe-linux/ 下的 MANAGER_DEPENDENCIES.txtTOOL_DEPENDENCIES.txt 。對於 Android 系統,tmoe-linux 目錄為 ~/.local/share/tmoe-linux
對於非必要依賴,請留意安裝過程中出現的提示。
### 二:容器 Container 篇
#### 1.debian and startvnc commands
> For the docker container, the command is docker, so I will not repeat it here.
> The following will introduce the startup commands of proot and chroot containers.
> The startup command of the most recently used container is debian
>
> 如果容器只有一個,或者您最近使用過那個容器,那么其啟動命令為 debian
> 不管是 kali rolling i386,還是 ubuntu focal arm64,只要您最近使用過它,那就是 debian
> 在 v1.10 beta 中,加入了新命令 tmoe,支持啟動特定的 GNU/Linux 容器版本。
You can type startvnc to start tiger vncserver.
If your host system is Android,then the vnc viewer will be started at the same time.
在宿主系統下,輸startvnc將啟動容器 + tiger vncserver
若宿主系統為 Android,則將同時啟動 Real vncviewer
在容器環境下,輸startvnc僅啟動 tiger vncserver
You can type startx11vnc to start x11 vncserver.
在宿主系統下,輸startx11vnc將啟動容器 + x11 vncserver
在容器環境下,輸startx11vnc僅啟動 x11 vncserver
You can type stopvnc to stop VNC server
在容器環境下,輸stopvnc來停止啟動 VNC server
如需了解更多參數,例如-no-stop-dbus(不停止 dbus-daemon),請輸stopvnc --help
如果您遇到了無法退出容器的情況,則請將 stopvnc 添加至 ~/.zlogout
```zsh
[[ $(egrep '[#]*stopvnc' ~/.zlogout) ]]
```
You can type startxsdl to start X client & server.
在容器環境下,輸startxsdl僅啟動 X client
若您的宿主系統為 win10,則輸入startxsdl 將同時啟動 VcXsrv X server
#### 2.tmoe command
For different distros and different architectures, the startup commands of the container are different.
The complete command is similar to tmoe chroot kali rolling arm64 x11
完整的啟動命令類似於 tmoe proot debian sid amd64 vnc
Next, I will introduce the meaning of each parameter.
```bash
The 1st parameter is the container-type.
You can type "tmoe p" instead of "tmoe proot"
在第一個參數中,chroot可以簡化為c;proot可簡化為p
For example,"tmoe chroot"="tmoe c"
"$1":
"ls:list installed containers"
"c:chroot:A chroot is an operation that changes the apparent root directory for the current running process and their children."
"chroot:與宿主機共享相同的內核,硬件,進程空間和網絡子系統"
"p:proot - mount --bind and binfmt_misc without privilege/setupmount"
"proot:能在用戶空間內運行的程序,I/O性能弱於chroot"
"ns:systemd-nspawn:It supports executing systemctl commands in the container."
"nspawn:systemd容器,支持執行systemctl"
-------------
The 2nd parameter is the distribution name.
在第二個參數中,"arch"可以簡化為"a";"debian"可簡化為"d";"fedora"可簡化為"f";"ubuntu"可簡化為"u"
例如:"tmoe p debian"="tmoe p d"
"$2":
"a:arch"
"arch:simplicity,modernity,pragmatism,user centrality and versatility"
"al:alpine"
"ap:alpine"
"alpine:Small. Simple. Secure. Alpine Linux is a security-oriented, lightweight Linux distribution based on musl libc and busybox"
"arm:armbian"
"armbian:香蕉派,香橙派,nanopi"
"c:centos"
"centos:CentOS is a community-driven free software effort focused on delivering a robust open source ecosystem around a Linux platform"
"d:debian"
"debian:Debian is a distro composed of free and open-source software"
"devuan:Devuan is a fork of Debian that uses sysvinit or OpenRC instead of systemd"
"f:fedora"
"fedora:developed by the community-supported Fedora Project which is sponsored primarily by Red Hat"
"g:gentoo"
"gentoo:追求極限配置和極高自由"
"k:kali"
"kali:Kali is a Debian-derived distro designed for digital forensics and penetration testing"
"m:manjaro"
"manjaro:Free fast and secure Linux based operating system for everyone"
"mi:mint"
"mint:Elegant, easy to use, up to date and comfortable GNU/Linux desktop distribution."
"o:opensuse"
"suse:opensuse"
"opensuse"
"ow:openwrt"
"openwrt:OpenWRT is a Linux OS targeting embedded devices"
"r:raspios"
"raspios:Raspberry Pi OS"
"s:slackware"
"slackware:Slackware is a distro created by Patrick Volkerding in 1993"
"u:ubuntu"
"ub:ubuntu"
"ubuntu:Ubuntu is the modern, open source OS."
"v:void"
"void:Void is a general purpose operating system, based on the monolithic Linux kernel"
-------------
The 3rd parameter is the distro version code.
在第三個參數中,"sid"可以簡化為"s";"無版本代號"既可以簡化為"n",也可以忽略,直接使用第四個參數。
Note: The following list does not include all codes. If there is no version code, you can skip it.
如果版本代號不為空,且參數列表中沒有出現其具體代號名稱,那么請手動輸入完整代號。
如果存在簡化版代號,則可使用簡化版代號來替代完整代號。
例如ubuntu 21.04,您可以用"21.04"來代替"hirsute",至於其他版本卻不一定可以,故建議第三個參數使用完整的代號。
We recommend that you type the complete code.
For example, for Debian 12, you should use "tmoe c d bookworm" or "tmoe p d bookworm" instead of "tmoe c d 12".
"$3":
"s:debian sid"
"sid"
"n:none(Rolling releases like archlinux do not have a version code)"
"none:諸如arch之類的發行版無代號"
"r:kali rolling"
"21.04:ubuntu hirsute"
"20.10:ubuntu groovy"
"20.04:ubuntu focal"
"buster:debian10"
"bullseye:debian11"
"bookworm:debian12"
"trixie:debian13"
"18.04:ubuntu bionic"
"31:fedora 31"
"32:fedora 32"
"33:fedora 33"
"3.12:alpine 3.12"
"3.13:alpine 3.13"
"edge:alpine edge"
"8-Stream:CentOS 8-Stream"
"tumbleweed:OpenSUSE tumbleweed"
-------------
The 4th parameter is the architecture.
在第四個參數中,"arm64"可以簡化為"a";"amd64"可以簡化為"x";"i386"可以簡化為"i";"armhf"可以簡化為"h"。
If you are not using qemu-user for cross-architecture,then you can skip it.
例如:"tmoe p arch arm64"="tmoe p a a"
若當前宿主機架構為"arm64",則您可去除 "arm64" 參數,直接輸入"tmoe p a" 就能啟動"proot arch arm64"容器
"$4":
"x:x64/amd64"
"amd64:It defines a 64-bit virtual address format, of which the low-order 48 bits are used in current implementations.It defines a 64-bit virtual address format, of which the low-order 48 bits are used in current implementations."
"a:aarch64/arm64"
"arm64:64-bit extension of the ARM architecture"
"h:armhf/arm"
"armhf:32-bit arm hard float"
"armel:32-bit arm soft float"
"i:i386/x86/x32"
"i386:x86 is a family of instruction set architectures initially developed by Intel based on the Intel 8086 microprocessor and its 8088 variant"
"p:ppc64el"
"ppc64el:a pure little-endian mode that has been introduced with the POWER8 as the prime target"
"s390x:Linux on IBM Z is not generally appropriate on premises for small businesses that would have fewer than about 10 distributed Linux servers"
"m:mipsel:Microprocessor without Interlocked Pipelined Stages little-endian"
"riscv64:RISC-V is an open standard instruction set architecture (ISA) based on established reduced instruction set computer (RISC) principlesRISC-V is an open standard instruction set architecture (ISA) based on established reduced instruction set computer (RISC) principles"
-------------
The 5th parameter can start a specific program of the container, such as vnc and x11.
If it is empty, then zsh will be started.
在第五個參數中,"vnc"可簡化為"v"。
啟動chroot ubuntu-focal_arm64 tiger vncserver的命令:
"tmoe c u focal arm64 vnc"
可以簡化為"tmoe c u focal a v"
雖然"xsdl"在第五個參數中可以簡化為"x",但是在第四個參數中只能簡化為"xs"。
若第五個參數為空,則將啟動zsh作為默認登錄shell,並且不會啟動遠程服務。
"$5":
"v:vnc(startvnc)"
"vnc:tight/tiger vnc server"
"x11:x11 vnc server"
"xs:xserver"
"xsdl:xserver"
"bash:GNU Bourne-Again SHell"
"zsh:z shell(Default)"
"ash:command interpreter (shell)"
-------------
```
根據上述參數的用法,可推出 debian-sid_amd64 systemd-nspawn 容器的啟動命令為
```bash
tmoe ns d s x
```
假設您安裝了一個名稱為z的 kali-rolling 容器。
當您輸入t p k z時,發現啟動的是proot kali zsh容器,而不是proot kali z
在這種情況下,您需要輸入完整的容器名稱: t p kali-z , 而不能輸入t p k-z
tmoe的第四和第五個參數可以讓容器在啟動時,直接執行本地腳本/二進制文件,詳見 share/container 目錄下的 README
注:本地文件的優先級要高於容器內部。
---
#### SUMMARY
Take the kali-rolling_arm64 chroot container as an example here
Full command:
```bash
tmoe chroot kali rolling arm64
```
Simplified command:
```bash
tmoe c k r a
```
Start kali-rolling_arm64 + tigervnc server:
```bash
tmoe c k r a v
```
Start kali-rolling_arm64 + x11vnc server:
```bash
tmoe c k r a x11
```
Start kali-rolling_arm64 + X client & server:
```bash
tmoe c k r a xs
```
The default login shell is zsh, if you want to start bash,then type
```bash
tmoe c k r a bash
```
Start ash as the login shell:
```bash
tmoe c k r a ash
```
---
此處以 debian-sid_i386 proot 為例
啟動 debian-sid_i386 proot 容器的完整命令為
```shell
tmoe proot debian sid i386
```
精簡命令為
```shell
tmoe p d s i
```
您若使用了 tmoe-zsh 配置的環境,則可以將其進一步簡化為
```shell
t p d s i
```
同時啟動 debian-sid_i386 容器+tigervnc server 的命令為
```shell
t p d s i v
```
同時啟動 debian-sid_i386 容器+x11vnc server 的命令為
```shell
t p d s i x11
```
同時啟動 debian-sid_i386 容器+x client + XSDL/VcXsrv 的命令為
```shell
t p d s i x
```
容器的默認登錄 SHELL 為 zsh,若您需要使用其它 shell,則請使用以下命令
臨時使用 bash 作為登錄 SHELL:
```shell
t p d s i bash
```
臨時使用 ash 作為登錄 SHELL:
```shell
t p d s i ash
```
---
#### 額外拓展功能
(補全功能)說明
shell 環境要求:zsh
The completion function exists separately as a zsh plugin, so bash and other shells are not supported.
僅支持 zsh,不支持 bash
tmoe-zsh 會自動加載 tmoe 補全插件,其他插件管理器需要手動加載。
zinit 插件管理器手動配置補全插件:
If you are using Android system, then type the following command.
```zsh
[[ $(egrep '[#]zinit.completion/_tmoe' ${HOME}/.zshrc) ]]
```
If you are using GNU/Linux system, then type the following command.
```zsh
[[ $(egrep '[#]zinit.completion/_tmoe' ${HOME}/.zshrc) ]]
```
至於其他插件管理器,例如oh-my-zsh,因開發者並未進行測試,故請自行加載插件。
TIPS OF TMOE COMPLETION PLUGIN
1.在 TMOE-ZSH 配置的環境下,輸 t,按下空格,再按下 TAB 鍵 進行補全,輸/進行連續補全,在該模式下支持搜索發行版名稱。
2.在其他插件管理器配置的環境下,輸入 tmoe,不按回車,按下 TAB 鍵 進行補全.
Type tmoe, then don't press enter, press Tab to complete.
zsh plugin
gif preview
以 alpine 3.12 arm64 proot 以例
tmoe proot alpine 3.12 arm64 ash English.ver
---
#### 3.Debian Container
① 在 Android 系統上運行 Debian GNU/Linux arm64 應用
debian arm64
debian version
② 跨架構支持,在 Qualcomm 高通 arm64 cpu 的手機上借助 qemu-user 來模擬運行 x86(i686)架構的 Debian GNU/Linux,並通過 pulseaudio 來傳輸音頻。
debian i386
arch
#### 4.Ubuntu Container
① 在 Android 設備上運行的 Ubuntu 容器,您可以通過 VNC 來連接自己;
通過 adb 遠程來調試自己(Android);
還能通過 scrcpy+adb 調試來實現自己投屏給自己,將手機中 VNC 的畫面投屏給手機中的 VNC。
ubuntu arm64 scrcpy
② Desktop beautification
- 1)十年 Mint 和 Ubuntu 壁紙包
- 2)主題鏈接解析功能
解析主題鏈接(gnome-look 和 xfce-look),並根據主題壓縮包內容,自動生成刪除/卸載的命令。
wallpaper01
### 番外篇
#### 🍸 目前支持的容器
Supported containers:
- [x] Debian stable+sid
- [x] Ubuntu LTS+dev
- [x] Kali rolling
- [x] Arch
- [x] Fedora rawhide
- [x] CentOS stream
- [x] Gentoo
- [x] Alpine edge
- [x] OpenSUSE tumbleweed
- [x] Void
- [x] Raspios
- [x] Mint
- [x] Devuan
- [x] Armbian
gentoo
配置和優化步驟僅適用於 Debian、Ubuntu、Kali、Arch、Fedora 和 Alpine。
🍹
All configuration and optimization steps only apply to Debian,Ubuntu,Kali,Fedora and Arch.
#### 部分功能預覽
qemu 虛擬機管理
qemu虛擬機管理
安裝和配置各種工具
secret garden
steam
部分軟件因其已存在強大的第三方 GUI 配置工具,故僅提供安裝,不提供配置腳本。
ATRI
### 三:System 配置篇
1.✨ 支持配置多國語言環境,並執行其它優化步驟。
locales
在安裝容器前選擇相關選項,運行容器后會自動配置相應語言環境,以“日語_日本”為例:
日本語
2-1.換源功能,全球鏡像站
全球鏡像站
除 debian 官方的全球鏡像站外,更有 ubuntu,arch,alpine,fedora,kali 和 manjaro 國內鏡像站。
2-2. 額外源功能:arch 添加 archlinux_cn 源,centos 添加 epel 源,debian 添加 kali 源,debian 添加 ubuntu ppa 源並自動解決公鑰問題。
Capture__2020-02-16-02-23-49.png
3.sudo 用戶組管理
sudo用戶組
4.UEFI 開機啟動項管理
uefi開機啟動項
### 四:遠程桌面配置篇
1.支持一鍵安裝圖形界面。
Support one-key graphical user interface installation.
de&wm
2.TUI,便捷配置
remote desktop configuration
分辨率
3.對於不同系統,不同虛擬化環境進行適配
3-1.以 tightvnc/tigervnc 服務為例:
對於 deb 系的虛擬機和實體機,啟動 de/wm 的腳本中包含了 dbus-launch --exit-with-session,不加的話可能會出現無法連接至設置服務的錯誤,而 deb 系的 proot 容器加上這個會很容易閃退,所以對 proot 容器和虛擬機分別進行適配。
而 arch 系虛擬機只需要 dbus-launch,不需要加那個參數。
3-2.自動修復 deb 系發行版+xfce4.14 在 tightvnc 下窗口標題欄丟失的問題。
3-3. 對桌面的多啟動命令問題進行修正。
舉例:對於 KDE plasma 桌面來說,新版的啟動命令為 startplasma-x11 和 startplasma-wayland,不再包含 startkde,而本工具同時兼顧了新版和舊版。
3-4.自動解決非 root 用戶在初次配置時可能出現的權限問題。
3-5.對於 WSL2 的適配: 自動識別出 B 類內網動態的 NAT ip,並通過 pulseaudio 實現音頻傳輸,通過調用宿主機(win10)進程來實現便捷式 X 轉發。
自動配置只是其中一個解決方案,還有一個是手動配置管理。
4.🍸 Supported GUI(DE)
目前支持的圖形界面(桌面環境):
(僅部分系統支持)
- [x] xfce4
- [x] lxde
- [x] mate
- [x] lxqt
- [ ] kde plasma 5
- [ ] cinnamon
- [ ] gnome 3
- [ ] deepin desktop
> 注 1:Only some systems support desktop environment installation.
> 僅部分系統支持
> 注 2:Prioritize XFCE
> 優先適配 xfce
> 注 3: 未打勾的選項在容器/遠程桌面環境下存在一些問題
> Some desktops may not display properly through the remote desktop
4-1.Arch + Deepin desktop 在 VNC 下會黑屏
下圖的 Arch 是運行在 debian 里的 chroot 容器。
Snipaste_2020-04-12_05-09-13.png
后期注:經測試 qemu 虛擬機下的 arch+dde+tigervncserver 沒有問題,但是我沒有再次測試 WSL2 的兼容性。
4-2.如下圖所示,Debian sid + KDE Plasma 5 轉發 X11 后,窗口顯示會出現問題。
注:在 RDP 下此問題未復現
注 2:qemu 虛擬機運行的 Debian+KDE+x11vnc 也沒有問題。
Snipaste_2020-04-12_07-28-58.png
4-3.GNOME3 的 VNC 配置腳本也沒有問題。
雖然在 Proot 容器上跑可能會出問題,但是換 qemu-system 虛擬機后就沒問題了。
Screenshot_20200608-003126.png
### 五.軟件配置篇
1.提供了某些官方軟件源中不包含的軟件包,例如 vscode
截圖_2020-02-01_08-53-21.jpg
您可以在手機的容器里安裝 vscode。
2.對於部分工具提供了配置管理功能,例如 arm64 的 vscode-server。
3.對於特定虛擬化環境下運行報錯的應用執行打補丁操作。
4.對 aria2 上百個參數進行配置管理。
aria2 ua
aria2 bt
5.對輸入法進行安裝和配置。
### 六.支持的架構 Supported architecture
Debian 容器支持 arm64(aarch64)、armhf、armel、amd64(x86_64) 、i386(x86)、s390x 和 ppc64el
可以支持,但不想支持的是 mipsel
In addition, the mipsel architecture is also supported! The developer has tested it on the router
2020-03-24 已經支持 mipsel 架構了!(已經在路由器上測試過了 🍥)
可能支持 RISC-V (靠理論知識寫出來的,未實際測試。由於現在暫時無法構建 risc-v 的基礎容器鏡像,故只能靠 qemu 在 risc-v 的設備上模擬其它架構的系統。)
> 下表中的所有系統均支持 x64 和 arm64
> *表示僅舊版支持
### 七.其他說明(舊版)
#### 簡易版說明(萌新專用)
##### 1.安裝 Tmoe GNU/Linux 管理工具的命令
You can use the following command to install Tmoe GNU/Linux manager
```shell
bash -c "$(curl -L https://gitee.com/mo2/linux/raw/2/2)"
```
(舊版)視頻教程鏈接 提取碼: debb(已廢棄)
> 進入工具后,按方向鍵和回車鍵進行操作,基本上所有操作都有提示。
Snipaste_2020-03-20_17-10-48.png
##### 2.啟動命令
如需了解完整命令,請看新版教程。
- 啟動最近使用的容器
```bash
debian
```
If you want to start GNU/Linux next time, you can just type debian.
- 啟動 tigervnc server
若宿主機為 Android 設備,則將同時啟動 VNC viewer
```bash
startvnc
```
- 啟動 x11vnc server
```bash
startx11vnc
```
- 啟動 X client & server
若宿主系統為 win10,則將同時啟動 VcXsrv
```bash
startxsdl
```
##### 3.卸載命令
debian-rm #(已廢棄)
請在管理菜單中單獨選擇容器名稱及其 umount & remove 選項
```bash
bash ~/容器選擇菜單.sh
```
> If your locale is not "zh_.*UTF-8" or "ja_JP.UTF-8", please type
```bash
bash ~/TMOE-CONTAINER-MENU.sh
```
##### 4.啟動工具箱(同時支持,但管理的內容不同)
宿主系統將調用 tmoe-linux manager,容器將調用 tools.
```shell
debian-i
```
##### 5.停止 vnc 命令(同時支持)
```shell
stopvnc
```
###### 不停止 x11vnc
```shell
stopvnc -no-stop-x11vnc
```
###### 不停止 dbus-daemon
```shell
stopvnc -no-stop-dbus
```
---
#### Step2.安裝圖形化桌面環境
##### 2-1.安裝前(關於桌面環境的安裝與卸載)
進入 GNU/Linux 容器后,您可以從 xfce、lxde、mate、lxqt 中選擇一種。
##### 2-3.安裝后
startvnc啟動 vnc 服務,
stopvnc停止 vnc 服務。
完成后,打開 vnc viewer 客戶端,輸 localhost:5902
#### 其它說明
- 1.若無法退出 GNU/Linux 容器,則請在原系統內輸stopvnc
- 2.若 zsh 配置失敗,則請輸./zsh.sh進行重新配置。
- 3.主目錄下的 sh 文件可以刪除,但 sd、tf 和 termux 三個目錄不要刪
- 因為這三個目錄掛載了設備存儲空間,分別和內置存儲、tf 卡(termux 專有目錄)以及 termux 主目錄聯動。
#### 可選步驟
##### 1.修改 vnc 分辨率的方法
- 1-1.工具修改
在 GNU/Linux 容器內輸debian-i打開工具箱,然后選擇相關選項,需要注意的只有一點,x 為英文小寫,不是乘號。
- 1-2.亦可手動修改
```shell
apt install -y micro
micro $(command -v startvnc)
```
> 將 1440x720(豎屏)改成您需要的分辨率,例如 1920x1080(橫屏)
> 修改完成后,按Ctrl+S 保存,Ctrl+Q退出。
---
### 八.相關項目
termux/proot-distro
2cd/zsh
coslyk/debianopt-repo
### 九.更新日志 logs
#### 2019 年
##### 11、12 月
> 舊版腳本部分命令借鑒了 atilo-cn 和 AnLinux,除此之外,大部分都是本人手打的。可能會有出錯的地方,歡迎指正。
>
> 后期注:Anlinux 的腳本有些地方寫得並不好,並且我知道它存在的某些缺陷。反正原作者也看不到,所以我在這里調侃也沒事。😹
> 您去了解更本質的東西就知道哪些地方寫得不好了!`(>﹏<)′
> 相比之下,Linux Deploy 的開發者寫的東西要比他強很多。
#### 2020 年
##### 02-15
> 完全重寫腳本!
> 和別人寫的腳本已經完全不一樣了,重點不在於安裝的方式,而在於配置優化以及與安卓原系統的聯動,難點在於一些鬼點子。
本來是不想維護的,但是我發現了一個很嚴重的 bug,所以干脆重寫一遍。
本次更新的內容真的有點多,而且真的很強哦 ✨ ο(=•ω <=)ρ⌒☆,我自己都覺得太強了!
##### 2020-02-15 更新內容
- 1.獲取鏡像途徑依舊是清華鏡像站,但把下載工具從 wget 換成了 aria2,從原本的單線程變成現在的 16 線程,加快了下載速度。
后期注:盲目調大線程最終適得其反,后期已改為 5 線程。
- 2.自動配置中文環境,默認就是中文,無需手動配置。
- 3.修復舊版腳本中非 xfce 桌面的 xstartup 文件問題。
- 4.新增自動配置 zsh 的功能,初次啟動會出現提示,若在指定時間內無操作會自動開始安裝並配置 zsh。
- 包含主題和語法高亮、語法歷史記錄插件。
- 5.簡化安裝流程,且不再需要某種很神奇的 internet 工具。
- 6.將 debian 10 buster (stable)換成 sid bullseye(unstable),滾動升級,一直都是新版。
- 7.修復 chromium 瀏覽器的啟動問題,使用 ./chromium.sh 安裝的版本,可以直接點擊圖標啟動,在 root 環境下無需加--no-sandbox 參數。
- 8.加入對 armhf 和 x86_64(amd64)的支持。
- 9.支持一鍵更換為 kali 源,debian 變身 kali 就是這么簡單!
- 10.簡化卸載流程,安裝腳本也可以執行卸載操作。
- 11.根據當前 linux shell 環境自動修改 proot 啟動腳本。
- 12.修復啟動 vnc 后,debian 無法正常關閉的 bug ,(請在 termux 原系統內輸 stopvnc)
- 13.簡化啟動流程,您可以在 termux 原系統里輸 startvnc 來啟動 debian+vnc 客戶端
- 14.vnc 支持自動獲取本機局域網 ip,地址格式類似於 192.168.123.3:5902
---
之后的更新內容真的是太多了,有空的話會從酷安原帖搬過來的。其中最突出的更新內容是將安裝 gui 和其它軟件、管理遠程桌面配置等內容整合在 GNU/Linux 容器內的 debian-i 里,以及修復了 VNC 音頻傳輸中可能存在的一些問題。
2020-04-29 注:包含更新日志的帖子已被酷安刪除,由於超過 2 周時間,故無法恢復。
---
> 2020-02-16 至 2020-03-22 的更新日志待補
---
##### 2020-03-23 更新日志
本次更新專注於用戶體驗方面的優化。
- 1.zsh 加入新插件:aloxaf開發的fzf-tab
這是一款非常出色的補全插件!
Snipaste_2020-03-24_07-48-22.png
- 2.將默認主題更換為 powerlevel 10k,並同時修復 termux 和 xfce4 終端的字體顯示問題。
- 3.加入 Command-not-found 插件。
當您未安裝相關軟件時,輸入的是錯誤的命令。例如輸 sshd 時,會出現apt install openssh-server的提示,而不是單純的顯示:Command not found.
> 后期注:宿主機為 OpenWRT 的路由器,不會加載上述部分插件,且默認主題非 p10k。
##### 2020-03-24 更新日志
- 1.支持 mipsel 架構,已在路由器上測試過了。
Snipaste_2020-03-24_05-36-44.png
- 2.嘗試讓 RISC-V 架構的設備能運行 debian 容器,需要宿主機原系統為 deb 系。
當檢測到設備為 riscv 架構時,將下載其他架構的容器鏡像。
調用 qemu+chroot 來實現跨 CPU 架構運行容器,這是一個理論性操作,未實際測試。
2020-10 注:勿需跨架構,支持直接運行 riscv64 容器。
##### 2020-03-25 更新日志
- 1.在 iOS 13.3 上發現致命 bug,不再對 iOS-iSH 提供支持。
- 請勿在蘋果 iOS 設備上使用本腳本!
- 注:iSH為蘋果 iOS 上的 Alpine Linux i686 模擬器。
##### 2020-03-26 更新日志
- 1.全面適配 WSL2 (第二代 windows 的 linux 子系統)
- 注:在 WSL1 中出現嚴重 bug,但在 WSL2 中卻沒有復現。
- 1-1.輸startxsdl能同時啟動 windows 的 X 服務
- 1-2.支持 WSL 的音頻傳輸
- 2.修復 novnc 在非 Android 系統上重復安裝的問題
- 3.在軟件商店中加入了網易雲音樂和百度網盤
##### 2020-03-27 至 2020-04-01 更新日志
- 1.加入測試功能,可在工具內手動安裝輸入法(如 sunpinyin 和 sogou-pinyin)、電子書閱讀器、視頻剪輯(openshot)、數字繪圖(krita)、社交應用(如 Wechat 和 Telegram) 等等。
- 2.全面優化 Windows 平台的 pulseaudio(音頻傳輸)服務
- 3.對於 WSL 的常見問題,給出了解決方案,部分內容還附有截圖。
- 4.加入了修復度盤客戶端無法打開的功能
> 對 WSL2 的支持已經稱得上完善了!
> 最關鍵的地方在於腳本大量調用了 win10 原系統的程序。
> 在 win10 2004 下同時運行 linux 和 windows 程序的預覽截圖
> GlyxZ8.png
> WSL2 與宿主機原系統(win10)的交互聯動要比普通虛擬機強數倍,在 linux 子系統下可以直接調用 powershell.exe 等 windows 程序。
> 如上圖所示,目前已經可以接近完美地將 win10 和 GNU/Linux 融為一體。
##### 2020-04-02 更新日志
- 1.支持非 root 用戶配置 vnc 服務
- 2.修復大量 bug
##### 2020-04-10 更新日志
- 1.加入測試版容器 arch,fedora,centos,raspbian,mint 等等
##### 2020-04-11 更新日志
- 1.加入測試版桌面 lxqt,kde,gnome 等。
- 2.除 deb 系外,還支持給其它發行版安裝 gui。
- 3.支持修復 vnc 閃退。
- 注 1:由於在這幾天的更新中給所有的桌面都加入了 dbus-launch,故在部分安卓設備的 Proot 容器上出現了兼容性問題,容易造成不穩定的狀況。
- 注 2:該操作在 linux 虛擬機及 win10 子系統上沒有任何問題
- 注 3:在最新更新的版本(容器安裝方式)中已加入檢測功能,理論上不會再出現此問題。您也可以在更新 debian-i 后,單獨進行修復。
##### 2020-04-12 更新日志
- 1.支持切換 VNC 音頻傳輸方式。
##### 2020-04-13 至 2020-04-19 更新日志
- 1.優化並適配 Arch,Fedrora 系統
- 2.Gentoo 和 OpenSUSE 僅優化 x64 版
- 3.加入更多發行版的容器,例如 Slackware,Armbian 等
##### 2020-04-20 更新日志
- 1.支持安裝其它版本的 VSCode,包括 VS Codium,VS Code OSS,以及官方版的 VSCode。
- 自動識別除 i*86 外的主流架構,自動獲取最新鏈接,對 deb 系和紅帽系進行分別適配,其它發行版以 tar 壓縮包形式進行安裝,解壓至/usr/local/bin 目錄。
- 2.在服務器上實現了自動構建(獲取最新版+重新打包配置) VSCode Server (web 版)。
每隔一兩周,當檢測到新版時,遠程服務器就會自動更新,完成后將自動同步至國內的 gitee 倉庫。因此遠程始終都是新版,但是本地的話,得要根據您下載的時間而定,不會自動更新。
##### 2020-04-22 更新日志
- 1.修復賦予 proot 容器真實 root 權限后,vnc 出現的權限問題。
##### 2020-04-24 更新日志
- 1.給 ArchLinux 容器添加了 archlinuxcn 源,並將自動安裝 yay
##### 2020-04-29 更新日志
- 1.應 gitee 的小伙伴要求,在測試功能中支持 WPS office 的安裝。
##### 2020-05-01 更新日志
- 1.支持解析視頻網站鏈接,與原版 annie 最大的區別是支持解析 b23.tv ,並且無需完整鏈接,就能直接解析 BV 號。
##### 2020-05-02 更新日志
- 1.支持搭建個人雲網盤(來自 github 開源項目filebrowser),配合我寫的配置腳本來實現簡易化管理。
##### 2020-05-03 更新日志
- 1.支持搭建並配置 WebDAV(nginx)服務,可以非常方便地配置和管理端口號、訪問目錄、訪問賬號、日志和進程等內容。
- 2.支持在工具內配置 VSCode Server 的訪問密碼。
##### 2020-05-04 更新日志
- 1.增加 fedora 32 容器,由於在測試過程中發現某些問題,故保留了之前的 31,可以自由選擇版本。
##### 2020-05-05 更新日志
- 1.優化代碼,增加高亮提示。
- 2.在 beta_features 中支持 docker 和 virtualbox 的安裝。
- 其中,當 deb 系發行版初次安裝后者時,將會自動獲取清華源的最新 deb 包。第二次才會提示是否將其添加至軟件源列表。
- 3.對已支持的所有系統正式開放測試功能!但由於未做過多測試,故 gentoo 、opensuse 和 alpine 等發行版可能會出現未找到匹配軟件的錯誤信息。
##### 2020-05-06 更新日志
- 1.自動修復 proot 容器環境下,安裝 xfce4 桌面時 gvfs 和 udisks2 配置失敗的問題,原先是需要在 FAQ 里手動修復的。
- 2.添加 xrdp 的配置選項,並適配更多桌面。
##### 2020-05-07 至 2020-05-08 更新日志
- 1.支持給所有已支持的桌面配置 xwayland!(僅支持 Android,不支持 win10)
- 說明
- 需要先在 termux 進行配置,並安裝 wayland 服務端軟件,再進入 GNU/Linux 容器內選擇需要配置的桌面環境。
- 其中后者只是在我之前寫的 xorg+xrdp 的配置方案的基礎上進行了修改而已。
- 配置完成后,需要先打開 wayland 服務端,點擊start,然后在容器內輸startw啟動。
- 特點:可以在 proot 環境下打開 kde 的某些應用(例如 plasma-discover),但是 bug 超級多。
- 由於 bug 實在過多,故我已經不想維護了。
觸控操作體驗極差!建議使用藍牙鼠標進行操作!
由於目前在 Android 手機上暫時無法使用 gpu 硬件渲染加速,故實際體驗非常糟糕!
不建議配置該服務!
等 wayland 完善之后,再來繼續優化吧!
2020-10 注:配置 xwayland 的功能已經被我砍掉了!!!請自行研究配置步驟。
##### 2020-05-09 至 2020-05-10 更新日志
- 1.全面升級備份與還原功能,支持自定義備份文件名稱。自動檢測備份文件路徑,也可以手動選擇路徑,然后會自動將備份文件排成一個列表,您只需輸選項數字並按回車即可恢復所選文件。
- 2.優化 cookie 文件選擇功能,支持圖形化文件瀏覽。
因為改了太多內容了,也沒有繼續做兼容性測試,所以不確定路由器等嵌入式設備還能不能繼續兼容。
- 3.修復 Android-Termux 賦予 proot 容器真實 root 權限的功能,原因是 termux 更新了 tsu,將 tsudo 切換至 sudo。
- 4.deb 系 Linux 現在也可以用 proot 容器啦!
2020-10 注:第三個功能已經被我砍掉了。請不要先輸tsu,再輸debian
如果您要這樣做的話,那么請使用chown來解決權限問題,再自行解決其他可能存在的問題。
##### 2020-05-11 更新日志
- 1.支持配置 X11vnc 服務。
- 輸startx11vnc啟動,輸stopvnc停止。
- 2.支持安裝窗口管理器
Snipaste_2020-05-11_21-36-18.png
在安裝時會自動配置 vnc 服務,我沒有為它們寫單獨的 rdp 配置步驟。
##### 2020-05-13 更新日志
- 1.修復大量 bug。
- 2.支持安裝 linux arm64 版的 wechat 和搜狗拼音,不保證可以正常運行。
arm64_wechat
##### 2020-05-14 更新日志
- 1.加入debian-opt倉庫,支持安裝第三方音樂客戶端,感謝倉庫的維護者 coslyk,以及各個項目的原開發者。
- 我在部分基於 electron 的應用中,添加了是否關閉沙盒模式的提醒。簡單來說,就是修復 root 用戶無法啟動的問題。
- 手機預覽截圖見下
Screenshot_20200514-024023_1.png
-2.加入最新的 ubuntu20.10 容器
##### 2020-05-20 更新日志
- 1.支持安裝 wine、anbox 和 aqemu
- 2.增加 iso 鏡像文件下載功能,支持自動獲取 android_x86 鏡像,支持下載各個架構的 debian iso 鏡像(包含 non-free 固件),以及各個 ubuntu 的衍生版
- 3.增加燒錄 iso 文件至 U 盤的功能
- 4.支持安裝 linux 版百度輸入法,此前已經支持訊飛和搜狗輸入法。
- 5.增加 tmoe-deb 軟件包安裝器,支持在腳本內選擇並安裝 deb 文件。
- 后期注:增加了 deb 批量安裝功能(GUI)。
##### 2020-05-21 更新日志
- 1.全面升級換源功能,支持選擇多個鏡像站。debian,ubuntu,kali,arch,manjaro,fedora 和 alpine 可以單獨使用換源功能。
##### 2020-05-22 更新日志
- 1.修復 Ubuntu20.10 存在的各種問題。
- 2.鏡像站支持測延遲+測速,支持強制信任軟件源,去除多余行,一鍵切換 http/https。
- 除了主要源外,還支持配置額外源。對於不同的發行版,顯示的額外源是不同的。對於 debian,顯示的是切換為 kali 源。對於 arch,顯示的是配置 archlinux-cn 源。對於 centos,顯示的是 epel 源。
##### 2020-05-23 更新日志
- 1.修復 code-server
- 由於上游發生變更,因此重寫了配置腳本。
##### 2020 年 05 月末 更新日志
- 1.加入 qemu 配置功能,支持高度的自定義配置。
- 以 CPU 這一塊為例,支持配置 cpu 核心數,cpu 類型,加速類型,多線程。
- 除了 x86_64 架構外,還適配了 arm64 架構。
- 除此之外,還支持運行內存分配,多虛擬機管理,磁盤文件管理,配置共享文件夾和端口映射等虛擬機常見功能。
- 支持自由選擇聲卡,顯卡和網卡,以及 bios 文件。
- 支持下載 demo 鏡像,能在宿主機為安卓的設備上快速運行 docker 容器。
-目前暫不支持的功能: 1.虛擬機顯卡硬件直通(需要雙顯卡,我沒有測試條件) 2.快照管理(請自行在 qemu monitor 里管理 snapshoots)
##### 2020-06-01 更新日志
- 1.支持修改 uefi 開機啟動項,備份和恢復 efi 分區。
##### 2020-06-02 更新日志
- 1.qemu 虛擬機增加 virtio 磁盤的配置選項。
##### 2020-06-03 更新日志
- 1.修復 qemu 在 VNC 遠程桌面環境下無法調用音頻的問題
- 2.更新 Tmoe 文件選擇器,自動重定向文件路徑。
##### 2020-06-05 更新日志
- 1.支持配置顯示管理器 (Display manager)
##### 2020 年 06 月上旬至中旬 更新日志
- 1.增加更多系統配置選項,例如配置時間同步服務,開機自啟腳本和管理 sudo 用戶組等。
- 2.增加 Debian 配置 Ubuntu ppa 軟件源的功能。Debian 使用原版的 add-apt-repository 存在某些問題,例如添加 gpg 密鑰失敗,而此功能的目的就是解決這些問題。
- 填寫完 ppa 源名稱后,會自動檢測 launchpad 中該軟件描述頁面的 gpg 密鑰,並添加。接着,需要指定 ubuntu 版本代號,完成后會自動修改軟件源列表。
- 此功能對於 ubuntu 同樣有效,經測試部分 ppa 軟件源不包含 ubuntu 20.10 groovy 的倉庫,此功能可以幫您解決手動修改/etc/apt/sources.list.d/中相關軟件源列表的煩惱。
##### 2020 年 07 月 更新日志
- 1.修復 qemu 模板倉庫
- 2.支持更多的 debian 容器版本,自動檢測 debian12 bookworm 等未發布版本。
- 3.多區域/語言環境配置
- 4.0711-0716:增加 aria2 配置工具
- 5.0720-0721:優化跨 cpu 架構運行容器的功能
Snipaste_2020-07-21_14-30-25.png
- 6.0723:配置 fcitx5
- 7.0730 更新教育類,增加高考和考研
##### 08 月 更新日志
- 1.08-11:更新 docker 配置選項
- 2.08-14:更新 termux 的換源功能,支持配置多個鏡像站。
- 3.08-16:重構 proot 腳本,修復 deb 系發行版無法使用ps命令的問題。
- 4.08-21:對 archlinux 等非 deb 系發行版適配音樂 app
- 5.08-26:支持跨 CPU 架構運行 docker 容器
- 6.08-29:在恢復容器壓縮包時,將根據系統對權限的限制自動判斷特殊文件的掛載與否。(僅適用於 0816 之后的版本)
##### 10 月 更新日志
- 1.增加多容器管理
- 2.移除功能:xwayland,賦予 proot 容器真實 root 權限等等。
移除 vscode server 宿主機與容器的聯動功能。
原功能介紹:在宿主機下執行指定命令將同時啟動宿主機的瀏覽器並打開 code server 的 web 頁面+容器的 code server。
此外,還有很多功能也被我砍了,此處不一一列舉。
有些功能維護起來太累了,我不想管了。
還有的話,不再對 gentoo 和 openwrt 提供支持。
- 3.10-13:增加 vscode arm64/armhf 官方版,此前 arm 只有第三方編譯版。
- 4.移除發行版: apertis,alt 和 raspbian。
- 5.新增 deepin v20 容器
- 6.修復 riscv64 架構容器的配置功能,arm64 可以跨架構運行 risv64。
- 7.新增 mips64el 架構的容器。
##### 11 月 更新日志
- 1.重構 qemu-system-x86_64 配置功能。
- 2.移除功能:qemu-system-aarch64 所有配置選項,燒錄 iso 至 U 盤等。
##### 12 月 更新日志
- 1.修復容器環境下運行 fcitx/fcitx5/ibus 時,環境變量未正確配置的問題。
---
##### 2021 年 1 月 更新日志
- 1.增加 Dockerfile ,並為部分發行版+桌面提供每周自動構建鏡像。
- 您現在可以直接下載包含 GUI 的容器鏡像。
- ##### 3 月 更新日志
- 1.移除 uos,euleros 等容器
- ##### 4 月 更新日志
- 1.移除 ubuntu-devel (arm64
- 2.加入服務型容器。
- 3.增加更多容器配置選項。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM