ubuntu安装virtualbox问题解决

前端之家收集整理的这篇文章主要介绍了ubuntu安装virtualbox问题解决前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

OS:ubuntu14.04

现象

erika@velvet:/etc/init.d$ sudo virtualBox setup
WARNING: The character device /dev/vBoxdrv does not exist.
Please install the virtualBox-ose-dkms package and the appropriate headers,most likely linux-headers-generic.

You will not be able to start VMs until this problem is fixed.

原因分析:

发现是linux-header安装的版本不对。linux-header是kernel头文件,头文件不对,编译的ko不对,ko不对,就没法安装上。

怎么发现的?在执行下面的修改方法时报告linux-kernel headers对应的版本不是想要的版本,因而觉察。

修改方法

868 sudo apt-get update && sudo apt-get install linux-headers-`uname -r`
869 sudo apt-get install --reinstall virtualBox
870 sudo apt-get install --reinstall virtualBox-dkms

验证

root@sky:~/cord/build# virtualBox --version
Failed to open the X11 display!
root@sky:~/cord/build# VBoxManage --version
4.3.36_Ubuntur105129
root@sky:~/cord/build#


参考

1

http://askubuntu.com/questions/465454/problem-with-the-installation-of-virtualBox

提到

sudo dpkg-reconfigure virtualBox-dkms
sudo dpkg-reconfigure virtualBox
sudo modprobe vBoxdrv

And to fix eth0:

sudo modprobe vBoxnetflt

2

http://askubuntu.com/questions/320288/what-is-the-linux-kernel-devel-equivalent-in-12-04-2-lts-3-5-0

提到

sudo apt-get update && sudo apt-get install linux-headers-`uname -r`

附件:修改结果内容

