花开蝶自来

copyright@bi1pbu_thu
all rights reserved

0%

一、Termux
1.Termux简介
Termux是 Android 平台上的一个终端模拟器,之所以称它为“模拟器”而非“虚拟机”,是因为它并非像 PC 端的 VirtualBox 等虚拟机软件那样,在宿主机中虚拟出一个完全独立且完整的系统环境,而只是提供一个接口,以安装和运行面向新环境交叉编译后的程序。
Termux将众多 Linux 上运行的软件和工具移植到了手机端。无需任何复杂的安装和配置过程,装好Termux以后即会自动对Termux配置一个基本的运行环境,用以执行一些常见的 Linux 命令。
最为关键的是Termux内置了功能健全的包管理工具。
也可以将此时的手机看作是安装了 Linux 系统的树莓派,可以像 PC 端系统那样运行各种类型的软件,只不过这些软件都是针对特定的 CPU 架构和硬件设备编译过的(交叉编译或者在树莓派系统中本地编译)。 需要注意的是,由于移动端和 PC 端硬件设备的巨大差异,加上 Android 内核和操作系统的限制,能够直接运行的程序毕竟是少数。根据统计,实际上可直接安装运行的软件大概有 900个!
这里简单的列举下部分软件:
基础工具:apt、bash、busybox、dpkg、git、htop、make、zsh ……编程语言:binutils、clang、dart、erlang、golang、lua、nodejs、perl、php、python、ruby、rust ……服务器软件:apache2、lighttpd、nginx、openssh ……数据库软件:mariadb、memcached、mosquitto、postgresql、redis、sqlite ……文本工具和编辑器:emacs、gawk、nano、sed、vim ……媒体工具:ffmpeg、imagemagick、mpv、sox ……网络工具:curl、httping、nmap、wget ……游戏和娱乐:bastet、cmatrix、cowsay、fortune、moon-buggy、nsnake、sl ……
2.Termux安装
百度网盘:
链接:https://pan.baidu.com/s/1svumsiCLq-atB0VdSo9JaA  提取码:zzxx
刚安装这三个软件包后只需打开Termux即可,打开后建议先输入(为了更新一下):
apt update && apt upgrade  回车 
此时可以输入 apt list 查看可安装的软件目录:

 安装上图中软件方法:
输入:
apt install 软件名(上图中绿色英文)     回车

pkg install 软件名(上图中绿色英文)     回车
例如:
$ apt install fortune$ apt install cowsay$ apt install lolcat 软件应用: fortune:输出一段格言警句、名著节选或者小笑话等cowsay:将输出的文字内容包含在由 ASCII 字符组成的动物形象的气泡内lolcat:将苍白的输出文字变成绚丽的彩虹色
 
3.替换镜像源(清华源)
替换镜像源是为了之后安装软件更快,之前都是几十KB每秒,替换过后就是几MB每秒。
未替换镜像源:(注意红圈内容)

使用如下命令行替换官方源为 TUNA 镜像源: 
只需在 $ 后输入以下四行命令(在输入每行后按回车)
sed -i ‘s@^(deb.*stable main)$@#\1\ndeb https://mirrors.tuna.tsinghua.edu.cn/termux/termux-packages-24 stable main@’ $PREFIX/etc/apt/sources.list
sed -i ‘s@^(deb.*games stable)$@#\1\ndeb https://mirrors.tuna.tsinghua.edu.cn/termux/game-packages-24 games stable@’ $PREFIX/etc/apt/sources.list.d/game.list
sed -i ‘s@^(deb.*science stable)$@#\1\ndeb https://mirrors.tuna.tsinghua.edu.cn/termux/science-packages-24 science stable@’ $PREFIX/etc/apt/sources.list.d/science.list
apt update && apt upgrade
安装镜像源后:(注意红圈内容)

 
4.安装sudo软件
Linux sudo命令以系统管理者的身份执行指令,也就是说,经由 sudo 所执行的指令就好像是 root 亲自执行。
使用权限:在 /etc/sudoers 中有出现的使用者。
一开始是不能用sudo命令的,所以需要输入pkg install tsu安装sudo
二、安装linux(Ubuntu)
以上内容为了解、安装、使用Termux,接下来即可正式安装linux(Ubuntu)。
1.先安装基础件proot-distro:
pkg install proot-distro
对于该命令的解释:
 2.查看可安装的Linux系统:
输入:
proot-distro list

