从ppa中安装了virtualbox,这里没有注意,应该是有报错,载入以前的系统,报错如下:

kernel driver not installed (rc=-1908)

The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or
there is a permission problem with /dev/vboxdrv. Please install
virtualbox-dkms package and load the kernel module by executing

'modprobe vboxdrv'

as root. If it is available in your distribution, you should install
the DKMS package first. This package keeps track of Linux kernel
changes and recompiles the vboxdrv kernel module if necessary.

where: suplibOsInit what: 3 VERR_VM_DRIVER_NOT_INSTALLED (-1908) - The
support driver is not installed. On linux, open returned ENOENT.

经过一番查找,需要重新安装kernel driver,方法如下

sudo apt-get install linux-headers-generic build-essential dkms
sudo apt-get remove virtualbox-dkms
sudo apt-get install virtualbox-dkms

到了这里,发现错误是由于:

Building only for 4.4.0-28-generic Building initial module for
4.4.0-28-generic ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/virtualbox-dkms.0.crash' Error! Bad return status for
module build on kernel: 4.4.0-28-generic (x86_64) Consult
/var/lib/dkms/virtualbox/5.0.18/build/make.log for more information.
Job for virtualbox.service failed because the control process exited
with error code. See "systemctl status virtualbox.service" and
"journalctl -xe" for details. invoke-rc.d: initscript virtualbox,
action "restart" failed.

继续看make.log文件,发现是由于gcc编译错误:

Makefile:676: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG:
-fstack-protector-strong not supported by compiler LD /var/lib/dkms/virtualbox/5.0.18/build/built-in.o LD
/var/lib/dkms/virtualbox/5.0.18/build/vboxdrv/built-in.o CC [M]
/var/lib/dkms/virtualbox/5.0.18/build/vboxdrv/linux/SUPDrv-linux.o
gcc: error: unrecognized command line option
‘-fstack-protector-strong’ scripts/Makefile.build:258: recipe for
target
'/var/lib/dkms/virtualbox/5.0.18/build/vboxdrv/linux/SUPDrv-linux.o'
failed

进而搜索,发现原来是gcc 4.9一下不支持 ‘-fstack-protector-strong’ 参数造成的。忽然想起原来在编译libsvm时将gcc降级到了4.7,重新选择回gcc-5:

sudo update-alternatives --config gcc

再执行上面的命令重新安装kernel driver即可编译成功:

depmod............
DKMS: install completed.

标签: ubuntu, virtual-box, gcc

已有 15 条评论

  1. 想想你的文章写的特别好https://www.ea55.com/

  2. 兄弟写的非常好 https://www.cscnn.com/

  3. 文章的确不错啊https://www.cscnn.com/

  4. 你的才华让人瞩目,期待你的更多文章。 http://www.55baobei.com/X5u45yLIj0.html

  5. 《掘金女郎》喜剧片高清在线免费观看:https://www.jgz518.com/xingkong/72936.html

  6. 博主太厉害了!

  7. 你的才华让人惊叹,你是我的榜样。 https://www.yonboz.com/video/56322.html

  8. 你的文章让我感受到了快乐,每天都要来看一看。 https://www.yonboz.com/video/7229.html

  9. 你的文章让我感受到了无尽的欢乐,谢谢分享。 https://www.yonboz.com/video/28421.html

  10. 你的才华横溢,让人敬佩。 http://www.55baobei.com/xJx7geGr1s.html

  11. shyixuejy.com

  12. 每次看到你的文章,我都觉得时间过得好快。 https://www.4006400989.com/qyvideo/23941.html

  13. 你的文章让我感受到了不一样的视角,非常精彩。 http://www.55baobei.com/sBn8YgNMWj.html

  14. 你的才华横溢,让人敬佩。 http://www.55baobei.com/aZFrb1P1s4.html

  15. 你的才华让人惊叹,请继续保持。 http://www.55baobei.com/CobYodkvBw.html

添加新评论