Croot@sky:~/cord/build# sudo apt-get update && sudo apt-get install linux-headers-`uname -r`
Ign http://mirrors.aliyun.com trusty InRelease
Hit http://mirrors.aliyun.com trusty-security InRelease
Hit http://mirrors.aliyun.com trusty-updates InRelease
Hit http://mirrors.aliyun.com trusty-proposed InRelease
Hit http://mirrors.aliyun.com trusty-backports InRelease
Hit http://mirrors.aliyun.com trusty Release.gpg 
Hit http://mirrors.aliyun.com trusty-security/main Sources
Hit http://mirrors.aliyun.com trusty-security/restricted Sources
Hit http://mirrors.aliyun.com trusty-security/universe Sources
Hit http://mirrors.aliyun.com trusty-security/multiverse Sources
Hit http://mirrors.aliyun.com trusty-security/main amd64 Packages
Hit http://mirrors.aliyun.com trusty-security/restricted amd64 Packages
Hit http://mirrors.aliyun.com trusty-security/universe amd64 Packages
Hit http://mirrors.aliyun.com trusty-security/multiverse amd64 Packages
Hit http://mirrors.aliyun.com trusty-security/main i386 Packages
Hit http://mirrors.aliyun.com trusty-security/restricted i386 Packages
Hit http://mirrors.aliyun.com trusty-security/universe i386 Packages
Hit http://mirrors.aliyun.com trusty-security/multiverse i386 Packages
Hit http://mirrors.aliyun.com trusty-security/main Translation-en
Hit http://mirrors.aliyun.com trusty-security/multiverse Translation-en
Hit http://mirrors.aliyun.com trusty-security/restricted Translation-en
Hit http://mirrors.aliyun.com trusty-security/universe Translation-en
Hit http://mirrors.aliyun.com trusty-updates/main Sources
Hit http://mirrors.aliyun.com trusty-updates/restricted Sources
Hit http://mirrors.aliyun.com trusty-updates/universe Sources
Hit http://mirrors.aliyun.com trusty-updates/multiverse Sources
Hit http://mirrors.aliyun.com trusty-updates/main amd64 Packages
Hit http://mirrors.aliyun.com trusty-updates/restricted amd64 Packages
Hit http://mirrors.aliyun.com trusty-updates/universe amd64 Packages
Hit http://mirrors.aliyun.com trusty-updates/multiverse amd64 Packages
Hit http://mirrors.aliyun.com trusty-updates/main i386 Packages
Hit http://mirrors.aliyun.com trusty-updates/restricted i386 Packages
Hit http://mirrors.aliyun.com trusty-updates/universe i386 Packages
Hit http://mirrors.aliyun.com trusty-updates/multiverse i386 Packages
Hit http://mirrors.aliyun.com trusty-updates/main Translation-en
Hit http://mirrors.aliyun.com trusty-updates/multiverse Translation-en
Hit http://mirrors.aliyun.com trusty-updates/restricted Translation-en
Hit http://mirrors.aliyun.com trusty-updates/universe Translation-en
Hit http://mirrors.aliyun.com trusty-proposed/main Sources
Hit http://mirrors.aliyun.com trusty-proposed/restricted Sources
Hit http://mirrors.aliyun.com trusty-proposed/universe Sources
Hit http://mirrors.aliyun.com trusty-proposed/multiverse Sources
Hit http://mirrors.aliyun.com trusty-proposed/main amd64 Packages
Hit http://mirrors.aliyun.com trusty-proposed/restricted amd64 Packages
Hit http://mirrors.aliyun.com trusty-proposed/universe amd64 Packages
Hit http://mirrors.aliyun.com trusty-proposed/multiverse amd64 Packages
Hit http://mirrors.aliyun.com trusty-proposed/main i386 Packages
Hit http://mirrors.aliyun.com trusty-proposed/restricted i386 Packages
Hit http://mirrors.aliyun.com trusty-proposed/universe i386 Packages
Hit http://mirrors.aliyun.com trusty-proposed/multiverse i386 Packages
Hit http://mirrors.aliyun.com trusty-proposed/main Translation-en
Hit http://mirrors.aliyun.com trusty-proposed/multiverse Translation-en
Hit http://mirrors.aliyun.com trusty-proposed/restricted Translation-en
Hit http://mirrors.aliyun.com trusty-proposed/universe Translation-en
Hit http://mirrors.aliyun.com trusty-backports/main Sources
Hit http://mirrors.aliyun.com trusty-backports/restricted Sources
Hit http://mirrors.aliyun.com trusty-backports/universe Sources
Hit http://mirrors.aliyun.com trusty-backports/multiverse Sources
Hit http://mirrors.aliyun.com trusty-backports/main amd64 Packages
Hit http://mirrors.aliyun.com trusty-backports/restricted amd64 Packages
Hit http://mirrors.aliyun.com trusty-backports/universe amd64 Packages
Hit http://mirrors.aliyun.com trusty-backports/multiverse amd64 Packages
Hit http://mirrors.aliyun.com trusty-backports/main i386 Packages
Hit http://mirrors.aliyun.com trusty-backports/restricted i386 Packages
Hit http://mirrors.aliyun.com trusty-backports/universe i386 Packages
Hit http://mirrors.aliyun.com trusty-backports/multiverse i386 Packages
Hit http://mirrors.aliyun.com trusty-backports/main Translation-en
Hit http://mirrors.aliyun.com trusty-backports/multiverse Translation-en
Hit http://mirrors.aliyun.com trusty-backports/restricted Translation-en
Hit http://mirrors.aliyun.com trusty-backports/universe Translation-en
Hit http://mirrors.aliyun.com trusty Release
Hit http://mirrors.aliyun.com trusty/main Sources
Hit http://mirrors.aliyun.com trusty/restricted Sources
Hit http://mirrors.aliyun.com trusty/universe Sources
Hit http://mirrors.aliyun.com trusty/multiverse Sources
Hit http://mirrors.aliyun.com trusty/main amd64 Packages
Hit http://mirrors.aliyun.com trusty/restricted amd64 Packages
Hit http://mirrors.aliyun.com trusty/universe amd64 Packages
Hit http://mirrors.aliyun.com trusty/multiverse amd64 Packages
Hit http://mirrors.aliyun.com trusty/main i386 Packages
Hit http://mirrors.aliyun.com trusty/restricted i386 Packages
Hit http://mirrors.aliyun.com trusty/universe i386 Packages
Hit http://mirrors.aliyun.com trusty/multiverse i386 Packages
Hit http://mirrors.aliyun.com trusty/main Translation-en
Hit http://mirrors.aliyun.com trusty/multiverse Translation-en
Hit http://mirrors.aliyun.com trusty/restricted Translation-en
Hit http://mirrors.aliyun.com trusty/universe Translation-en
Ign http://mirrors.aliyun.com trusty/main Translation-en_US
Ign http://mirrors.aliyun.com trusty/multiverse Translation-en_US
Ign http://mirrors.aliyun.com trusty/restricted Translation-en_US
Ign http://mirrors.aliyun.com trusty/universe Translation-en_US
Reading package lists... Done
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-image-3.13.0-110-generic linux-image-extra-3.13.0-110-generic linux-signed-image-3.13.0-24-generic
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  linux-headers-3.13.0-112
The following NEW packages will be installed:
  linux-headers-3.13.0-112 linux-headers-3.13.0-112-generic
