Difference between revisions of "VirtualBox: Mengatasi vboxdrv yang tidak bisa jalan"

From OnnoWiki
Jump to navigation Jump to search
Line 31: Line 31:
 
==Alternatif Lain==
 
==Alternatif Lain==
  
  ls /var/lib/initramfs-tools | \
+
 
    sudo xargs -n1 /usr/lib/dkms/dkms_autoinstaller start
+
 
 +
#!/bin/env python
 +
#
 +
# NOTE: This assumes that all modules and versions are built for at
 +
#      least one kernel. If that's not the case, adapt parsing as needed.
 +
import os
 +
import subprocess
 +
 +
# Permission check.
 +
  if os.geteuid() != 0:
 +
    print "You need to be root to run this script."
 +
    exit(1)
 +
 +
# Get DKMS status output.
 +
cmd = ['dkms', 'status']
 +
process = subprocess.Popen(cmd, stdout=subprocess.PIPE)
 +
dkms_status = process.communicate()[0].strip('\n').split('\n')
 +
dkms_status = [x.split(', ') for x in dkms_status]
 +
 +
# Get kernel versions (probably crap).
 +
cmd = ['ls', '/var/lib/initramfs-tools/']
 +
# Alternative (for use with Arch Linux for example)
 +
# cmd = ['ls', '/usr/lib/modules/']
 +
process = subprocess.Popen(cmd, stdout=subprocess.PIPE)
 +
kernels = process.communicate()[0].strip('\n').split('\n')
 +
 +
# Parse output, 'modules' will contain all modules pointing to a set
 +
# of versions.
 +
modules = {}
 +
 +
for entry in dkms_status:
 +
    module = entry[0]
 +
    version = entry[1].split(': ')[0]
 +
    try:
 +
      modules[module].add(version)
 +
    except KeyError:
 +
      # We don't have that module, add it.
 +
      modules[module] = set([version])
 +
 +
# For each module, build all versions for all kernels.
 +
for module in modules:
 +
    for version in modules[module]:
 +
      for kernel in kernels:
 +
          cmd = ['dkms', 'build', '-m', module, '-v', version, '-k', kernel]
 +
          ret = subprocess.call(cmd)
  
 
==Referensi==
 
==Referensi==

Revision as of 04:25, 27 May 2017

sumber: https://askubuntu.com/questions/760671/could-not-load-vboxdrv-after-upgrade-to-ubuntu-16-04-and-i-want-to-keep-secur


On my system I did the following to make it work:

Run mokutil:

sudo mokutil --disable-validation

Then mokutil asked me to set a password for the MOK Manager. After rebooting the PC the BIOS showed a dialog to configure the MOK Manager. I disabled SecureBoot from this dialog, it asked for several characters from the password (ie. enter character (5), etc).

After booting up the vboxdrv modules loaded correctly.

lsmod | grep vboxdrv
vboxdrv               454656  3 vboxnetadp,vboxnetflt,vboxpci

Curiously, mokutil still shows SecureBoot is enabled:

sudo mokutil --sb-state
SecureBoot enabled

Alternatif Lain

Lakukan

sudo apt-get install build-essential libssl-dev linux-headers-`uname -r`
sudo apt-get --reinstall install virtualbox-dkms


Alternatif Lain

#!/bin/env python
#
# NOTE: This assumes that all modules and versions are built for at
#       least one kernel. If that's not the case, adapt parsing as needed.
import os
import subprocess 

# Permission check.
if os.geteuid() != 0:
    print "You need to be root to run this script."
    exit(1)

# Get DKMS status output.
cmd = ['dkms', 'status']
process = subprocess.Popen(cmd, stdout=subprocess.PIPE)
dkms_status = process.communicate()[0].strip('\n').split('\n')
dkms_status = [x.split(', ') for x in dkms_status]

# Get kernel versions (probably crap).
cmd = ['ls', '/var/lib/initramfs-tools/']
# Alternative (for use with Arch Linux for example)
# cmd = ['ls', '/usr/lib/modules/']
process = subprocess.Popen(cmd, stdout=subprocess.PIPE)
kernels = process.communicate()[0].strip('\n').split('\n')

# Parse output, 'modules' will contain all modules pointing to a set
# of versions.
modules = {}

for entry in dkms_status:
   module = entry[0]
   version = entry[1].split(': ')[0]
   try:
      modules[module].add(version)
   except KeyError:
      # We don't have that module, add it.
      modules[module] = set([version])

# For each module, build all versions for all kernels.
for module in modules:
   for version in modules[module]:
      for kernel in kernels:
         cmd = ['dkms', 'build', '-m', module, '-v', version, '-k', kernel]
         ret = subprocess.call(cmd)

Referensi