3.安装Ubuntu:
输入:
proot-distro install ubuntu
4.安装完成后,进入 Linux(Ubuntu)环境的指令为:
proot-distro login ubuntu
出现root@localhost:#  代表已进入Ubuntu环境,root@localhost:#  的含义如下:

 
在后面输入 exit 回车 即可退出Ununtu环境。

 5.在linux(Ubuntu)系统下创建、删除新用户(普通用户):

 具体操作步骤如下:
① root@localhost:~# 后输入:
useradd -d /home/zxxr -m zxxr
 文件目录是 /home/zxxr,用户名是 -m后的 zxxr 

cd /home 
ls
ls -l

 ②输入passwd 用户名: 
注意:只输入passwd,输入的密码是针对root的密码。
输入passwd zxxr,则输入的密码是针对zxxr(新用户)的密码。

③在linux系统中进入新用户(普通用户):
su 新用户名
即:
su zxxr

进入新用户后,会发现只出现 $ 。
输入 whoami 即可看到当前所在的用户名。
直接输入 su root  再输入root用户的密码后,即可进入root用户(非普通用户)。
④.删除新用户(普通用户):
为了防止出错,先退出Linux系统(出现logout代表退出linux系统),再重新进入Linux系统。
 输入:
userdel -r zxxr
即可删除zxxr用户,再输入su zxxr 则出现:
如果还想在home/zxxr目录下创建新用户zxxr,则如下图:
 
整个过程代码图:  

三、安装Ubuntu桌面:
安装桌面则需要用到另外两个软件(红圈),不过先别急着打开VNC Viewer,只需先打开AnLinux。

 1.打开Anlinux
点击AnLinux左上角,选择“桌面”,选择对应的Linux版本,由于我安装的是Ubuntu,这里我也选择Ubuntu。
下面用图片展示步骤:

 
 
 
点击启动后,会自动进入Termux 界面,在$后输入复制的指令回车即可安装桌面。
如果无法正常安装,请看自己复制的指令是否完整,很有可能是由于复制的指令不完整所造成。
安装过程中会出现选择语言的界面:
第一个选择的中文意思是 不是以上语言,然后会出现选择时区的选项 选择GMT+8,第三个选择是选择18(Chinese),第四个选择是选择1(Chinese)。

注意:第三个选择在选择时需要按回车,让more的内容呈现出来后,才可以进行选择。
下图为第三个选择和第四个选择:

 最后会出现设置输入桌面系统密码,该密码用于连接VNC Viewer软件。
 按照提示会输入四次。

 
当出现 root@localhost:~#  即代表安装桌面系统完成。
注意:
生成的 localhost:1是VNC Viewer软件连接Ubuntu桌面系统的Address。
 
输入ls即可看到Desktop

 2.打开VNC Viewer软件
按照软件提示一直点 Next,直到出现Get Started,点击即可进入该软件, 在软件界面点击绿圈的+号。
然后出现该界面,并输入 生成的localhost:1(输入自己所生成的) 和 名字(任意取)。
点击 CREATE。

 点击CONNECT。
 
点击ok

 输入密码,点击记住密码,再点击右上角的继续。

