如何从 ISO 文件自动构建 VM

发布于 2025-01-11 18:10:28 字数 728 浏览 2 评论 0原文

我有一个 Jenkins 管道,它的输出是一个 ISO 文件(linux)。获取文件后,我必须在 Virtualbox 中准备一个新的虚拟机来宾,然后将 ISO 文件附加到该虚拟机,并等待安装完成以确保 ISO 文件没有任何问题,这是一个相当长的过程并且非常耗时,因为好吧,所以如果可能的话,我正在尝试自动化这个过程。

我发现 virtualBox Jenkins 插件 但它很旧,它只是管理一个服务器(而不是旋转)从 ISO 启动 VM)。

作为概念证明,我尝试从 VirtualBox 的命令行 (VirtualBoxManage) 启动 VM,但收到以下错误消息:

VBoxManage: error: Unattended installation is not supported for guest type 'Linux_64'

我也尝试了 Qemu,但不幸的是,我无法安装 KVM服务器/PC不支持虚拟化!

任何建议将不胜感激..提前致谢。

注意:

  1. Jenkin 在 kubernetes 中运行,但我可以让它直接在主机中独立运行。
  2. 我使用 Jenkins 生成 Linux ISO,因为我通过添加一些 RPM 和修改 kickstart 文件来自定义基本 ISO。

I have a Jenkins pipeline, its output is an ISO file (linux). After getting the file I have to prepare a new VM guest in Virtualbox then attaching the ISO file to that VM and wait till the installation is done to ensure the ISO file does not have any problem which is a quite long process and a time consuming as well, so I am trying to automate this process if possible.

I found virtualBox plugin for Jenkins but it is very old and it is just managing a server (not spinning up a VM from ISO).

As a proof of concept I tried to start VM from the VirtualBox's command line (VirtualBoxManage) but I am getting below error message :

VBoxManage: error: Unattended installation is not supported for guest type 'Linux_64'

I tried Qemu as well but Unfortunately, I am not able to install KVM as all the servers/PCs do not support virtualization !

Any suggestion would be highly appreciated .. Thanks in advance.

Notes:

  1. Jenkin is running in kubernetes but I have no issue to make it runs as a standalone directly in the host.
  2. I am using Jenkins to generate a Linux ISO because I am customizing the basic ISO by adding some RPMs and modifying kickstart file.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

时光沙漏 2025-01-18 18:10:28

HashiCorp 的 Packer 可以用于这项工作。

我还创建了一个定制的 Linux 发行版 ISO。为了实现这一目标,我有一个 Jenkins Pipeline,其中包含以下步骤:

  1. 构建 Linux 发行版 ISO。
  2. 使用 Packer 在 VMware Vsphere 上构建虚拟机并将其导出为 OVF。

Packer by HashiCorp can be used for this job.

I am also create a customize Linux distribution ISO. To achieve this, I have a Jenkins Pipeline with this steps:

  1. Build a linux distribution ISO.
  2. Build and export as OVF a virtual machine on VMware Vsphere using Packer.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文