Skip to content

Commit

Permalink
Fix #542: Switch to libvirt for vm_devbox (#543)
Browse files Browse the repository at this point in the history
Companion PR for: radiasoft/download#739
  • Loading branch information
e-carlin authored Feb 13, 2025
1 parent 8d6fd4e commit ef8052e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 22 deletions.
17 changes: 6 additions & 11 deletions rsconf/package_data/vm_devbox/main.sh.jinja
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
#!/bin/bash

vm_devbox_main() {
if vagrant --version > /dev/null 2>&1; then
if rpm -q libvirt-devel &> /dev/null; then
return
fi
declare p=kernel-devel-$(uname -r)
if ! yum list "$p" &> /dev/null; then
install_err "rpm $p not found.
Virtualbox needs the kernel-devel rpm for the host kernel to be installed.
Maybe try updating the kernel? The repos only have kernel-devel for recent versions of the kernel."
fi
rsconf_yum_install "$p"
yum-config-manager --add-repo https://download.virtualbox.org/virtualbox/rpm/el/virtualbox.repo
yum makecache -y
rsconf_yum_install VirtualBox-7.0
yum-config-manager --set-enabled crb
rsconf_yum_install '@Virtualization Hypervisor' '@Virtualization Tools' '@Development Tools' libvirt-devel
yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
rsconf_yum_install vagrant
systemctl enable --now libvirtd
systemctl start libvirtd
usermod --append --groups libvirt '{{ rsconf_db.run_u }}'
}
17 changes: 6 additions & 11 deletions tests/pkcli/build1_data/1.out/srv/host/v9.radia.run/vm_devbox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,15 @@ vm_devbox_main
#!/bin/bash

vm_devbox_main() {
if vagrant --version > /dev/null 2>&1; then
if rpm -q libvirt-devel &> /dev/null; then
return
fi
declare p=kernel-devel-$(uname -r)
if ! yum list "$p" &> /dev/null; then
install_err "rpm $p not found.
Virtualbox needs the kernel-devel rpm for the host kernel to be installed.
Maybe try updating the kernel? The repos only have kernel-devel for recent versions of the kernel."
fi
rsconf_yum_install "$p"
yum-config-manager --add-repo https://download.virtualbox.org/virtualbox/rpm/el/virtualbox.repo
yum makecache -y
rsconf_yum_install VirtualBox-7.0
yum-config-manager --set-enabled crb
rsconf_yum_install '@Virtualization Hypervisor' '@Virtualization Tools' '@Development Tools' libvirt-devel
yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
rsconf_yum_install vagrant
systemctl enable --now libvirtd
systemctl start libvirtd
usermod --append --groups libvirt 'vagrant'
}

0 comments on commit ef8052e

Please sign in to comment.