开发者社区> 问答> 正文

有关运行无根VMM的说明的问题

我正在尝试运行 rootless VMM,并且已经按照中的所有说明进行了操作

https://github.com/kata-containers/kata-containers/blob/main/docs/how-to/how-to-run-rootless-vmm.md

然而,由ctr启动的容器(使用tarball方法安装),VMM进程(qemu系统)仍然以root身份运行,尽管

1、changing the permission to 660 for /dev/kvm

2、enabling rootless flag in /etc/kata-containers/configuration.toml Also no luck in using kata-deploy as well after annotated the pod with io.katacontainers.hypervisor.rootless="true"

如果有任何关于如何使用最新的kata容器版本进行设置的分步指南,我们将不胜感激

原提问者GitHub用户darrencjh8  如对项目有进一步反馈,请在 GitHub 提交 issue https://github.com/kata-containers/kata-containers/issues

展开
收起
码字王 2023-05-17 16:15:12 159 0
2 条回答
写回答
取消 提交回答
  • 值得去的地方都没有捷径

    这种情况可能是由于以下原因之一造成的:

    旧版本的Kata容器使用根VMM进程。您需要使用适用于新版本Kata容器的无根VMM进程。

    执行了ctr的用户没有正确配置。请确保用户是非特权用户,并且已正确设置了用户级QEMU和KVM模块。

    没有正确配置QEMU和KVM。请确保按照Kata容器的指南正确设置了QEMU和KVM,以便它们使用无根模式。

    如果您已经按照要求做出了Install kata runtime文档的改动,则可以尝试卸载并重新安装Kata容器以获得最新版本。

    更具体地说,您可以尝试执行以下操作:

    禁用并删除目前的kata容器: systemctl disable kata-runtime && systemctl stop kata-runtime rm -rf /usr/bin/kata-runtime rm -rf /usr/share/kata-containers rm -rf /var/lib/kata 安装最新版本的Kata容器并执行必要的配置: sudo sh -c "echo 'deb http://download.opensuse.org/repositories/home:/katacontainers:/release/xUbuntu_$(lsb_release -rs)/ /' > /etc/apt/sources.list.d/kata-containers.list" curl -sL https://download.opensuse.org/repositories/home:/katacontainers:/release/xUbuntu_$(lsb_release -rs)/Release.key | sudo apt-key add - sudo apt-get update && sudo apt-get install kata-runtime kata-proxy kata-shim

    sudo usermod -a -G kvm whoami sudo sh -c 'cat << EOF > /etc/modules-load.d/kata-containers.conf kvm kvm_intel EOF ' systemctl start systemd-modules-load.service 启用无根标志并使用ctr运行容器: sudo sh -c 'cat << EOF > /etc/kata-containers/configuration.toml [agent] rootless = true EOF ' sudo systemctl restart kata-runtime.service

    sudo ctr run -d docker.io/library/alpine:latest /bin/sleep 100 使用以上步骤安装Kata容器可以让您尝试在无根模式下运行VMM进程。

    2023-05-18 18:38:47
    赞同 展开评论 打赏
  • enabling rootless flag in /etc/kata-containers/configuration.toml

    使用您尝试的设置,您能检查您的kata运行时env--json|jq.runtime.Config.Path以确保其中一个确实被选中么。

    原回答者GitHub用户Jakob-Naucke 如对项目有进一步反馈,请在 GitHub 提交 issue https://github.com/kata-containers/kata-containers/issues

    2023-05-17 16:24:55
    赞同 展开评论 打赏
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载