Kickstart installation, reboot and VBox Guest

General support questions
Post Reply
davidkoenig09
Posts: 4
Joined: 2018/10/24 04:50:26

Kickstart installation, reboot and VBox Guest

Post by davidkoenig09 » 2019/02/08 14:38:12

Hi,

i use CentOS 7.5 and kickstart to do an automated installation of CentOS. In the PostInstall Section of the kickstart file i run the following script to update the kernel and install VirtualBox:

Code: Select all

echo "Install current kernel"
rpm --import <some url>
rpm -Uvh <some url>
yum --enablerepo=elrepo-kernel install -y kernel-ml
grub2-set-default 0 # Set new kernel as default

echo "remove old kernel-headers"
yum remove -y kernel-headers

echo "remove old kernel"
yum remove -y kernel

echo "install new kernel-headers"
yum --enablerepo=elrepo-kernel install -y kernel-ml-headers

echo "install new kernel-devel"
yum --enablerepo=elrepo-kernel install -y kernel-ml-devel

###################################################################
# REBOOT IS NEEDED HERE TO INSTALL VBOXGUEST FOR THE NEW KERNEL
###################################################################

GCPRODUCTNAME=$(dmidecode -s system-product-name)
if [ $GCPRODUCTNAME == "VirtualBox" ]
then 
    echo "Install Virtualbox guest utilities prerequisites"
    yum install -y gcc make perl bzip2 # Will be uninstalled by removing the old kernel-headers
    echo "Install Virtualbox guest utilities"
    /tmp/PostInstall/Desktop/VBoxGuest/$VB_GUESTVERSION/VBoxLinuxAdditions.run 
    echo "Add admin user to vboxsf group to allow access to shared folders"
    usermod -a -G vboxsf admin # This allows access to SharedFiles share
fi

The problem is, that the VB module will be installed for the (currently active) kernel 3.x o CentOS. The new kernel is just available when i restart the machine. But i don't want to restart, because this is the signal for the waiting to start with the work. Is there any chance to install VBox guest additions for the new kernel without the reboot?

Regards Dave

Post Reply