0 upgraded,2 newly installed,0 to remove and 375 not upgraded.
Need to get 9,572 kB of archives.
After this operation,77.0 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://mirrors.aliyun.com/ubuntu/ trusty-security/main linux-headers-3.13.0-112 all 3.13.0-112.159 [8,878 kB]
Get:2 http://mirrors.aliyun.com/ubuntu/ trusty-security/main linux-headers-3.13.0-112-generic amd64 3.13.0-112.159 [694 kB]
Fetched 9,572 kB in 2min 21s (67.8 kB/s)                                                                          
Selecting prevIoUsly unselected package linux-headers-3.13.0-112.
(Reading database ... 123904 files and directories currently installed.)
Preparing to unpack .../linux-headers-3.13.0-112_3.13.0-112.159_all.deb ...
Unpacking linux-headers-3.13.0-112 (3.13.0-112.159) ...
Selecting prevIoUsly unselected package linux-headers-3.13.0-112-generic.
Preparing to unpack .../linux-headers-3.13.0-112-generic_3.13.0-112.159_amd64.deb ...
Unpacking linux-headers-3.13.0-112-generic (3.13.0-112.159) ...
Setting up linux-headers-3.13.0-112 (3.13.0-112.159) ...
Setting up linux-headers-3.13.0-112-generic (3.13.0-112.159) ...
Examining /etc/kernel/header_postinst.d.
run-parts: executing /etc/kernel/header_postinst.d/dkms 3.13.0-112-generic /boot/vmlinuz-3.13.0-112-generic
root@sky:~/cord/build# sudo apt-get install --reinstall virtualBox
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-image-3.13.0-110-generic linux-image-extra-3.13.0-110-generic linux-signed-image-3.13.0-24-generic
Use 'apt-get autoremove' to remove them.
0 upgraded,0 newly installed,1 reinstalled,0 to remove and 375 not upgraded.
Need to get 0 B/13.4 MB of archives.
After this operation,0 B of additional disk space will be used.
(Reading database ... 148741 files and directories currently installed.)
Preparing to unpack .../virtualBox_4.3.36-dfsg-1+deb8u1ubuntu1.14.04.1_amd64.deb ...
Unpacking virtualBox (4.3.36-dfsg-1+deb8u1ubuntu1.14.04.1) over (4.3.36-dfsg-1+deb8u1ubuntu1.14.04.1) ...
Processing triggers for man-db (2.6.7.1-1) ...
Processing triggers for ureadahead (0.100.0-16) ...
Setting up virtualBox (4.3.36-dfsg-1+deb8u1ubuntu1.14.04.1) ...
 * Stopping VirtualBox kernel modules
   ...done.
 * Starting VirtualBox kernel modules
   ...done.
