ubuntu 18.04安装virtualbox 后启动没反应

1. ubuntu 18.04

安装了virtualbox 对应的ubuntu18.04 amd64以后,启动virtualbox没反应,一闪而过,就是启动不起来

2. 直接命令行启动

找到命令 cd /usr/bin
启动 /usr/bin$ ./VirtualBox

WARNING: The vboxdrv kernel module is not loaded. Either there is no module
         available for the current kernel (4.15.0-33-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.
VirtualBox: Error -10 in SUPR3HardenedMain!
VirtualBox: Effective UID is not root (euid=1000 egid=1000 uid=1000 gid=1000)

VirtualBox: Tip! It may help to reinstall VirtualBox.

然后执行$ sudo /sbin/vboxconfig,仍然不好使,继续无情的报错

sudo: /sbin/vboxconfig: command not found

3. 修复

之后居然鬼使神差的想要查看软件版本号。想着安一个查看版本的工具/usr/bin$ sudo apt-get install apt-show-versions,结果出现如下:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 virtualbox-5.2 : Depends: libcurl4 (>= 7.16.2) but it is not going to be installed
                  Depends: libqt5opengl5 (>= 5.0.2) but it is not going to be installed
                  Depends: libqt5printsupport5 (>= 5.0.2) but it is not going to be installed
                  Depends: libqt5x11extras5 (>= 5.6.0) but it is not going to be installed
                  Depends: libsdl1.2debian (>= 1.2.11) but it is not going to be installed
                  Recommends: libsdl-ttf2.0-0 but it is not going to be installed
                  Recommends: gcc but it is not going to be installed
                  Recommends: make or
                              build-essential but it is not going to be installed or
                              dpkg-dev but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

既然如此,那就老实的执行/usr/bin$ sudo apt --fix-broken install
然后出现一大堆东西,最后

There were problems setting up VirtualBox.  To re-start the set-up process, run
  /sbin/vboxconfig
as root.

之后以root身份运行

/sbin/vboxconfig
vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Starting VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules.
This system is currently not set up to build kernel modules.
Please install the gcc make perl packages from your distribution.
This system is currently not set up to build kernel modules.
Please install the gcc make perl packages from your distribution.

There were problems setting up VirtualBox.  To re-start the set-up process, run
  /sbin/vboxconfig
as root.

到这以后,在从win键里边就可以启动virtualbox了,不知道您的问题解决了没

问题还是没解决,可能你能打开了virtualbox,但是你仍然不能安装虚拟机

怎么办??

又见到一高人,他和我报的错是一样的:

this system is currently not set up to build kernel modules. 
Please install the gcc make perl packages from your distribution. 
Please install the Linux kernel “header” files matching the current kernel 
for adding new hardware support to the system. 
The distribution packages containing the headers are probably: 

报错的原因是没有安装内核头文件,因此,我们首先安装内核头文件。
先看下内核版本号
uname -r

我的是:4.15.0-33-generic
安装内核头文件,命令:
apt-get install build-essential linux-headers-内核版本号
也就是apt-get install build-essential linux-headers-4.15.0-33-generic
会安装一些程序,安装完,重启一下,就没问题了

你可能感兴趣的:(linux)