From 1c8ddc7d95c4ab1a395cc7bb230bc956ed6e91bc Mon Sep 17 00:00:00 2001 From: Neil Hanlon Date: Mon, 21 Nov 2022 17:42:21 -0500 Subject: [PATCH] add vbox guest additions - update to 6.1.40 --- Rocky-9-Vagrant-Vbox.ks | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Rocky-9-Vagrant-Vbox.ks b/Rocky-9-Vagrant-Vbox.ks index a827998..b159856 100644 --- a/Rocky-9-Vagrant-Vbox.ks +++ b/Rocky-9-Vagrant-Vbox.ks @@ -108,6 +108,26 @@ account required pam_succeed_if.so user notin root:vagrant :quit EOF +# Install VBoxGuestAdditions for installed kernel +kver=$(rpm -q --queryformat="%{VERSION}-%{RELEASE}.%{ARCH}" kernel) +dnf -y install kernel-devel gcc make perl elfutils-libelf-devel +curl -L -o /tmp/vboxadditions.iso https://download.virtualbox.org/virtualbox/6.1.40/VBoxGuestAdditions_6.1.40.iso +mkdir -p /media/VBoxGuestAdditions +mount -o loop,ro /tmp/vboxadditions.iso /media/VBoxGuestAdditions +mkdir -p /tmp/VBoxGuestAdditions +sh /media/VBoxGuestAdditions/VBoxLinuxAdditions.run --nox11 --noexec --keep --target /tmp/VBoxGuestAdditions +pushd /tmp/VBoxGuestAdditions +./install.sh +/sbin/rcvboxadd quicksetup all +popd +ls "/lib/modules/${kver}/misc/" +modinfo "/lib/modules/${kver}/misc/vboxsf.ko" +rm -rf /tmp/VBoxGuestAdditions +umount /media/VBoxGuestAdditions +rm -f /tmp/vboxadditions.iso +rmdir /media/VBoxGuestAdditions +dnf -y remove kernel-devel gcc make perl elfutils-libelf-devel + # systemd should generate a new machine id during the first boot, to # avoid having multiple Vagrant instances with the same id in the local # network. /etc/machine-id should be empty, but it must exist to prevent