How to run CentOS instead of Debian
在reddit上看到的,centos 8开始已经可以用dnf(yum)安装 cros-container-guest-tools,总体来说过程几乎与arch的相同,但centos7的源里面似乎还无法用yum安装。
官方可以对https://faq.fydeos.com//recipes/install-arch-linux/进行补充了
centos-stream(滚动更新版)我直接安装的时候是无法联网的,因为是lxc/lxd版本,暂时只能用dhclient临时联网,还没找到其他方法,欢迎大佬补充,也可以先安装centos8,再转换版本:
dnf install centos-release-stream
dnf distro-sync
帮不方便科学上网的同学贴出来了
How to run CentOS instead of Debian
Move the debian container out of the way
Press Ctrl+Alt+T to bring up crosh (Chrome OS Developer Shell)
vsh termina
lxc stop penguin --force
lxc rename penguin debian
Create the CentOS container
bash /usr/bin/run_container.sh --container_name cent --user 你的用户名 --lxd_image centos/8 --lxd_remote https://mirrors.tuna.tsinghua.edu.cn/lxc-images/
Setup
exec into the container
lxc exec cent -- bash
install cros-guest-tools
dnf -y install epel-release
dnf -y install sudo cros-guest-tools --enablerepo=epel-testing
Enable linger for your user
systemctl unmask systemd-logind
loginctl enable-linger $username
Enable integration services
systemctl enable cros-sftp
sudo su - $username
systemctl --user enable sommelier@0 sommelier-x@0 sommelier@1 sommelier-x@1 cros-garcon cros-pulse-config
Restart CentOS
Right click the Terminal app and choose Shut Down Linux (Beta).
Start the container again by clicking on the Terminal app. After a moment you should get a terminal to your new container with functionaing integration.
这一步可以不要,有利有弊,查清楚了再使用
Enable/Disable linger for your user
systemctl unmask/mask systemd-logind
loginctl enable-linger/disable-linger $username
还有cros-pulse-config我是安装失败的
在这一步时,我使用的是--container_name centos
bash /usr/bin/run_container.sh --container_name cent --user 你的用户名 --lxd_image centos/8 --lxd_remote https://mirrors.tuna.tsinghua.edu.cn/lxc-images/
结果收到了类似于
Error: Invalid devices run_container: .......
Missing source '/run/tokens/centos_token' for disk 'container_token'
的错误,查找资料看到你的是cent
结果成功了,有点不解,因为我查看
ls /run/tokens
,文件夹下并没token文件
你看下报错但信息,记得是由于脚本不支持生成token,错误信息里有提示,要在termina里执行指令,来生成指定vm的token。
重复运行一次命令就没有报错提示,怎么解决我也不清楚