在容器中安装其他发行版,如Archlinux

由于fydeOS的run_container.sh被修改过,导致按照网上的英文教程总会安装上内置的Debian,因此我们需要使用原版脚本。具体的将/usr/bin/run_container.sh的如下部分

# lxc init "google:${FLAGS_lxd_image}" "${FLAGS_container_name}" || \ # die "Unable to create container from image '${FLAGS_lxd_image}'" local container_root="/usr/share/intergrade_container" local lxd_info="${container_root}/lxd.tar.xz" local root_file="${container_root}/rootfs.squashfs" local container_alias="intergrade_fydemina" lxc image import $lxd_info $root_file --alias $container_alias || \ die "Unable to import image from $root_file" lxc init $container_alias ${FLAGS_container_name} || \ die "Unable to create container from image $container_alias"

换成https://chromium.googlesource.com/chromiumos/overlays/board-overlays/+/master/project-termina/chromeos-base/termina-lxd-scripts/files/run_container.sh里的

lxc init "google:${FLAGS_lxd_image}" "${FLAGS_container_name}" || \
  die "Unable to create container from image '${FLAGS_lxd_image}'"

注意,只有/tmp是可写的。因此需要将修改的脚本保存到/tmp 然后在/tmp下运行bash ./run_container.sh --container_name arch --user 你的用户名 --lxd_image archlinux/current --lxd_remote https://mirrors.tuna.tsinghua.edu.cn/lxc-images/ 这里lxd_image的值可以替换成你想要的镜像container_name也可换成你想要的名字 使用lxc exec arch -- bash进入镜像的bash shell 建议使用passwd设置用户密码并安装sudo,运行visudo在打开的vim中转到最后一行插入 你的用户名 ALL=(ALL) NOPASSWD: ALL 然后更换软件源并加入archlinuxcn源,然后安装yay 然后安装aur中的cros-container-guest-tools-git 英文教程:https://www.reddit.com/r/Crostini/wiki/howto/run-arch-linux

为了运行x11程序,需要对一些文件进行修改

/usr/share/X11/xkb/keycodes/evdev中

"" 和""开头的两行注释或者删除

/usr/lib/systemd/user/sommelier-x@.service中

ExecStart=/usr/bin/sommelier \ -X \ --x-display=%i \ --sd-notify="READY=1" \ --no-exit-with-child \ - --x-auth=${HOME}/.Xauthority \ /bin/sh -c \ "systemctl --user set-environment ${DISPLAY_VAR}=$${DISPLAY}; \ systemctl --user set-environment ${XCURSOR_SIZE_VAR}=$${XCURSOR_SIZE}; \ systemctl --user import-environment SOMMELIER_VERSION; \ - >${HOME}/.Xauthority; \ - xauth -f ${HOME}/.Xauthority add ${HOST}:%i . $(xxd -l 16 -p /dev/urandom); \ . /etc/sommelierrc"

注释或删除被"-"标记的三行,直到fydeOS更新到chromium72,

然后重启系统,或重启容器

重启后如果文件应用不能查看Linux文件,检测cros-sftp.service是否启动sudo systemctl status cros-sftp

如果不能启动图形程序,查看用户服务sommelier@0.service sommelier@1.service sommelier-x@0.service service sommelier-x@1.service cros-garcon.service 是否正常启动 systemctl --user status 服务名

嘿!有没有兴趣一起来完善我们的知识库呢?既然是会使用Arch Linux的大佬,相信对GitHub的基本操作不陌生吧?参照该项目的README文档并提交Pull Request即可哦。