Ubuntu 下 virtualbox无法启动

ubuntu更新后如果出现virtualbox 无法启动的现象,一般都是因为默认工作gcc版本与系统gcc 版本不匹配造成的。

Ubuntu 下 virtualbox无法启动_第1张图片

检查gcc 版本,若存在多个gcc请切换到系统默认的gcc版本。

~$ ls /usr/bin/gcc*
/usr/bin/gcc      /usr/bin/gcc-7       /usr/bin/gcc-ar-5  /usr/bin/gcc-nm      /usr/bin/gcc-nm-7        /usr/bin/gcc-ranlib-5
/usr/bin/gcc-4.8  /usr/bin/gcc-ar      /usr/bin/gcc-ar-7  /usr/bin/gcc-nm-4.8  /usr/bin/gcc-ranlib      /usr/bin/gcc-ranlib-7
/usr/bin/gcc-5    /usr/bin/gcc-ar-4.8  /usr/bin/gcc.bak   /usr/bin/gcc-nm-5    /usr/bin/gcc-ranlib-4.8

~$ sudo rm /usr/bin/gcc
~$ sudo ln -s /usr/bin/gcc-7 /usr/bin/gcc

执行vboxconfig重新编译驱动:

~$ sudo /sbin/vboxconfig
vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules.
vboxdrv.sh: Starting VirtualBox services.

同理,若NVIDIA 显卡驱动异常,先将显卡驱动切换为开源驱动

~$ nvidia-smi
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

Ubuntu 下 virtualbox无法启动_第2张图片

在切换成上面的nvidia-driver-390 私有驱动,点击应用更改后重启:

~$ nvidia-smi
Tue Jul 31 10:28:10 2018       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 390.48                 Driver Version: 390.48                    |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 960M    Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   57C    P0    N/A /  N/A |    251MiB /  2004MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      1342      G   /usr/lib/xorg/Xorg                            24MiB |
|    0      1432      G   /usr/bin/gnome-shell                          48MiB |
|    0      1706      G   /usr/lib/xorg/Xorg                            92MiB |
|    0      1915      G   /usr/bin/gnome-shell                          81MiB |
+-----------------------------------------------------------------------------+

因工作需要只能使用低版本gcc,切换回来:

~$ sudo rm /usr/bin/gcc
~$ sudo ln -s /usr/bin/gcc-4.8 /usr/bin/gcc
~$ ls -l /usr/bin/gcc
lrwxrwxrwx 1 root root 16 7月  31 10:31 /usr/bin/gcc -> /usr/bin/gcc-4.8

 

你可能感兴趣的:(Ubuntu)