epcim
10/23/2015 - 12:55 PM

virtualbox-build.howto.md.sh

#!/bin/zsh
#
## build kernel modules, if fail
cd /var/lib/dkms/vboxhost/`vboxmanage --version | sed 's/^\(......\).*/\1/'|tail -n 1`/build; sudo make KERNELRELEASE=`uname -r` -C /lib/modules/`uname -r`/build M=/var/lib/dkms/vboxhost/`vboxmanage --version | sed 's/^\(......\).*/\1/'|tail -n1`/build; for i in `find vbox* -name "*.ko"`;do sudo mkdir -p /lib/modules/`uname -r`/misc; sudo cp -v $i /lib/modules/`uname -r`/misc;sudo insmod /lib/modules/`uname -r`/misc/`basename $i`;done

K=`uname -r`
sudo rmmod vboxnetadp vboxnetflt vboxpci vboxdrv vmmon vmnet
for i in `ls /lib/modules/$K/misc/|xargs`; do 
    sudo insmod /lib/modules/$K/misc/$i;
done