Ubuntu 12.04安装virtualbox失败解决

转自:http://blog.163.com/excellent_2008/blog/static/3076015620132294284308/

Issue: Ubuntu 12.04安装Virtual box时error message包含:

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. No protocol specified No protocol specified Failed to open the X11 display!

* Starting VirtualBox kernel modules * No suitable module for running kernel found [fail]

sudo dpkg-reconfigure virtualbox-dkms ------------------------------ Deleting module version: 4.1.12 completely from the DKMS tree. ------------------------------ Done. Loading new virtualbox-4.1.12 DKMS files... Building only for 3.5.0-25-generic Building initial module for 3.5.0-25-generic Error! Bad return status for module build on kernel: 3.5.0-25-generic (i686) Consult /var/lib/dkms/virtualbox/4.1.12/build/make.log for more information. * Stopping VirtualBox kernel modules [ OK ] * Starting VirtualBox kernel modules * No suitable module for running kernel found [fail] invoke-rc.d: initscript virtualbox, action "restart" failed.

Google search后有很多的解决方案,包括通过

apt-get remove virutalbox
apt-get install virtualbox

命令重新安装virtual-box,或

sudo dpkg-reconfigure virtualbox-dkms

重新配置内核.但是尝试后均失败.

问题的原因: Virtual-box 4.1.12(Ubuntu12.04官方库收录的版本)接口改动导致Ubuntu安装后出现问题.

解决:添加virtual-box官方库至ubuntu,安装virtual box的最新版本即可.操作步骤可查看 virtual box官方 ,下方引用官方指导,建议选择安装Virtual-box 4.2

Add one of the following lines according to your distribution to your /etc/apt/sources.list:

deb http://download.virtualbox.org/virtualbox/debian precise contrib
deb http://download.virtualbox.org/virtualbox/debian oneiric contrib
deb http://download.virtualbox.org/virtualbox/debian natty contrib
deb http://download.virtualbox.org/virtualbox/debian maverick contrib non-free
deb http://download.virtualbox.org/virtualbox/debian lucid contrib non-free
deb http://download.virtualbox.org/virtualbox/debian karmic contrib non-free
deb http://download.virtualbox.org/virtualbox/debian hardy contrib non-free
deb http://download.virtualbox.org/virtualbox/debian wheezy contrib
deb http://download.virtualbox.org/virtualbox/debian squeeze contrib non-free
deb http://download.virtualbox.org/virtualbox/debian lenny contrib non-free

The Oracle public key for apt-secure can be downloaded  here. You can add this key with

sudo apt-key add oracle_vbox.asc

or combine downloading and registering:

wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add -

The key fingerprint is

7B0F AB3A 13B9 0743 5925  D9C9 5442 2A4B 98AB 5139
Oracle Corporation (VirtualBox archive signing key) <info@virtualbox.org>

(As of VirtualBox 3.2, the signing key was changed. The old Sun public key for apt-secure can be downloaded  here.)

To install VirtualBox, do

sudo apt-get update
sudo apt-get install virtualbox-4.2

Note: Ubuntu/Debian users might want to install the dkms package to ensure that the VirtualBox host kernel modules (vboxdrvvboxnetflt and vboxnetadp) are properly updated if the linux kernel version changes during the next apt-get upgrade. For Debian it is available in Lenny backports and in the normal repository for Squeeze and later. The dkms package can be installed through the Synaptic Package manager or through the following command:

sudo apt-get install dkms

What to do when experiencing The following signatures were invalid: BADSIG ... when refreshing the packages from the repository?

# sudo -s -H
# apt-get clean
# rm /var/lib/apt/lists/*
# rm /var/lib/apt/lists/partial/*
# apt-get clean
# apt-get update
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值