Guest User

Untitled

a guest
Dec 16th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.28 KB | None | 0 0
  1. WARNING: The character device /dev/vboxdrv does not exist.
  2. Please install the virtualbox-dkms package and the appropriate
  3. headers, most likely linux-headers-generic.
  4.  
  5. You will not be able to start VMs until this problem is fixed.
  6.  
  7. #!/bin/bash
  8. # sign-vbox script, copyright (c) 2017 by Rod Smith
  9. # Distributed under the terms of the GPLv3
  10.  
  11. if [ "$#" -ne 1 ] && [ "$#" -ne 0 ]; then
  12. echo "Usage: $0 [ {kernel-version} ]"
  13. exit 1
  14. fi
  15.  
  16. if [ "$#" == 0 ]; then
  17. kernel_version=$(uname -r)
  18. else
  19. kernel_version="$1"
  20. fi
  21.  
  22. sign_file=$(find /usr/src/ -name sign-file | tail -n 1)
  23.  
  24. if [ -z $sign_file ]; then
  25. echo "Can't find the sign-file binary! Exiting!"
  26. exit 1
  27. else
  28. path_to_modules="/lib/modules/$kernel_version/updates/dkms"
  29.  
  30. if [ ! -f $path_to_modules/vboxdrv.ko ]; then
  31. echo "Could not find $path_to_modules/vboxdrv.ko!"
  32. echo "Is the kernel version correct?"
  33. exit 1
  34. fi
  35.  
  36. echo "Signing modules for $kernel_version"
  37. $sign_file sha256 /etc/refind.d/keys/refind_local.key /etc/refind.d/keys/refind_local.cer $path_to_modules/vboxdrv.ko
  38. $sign_file sha256 /etc/refind.d/keys/refind_local.key /etc/refind.d/keys/refind_local.cer $path_to_modules/vboxnetadp.ko
  39. $sign_file sha256 /etc/refind.d/keys/refind_local.key /etc/refind.d/keys/refind_local.cer $path_to_modules/vboxnetflt.ko
  40. $sign_file sha256 /etc/refind.d/keys/refind_local.key /etc/refind.d/keys/refind_local.cer $path_to_modules/vboxpci.ko
  41. modprobe vboxdrv
  42. modprobe vboxnetflt
  43. modprobe vboxpci
  44. modprobe vboxnetadp
  45. echo "Loaded vbox modules:"
  46. lsmod | grep vbox
  47. fi
  48.  
  49. tom@fancy:~/bin$ ll /etc/refind.d/keys/
  50. total 20
  51. drwxr-xr-x 2 root root 4096 Dec 14 09:54 ./
  52. drwxr-xr-x 3 root root 4096 Dec 14 09:53 ../
  53. -r--r--r-- 1 root root 767 Dec 14 09:54 refind_local.cer
  54. -r--r--r-- 1 root root 1094 Dec 14 09:54 refind_local.crt
  55. -r--r--r-- 1 root root 1708 Dec 14 09:54 refind_local.key
  56. tom@fancy:~/bin$ sudo ./sign-vbox.sh
  57. Signing modules for 4.13.0-19-generic
  58. modprobe: ERROR: could not insert 'vboxdrv': Required key not available
  59. modprobe: ERROR: could not insert 'vboxnetflt': Required key not available
  60. modprobe: ERROR: could not insert 'vboxpci': Required key not available
  61. modprobe: ERROR: could not insert 'vboxnetadp': Required key not available
  62. Loaded vbox modules:
Add Comment
Please, Sign In to add comment