root@sky:~/cord/build# sudo apt-get install --reinstall virtualBox-dkms
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-image-3.13.0-110-generic linux-image-extra-3.13.0-110-generic linux-signed-image-3.13.0-24-generic
Use 'apt-get autoremove' to remove them.
0 upgraded,0 to remove and 375 not upgraded.
Need to get 0 B/567 kB of archives.
After this operation,0 B of additional disk space will be used.
(Reading database ... 148741 files and directories currently installed.)
Preparing to unpack .../virtualBox-dkms_4.3.36-dfsg-1+deb8u1ubuntu1.14.04.1_all.deb ...

-------- Uninstall Beginning --------
Module:  virtualBox
Version: 4.3.36
Kernel:  3.13.0-112-generic (x86_64)
-------------------------------------

Status: Before uninstall,this module version was ACTIVE on this kernel.

vBoxdrv.ko:
 - Uninstallation
   - Deleting from: /lib/modules/3.13.0-112-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any prevIoUs module version.


vBoxnetadp.ko:
 - Uninstallation
   - Deleting from: /lib/modules/3.13.0-112-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any prevIoUs module version.


vBoxnetflt.ko:
 - Uninstallation
   - Deleting from: /lib/modules/3.13.0-112-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any prevIoUs module version.


vBoxpci.ko:
 - Uninstallation
   - Deleting from: /lib/modules/3.13.0-112-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any prevIoUs module version.

depmod....

DKMS: uninstall completed.

-------- Uninstall Beginning --------
Module:  virtualBox
Version: 4.3.36
Kernel:  3.13.0-117-generic (x86_64)
-------------------------------------

Status: Before uninstall,this module version was ACTIVE on this kernel.

vBoxdrv.ko:
 - Uninstallation
   - Deleting from: /lib/modules/3.13.0-117-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any prevIoUs module version.


vBoxnetadp.ko:
 - Uninstallation
   - Deleting from: /lib/modules/3.13.0-117-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any prevIoUs module version.


vBoxnetflt.ko:
 - Uninstallation
   - Deleting from: /lib/modules/3.13.0-117-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any prevIoUs module version.


vBoxpci.ko:
 - Uninstallation
   - Deleting from: /lib/modules/3.13.0-117-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any prevIoUs module version.

depmod....

DKMS: uninstall completed.

------------------------------
Deleting module version: 4.3.36
completely from the DKMS tree.
------------------------------
Done.
Unpacking virtualBox-dkms (4.3.36-dfsg-1+deb8u1ubuntu1.14.04.1) over (4.3.36-dfsg-1+deb8u1ubuntu1.14.04.1) ...
Setting up virtualBox-dkms (4.3.36-dfsg-1+deb8u1ubuntu1.14.04.1) ...
Loading new virtualBox-4.3.36 DKMS files...
Building for 3.13.0-112-generic and 3.13.0-117-generic
Building initial module for 3.13.0-112-generic
Done.

vBoxdrv:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/3.13.0-112-generic/updates/dkms/

vBoxnetadp.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/3.13.0-112-generic/updates/dkms/

vBoxnetflt.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/3.13.0-112-generic/updates/dkms/

vBoxpci.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/3.13.0-112-generic/updates/dkms/

depmod....

DKMS: install completed.
Building initial module for 3.13.0-117-generic
Done.

vBoxdrv:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/3.13.0-117-generic/updates/dkms/

vBoxnetadp.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/3.13.0-117-generic/updates/dkms/

vBoxnetflt.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/3.13.0-117-generic/updates/dkms/

vBoxpci.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/3.13.0-117-generic/updates/dkms/

depmod....

DKMS: install completed.
 * Stopping VirtualBox kernel modules
   ...done.
 * Starting VirtualBox kernel modules
   ...done.
root@sky:~/cord/build# 
原文链接:https://www.f2er.com/ubuntu/353519.html

猜你在找的Ubuntu相关文章