第一次进入就是如下画面,点击skip即可。
点击上面的 ?即教给你如何用手的点击手势来表示鼠标的操作。

 
 点击右上角的  叉号,即可退出VNC Viewer,但注意此时并未完全退出,需要在 Termux的linux系统 (即root@localhost:# 后 )输入:
vncserver-stop
才可以彻底的退出VNC Viewer。(为再次进入做好前提条件)
然后在需要在 Termux的linux系统 (即root@localhost:
# 后 )输入:
vncserver-start
才具备再次进入VNC Viewer桌面的前提条件。

再次打开VNC Viewer 点击 Ubuntu(名字)即可进入Ubuntu桌面化界面。

 
四、以上操作为搜集各位大佬资料之总结,因此附资料的链接如下:
Termux的安装、换源、基本库安装、基本操作讲解以及Termux的使用心得_万方名的博客-CSDN博客_termux换源
Termux 详解 - 安梁辉 - 博客园
 极致安卓之—Termux安装完整版Linux - 知乎
termux | 镜像站使用帮助 | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror
Termux系列:手机安装一个带桌面的Linux系统_哔哩哔哩_bilibili
Linux常用命令大全_tianzongnihao的博客-CSDN博客_linux基础命令表

包含usb安装,单系统安装和双系统安装.使用Brunch安装ChromeOS on PC,框架官网有Linux安装方法不再展示

Install with Windows Install with Windows

USB installations

This guide is for installing Brunch to a USB (or other disk) using Windows. This guide is also required when singlebooting. To begin, boot into Windows and click the dropdown below to continue.

Click to open USB guide

Requirements

  • Administrator access.
  • Target Disk/USB must be 16 GB minimum.
    • You will also need about 16 GB of free space in your Windows installation.
  • A linux installation via WSL2
  • pv, tar, unzip and cgpt packages.
  • A compatible PC to boot Brunch on.
  • An entry level understanding of the linux terminal.
    • This guide aims to make this process as easy as possible, but knowing the basics is expected.

Recoveries

  1. Download a recovery suitable for your CPU. The list below can help you select one. You do not need to select a recovery that matches the latest Brunch release number, the most recent avaliable is typically fine.

Intel

AMD

Recoveries can be found by clicking the above links. They can also be found by going to cros.tech and searching for the recovery you want.

After selecting the recovery you want, you can select a specific release. Posted releases may be behind the current release, this is normal and you can update into the current release later. It is usually suggested to use the latest release avaliable.

Gathering Files

  1. Download the Brunch files from this GitHub repository. Do not use files found on other sites or linked in videos online. The releases tab can be found at the bottom of the right-hand column on the main GitHub page, but it is generally suggested to use the latest release.

When downloading a release, select the brunch…tar.gz file from the assets at the bottom of the release post. You do not need the source code files, do not download them.

Before continuing, you will need a linux distro installed from the Microsoft Store using WSL2, and the distro must be set up and ready to use. Please refer to online resources for this as the setup can be complicated for some systems.

Prepare the Terminal

  1. Once both files have been downloaded, the Brunch release and your chosen ChromeOS recovery, Launch WSL2.
  2. Make sure that pv, cgpt, tar and unzip are installed.

sudo apt update && sudo apt -y install pv cgpt tar unzip

  • My example uses apt, a package manager for Debian and Ubuntu based distros. If you use Arch, you will need vboot-utils for access to cgpt and a different package manager may be needed to install the rest.

4b. Some Linux releases may require the universe repo to install some of the above dependencies. If you get any errors about a dependency being unavaliable, add the universe repo with this command, and then try the previous step again afterwards.

sudo add-apt-repository universe

  1. After all dependencies have been installed, cd into the directory where your files were downloaded.
  • Replace username with your Windows username.
  • The linux terminal is Case Sensitive, be mindful of capital letters.

cd /mnt/c/Users/username/Downloads

  1. Extract the Brunch archive using tar
  • Replace brunch_filename.tar.gz with the file’s actual filename.

tar zxvf brunch_filename.tar.gz

  1. Extract the ChromeOS recovery using unzip
  • Replace chromeos_filename.bin.zip with the file’s actual filename.

unzip chromeos_filename.bin.zip

Once completed, you will have 4 new files from the brunch archive, and a recovery bin that we will use in the next step.

Install Brunch

  1. Once you’ve got your files ready, you’re ready to install Brunch.
  • As before, replace chromeos_filename.bin with the bin file’s actual filename.

sudo bash chromeos-install.sh -src chromeos_filename.bin -dst chromeos.img

The script will ask for confirmation. If you’re ready to install, type yes into the prompt.

The installation may take some time depending on the speed of your disk, please be patient. There may be a couple of GPT Header errors, which can be safely ignored.

The installation will report that ChromeOS was installed when it is finished. Before closing the terminal, make sure that there are no additional errors in the terminal. If there are no errors, then you are good to go!

Making the USB

  1. Since WSL2 does not have direct disk access, we make an img with WSL2 and then use another program such as Rufus or Etcher to write the disk to a USB. Open the program of your choice, select the chromeos.img in your Downloads folder and write it to your USB.

Next Steps

If you installed to a USB or a second internal disk, then you should be ready to boot into Brunch. If you’ve installed to a USB, keep it plugged in and reboot. It is normal for the first boot to take a very long time, please be patient.

  • The first boot is the best time to setup anything important such as changing kernels or framework options by selecting the “ChromeOS (Settings)” boot option.
  • If you have any issues, it is strongly advised to check out the Brunch Configuration Menu for possible patches or solutions.
  • At this point, your device may incorrectly state that your installation is only 14 GB, regardless of it’s actual size. This can be fixed by opening a developer shell on the startup screen with Ctrl + Alt + F2.
    • Log in as root there should be no password.
    • Enter resize-data then reboot the PC when it’s finished. Your reported size should now be accurate.

Secure Boot

  1. If secure boot is enabled, a blue screen saying Verification failed: (15) Access Denied may appear upon boot.
  • To enroll the key directly from a USB, select OK -> Enroll key from disk -> EFI-SYSTEM -> brunch.der -> Continue and reboot.

Singleboot installations

This guide is for installing Brunch to a disk using a Brunch USB. This guide requires having a working Brunch USB to initiate the install, you can make one by following the guide above. To begin, boot into a working Brunch USB and click the dropdown below to continue.

Click to open singleboot guide

Requirements

  • Administrator access.
  • Target Disk must be 16 GB minimum.
  • Working Brunch USB.
  • A compatible PC to boot Brunch on.
  • An entry level understanding of the linux terminal.
    • This guide aims to make this process as easy as possible, but knowing the basics is expected.

Selecting a Target Disk

  1. Log into ChromeOS, and open a Crosh Shell with Ctrl + Alt + T, then enter shell at the prompt.

  2. Before continuing, you will need to know what disk you want to install to. Be absolutely sure before you continue, this installation will erase everything on that disk, including other partitions. The disk must be at least 16 GB, or the installation will fail. There are several ways to determine which disk is your target, in my example I’ll be using lsblk.

lsblk -e7

This command will show your disks, and the partitions on them. It will also show their sizes and if they are currently mounted. Use this information to determine which disk is your target.


Tips:

  • Your target will never be zram or a loop device.

  • Some PCs may require RAID to be disabled before showing your disks correctly.

  • For this installation, a USB is treated the same as any HDD or SSD.

  • If there is an EFI mountpoint on a disk that disk is your boot disk.

    • You cannot install Brunch directly onto the same disk you are currently booting from.
  • When doing a singleboot installation, your target will not be a partition. This method installs to the entire disk.


Install Brunch

  1. Once you’ve determined your target disk, you’re ready to install Brunch.
  • You will replace disk with your target disk. (Such as sdb, mmcblk0 or nvme0n1 for example)

sudo chromeos-install -dst /dev/disk

The script will ask for confirmation. If you’re ready to install, type yes into the prompt.

The installation may take some time depending on the speed of your target disk, please be patient. There may be a couple of GPT Header errors, which can be safely ignored.

The installation will report that ChromeOS was installed when it is finished. Before closing the terminal, make sure that there are no additional errors in the terminal. If there are no errors, then you are good to go!

Next Steps

It is normal for the first boot to take a very long time, please be patient.


Dualboot installations

This guide is for installing Brunch to a partition using Windows WSL2.

Click to open dualboot guide

Requirements

  • Administrator access.
  • Target partition must be 16gb minimum, unencrypted (bitlocker disabled), and formatted as NTFS.
  • A linux installation vis WSL2
  • pv, tar, unzip and cgpt packages.
  • A compatible PC to boot Brunch on.
  • An entry level understanding of the linux terminal.
    • This guide aims to make this process as easy as possible, but knowing the basics is expected.

Recoveries

  1. Download a recovery suitable for your CPU. The list below can help you select one. You do not need to select a recovery that matches the latest Brunch release number, the most recent avaliable is typically fine.

Intel

AMD

Recoveries can be found by clicking the above links. They can also be found by going to cros.tech and searching for the recovery you want.

After selecting the recovery you want, you can select a specific release. Posted releases may be behind the current release, this is normal and you can update into the current release later. It is usually suggested to use the latest release avaliable.

Gathering Files

  1. Download the Brunch files from this GitHub repository. Do not use files found on other sites or linked in videos online. The releases tab can be found at the bottom of the right-hand column on the main GitHub page, but it is generally suggested to use the latest release.

When downloading a release, select the brunch…tar.gz file from the assets at the bottom of the release post. You do not need the source code files, do not download them.

Before continuing, you will need a linux distro installed from the Microsoft Store using WSL2, and the distro must be set up and ready to use. Please refer to online resources for this as the setup can be complicated for some systems.

Prepare the Terminal

  1. Once both files have been downloaded, the Brunch release and your chosen ChromeOS recovery, Launch WSL2.
  2. Make sure that pv, cgpt, tar and unzip are installed.

sudo apt update && sudo apt -y install pv cgpt tar unzip

  • My example uses apt, a package manager for Debian and Ubuntu based distros. If you use Arch, you will need vboot-utils for access to cgpt and a different package manager may be needed to install the rest.

4b. Some Linux releases may require the universe repo to install some of the above dependencies. If you get any errors about a dependency being unavaliable, add the universe repo with this command, and then try the previous step again afterwards.

sudo add-apt-repository universe

  1. After all dependencies have been installed, cd into the directory where your files were downloaded.
  • Replace username with your Windows username.
  • The linux terminal is Case Sensitive, be mindful of capital letters.

cd /mnt/c/Users/username/Downloads

  1. Extract the Brunch archive using tar
  • Replace brunch_filename.tar.gz with the file’s actual filename.

tar zxvf brunch_filename.tar.gz

  1. Extract the ChromeOS recovery using unzip
  • Replace chromeos_filename.bin.zip with the file’s actual filename.

unzip chromeos_filename.bin.zip

Once completed, you will have 4 new files from the brunch archive, and a recovery bin that we will use in the next step.

Install Brunch

  1. Once you’ve got your files ready, you’re ready to install Brunch.
  • As before, replace chromeos_filename.bin with the bin file’s actual filename.
  • You will also replace size with a whole number. (Such as 14, 20, or 100 for example)
    • The number must be a minimum of 14, but less than the avaliable space on your partition in GB.

Make a directory to install Brunch, for example:

  • run mkdir /mnt/c/Users/username/brunch if you want to install brunch in your home folder on C: partition.
  • or mkdir /mnt/d/brunch if you want to install brunch in the D: partition.

Then launch the installer providing “-dst” argument with the name of the image file to be created (in your brunch directory):
sudo bash chromeos-install.sh -src chromeos_filename.bin -dst /mnt/c/Users/username/brunch/chromeos.img -s size

The installation may take some time depending on the speed of your target disk, please be patient. There may be a couple of GPT Header errors, which can be safely ignored. If you are told that there is not enough space to install, reduce the number at the end of your command until it fits. It is normal that the img cannot take the entire space of the partition, as some of that space is reserved by the system.

When the installer asks you for the type of install, type “dualboot” in the terminal and press “Enter” to continue.

The installation will report that ChromeOS was installed when it is finished. Before continuing, make sure that there are no additional errors in the terminal. If there are no errors, then you are good to continue!

Set up Grub2Win

  1. Install Grub2win if you have not already, then launch the program.

  2. Click on the Manage Boot Menu button, then Add A New Entry.

  • Select Create user section from the ‘Type’ section. This will open a text file. Open the chromeos.grub.txt file we saved earlier, it’s in the same directory as your chromeos.img. Copy the grub boot entries saved in that file and copy them into Grub2win.

  • Click Ok and Apply to save your entries into Grub2win.

    • Your entry will not be saved unless you click both Ok and Apply.

Prevent Windows from locking the NTFS partition

  1. Disable encryption / hibernation

ChromeOS will not be bootable and / or stable if you do not perform the below actions (Refer to Windows online resources if needed):

  • Ensure that bitlocker is disabled on the drive which contains the ChromeOS image or disable it.
  • Disable fast startup.
  • Disable hibernation.

At this point, you are ready to reboot and you’ll be greeted by the Grub2win menu instead of booting into Windows.

Next Steps

It is normal for the first boot to take a very long time, please be patient.


Troubleshooting and Support

See the full Troubleshooting and Support page if you’re having issues.

Additional Tips

  • If you’re having trouble booting a Brunch USB, make sure that UEFI is enabled in the BIOS.
  • Some PCs require a key to be held when booting to boot from USB or that USB booting is enabled in the BIOS
  • The first boot can take up to an hour on some hardware. Brunch does not typically freeze on the Brunch logo. If you are seeing the Brunch logo, the system is probably still booting.
  • If your PC is stuck on the ChromeOS logo (White background), it is likely that you’ve got an incompatible dedicated GPU.
  • If you get a blue screen saying “Verification failed” you can either disable secure boot in your bios settings, or enroll the secure boot key.
    • To enroll the key directly from a USB, select OK -> Enroll key from disk -> EFI-SYSTEM -> brunch.der -> Continue and reboot.
  • If the system reboots itself when booting normally, then Brunch has run into an error and you may need to do some advanced troubleshooting.

In case you run into issues while installing or using Brunch, below are the main places where you can find support:

Discord
Reddit
Telegram

Looking for the Linux guide?

Install with Linux Install with Linux