Ubuntu VirtualBox 安装问题解决
前言
想在Ubuntu上跑一下as玩玩,那就必须得装个虚拟机virtualbox,没成想出了问题。
安装命令:
sudo apt-get install virtualbox
制造问题
安装过程说有些警告信息,但是还是结束了,没放心上,结果执行报错信息如下:
aaa@qq.com:~$ virtualbox
WARNING: The vboxdrv kernel module is not loaded. Either there is no module
available for the current kernel (4.15.0-112-generic) or it failed to
load. Please recompile the kernel module and install it by
sudo /sbin/vboxconfig
You will not be able to start VMs until this problem is fixed.
解决问题
先去查看下日志信息:
cat /var/log/vbox-setup.log
(PS:如果没有该日志文件,可以试试 参考1 里面下载的安装包用 dpkg 安装,用迅雷下载更快哦)
主要信息:
gcc: error: unrecognized command line option ‘-fstack-protector-strong’
scripts/Makefile.build:330: recipe for target ‘/tmp/vbox.0/SUPDrv.o’ failed
make[2]: *** [/tmp/vbox.0/SUPDrv.o] Error 1
gcc: error: unrecognized command line option ‘-fstack-protector-strong’
scripts/Makefile.build:330: recipe for target ‘/tmp/vbox.0/SUPDrvGip.o’ failed
make[2]: *** [/tmp/vbox.0/SUPDrvGip.o] Error 1
Makefile:1582: recipe for target ‘module/tmp/vbox.0’ failed
make[1]: *** [module/tmp/vbox.0] Error 2
/tmp/vbox.0/Makefile-footer.gmk:117: recipe for target ‘vboxdrv’ failed
make: *** [vboxdrv] Error 2
gcc不识别命令行选项,得,肯定是gcc版本出了问题,换成gcc-6试了下,ok,问题解决!
尽情玩耍吧!
参考
[1] virtual box下载地址
[2] virtual box安装问题解决