由于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