红联Linux门户
Linux帮助

ubuntu给不同版本的内核安装virtualbox内核模块

发布时间:2015-11-22 09:52:29来源:linux网站作者:Gertificate

系统是3.13.0-61的内核,有时需要用到其他内核,因此系统有多个内核,需要给每个内核安装vboxdrv内核模块,否则会“闹鬼”!

下面是笔记,仅供参考!


========
=查看信息 =
==============================
ukey@ukey-Rev-1-0:~$ uname -a
Linux ukey-Rev-1-0 3.13.0-61-generic #100-Ubuntu SMP Wed Jul 29 11:22:15 UTC 2015 i686 i686 i686 GNU/Linux
ukey@ukey-Rev-1-0:~$ dpkg -l | grep virtualbox
ii  unity-scope-virtualbox                                0.1+13.10.20130723-0ubuntu1                         all          VirtualBox scope for Unity
ii  virtualbox                                            4.3.10-dfsg-1ubuntu5                                i386         x86 virtualization solution - base binaries
ii  virtualbox-dkms                                       4.3.10-dfsg-1ubuntu5                                all          x86 virtualization solution - kernel module sources for dkms
ii  virtualbox-qt                                         4.3.10-dfsg-1ubuntu5                                i386         x86 virtualization solution - Qt based user interface
ukey@ukey-Rev-1-0:~$
===============================
ukey@ukey-Rev-1-0:/etc/init.d$ sudo find / -name vboxdrv
[sudo] password for ukey:
^Cukey@ukey-Rev-1-0:/etc/init.d$ sudo find / -name vboxdrv
/usr/src/virtualbox-4.3.10/vboxdrv
/dev/vboxdrv
/sys/bus/platform/drivers/vboxdrv
/sys/devices/virtual/misc/vboxdrv
/sys/class/misc/vboxdrv
/sys/module/vboxdrv
/var/lib/dkms/virtualbox/4.3.10/build/vboxdrv
ukey@ukey-Rev-1-0:/etc/init.d$
==================================
ukey@ukey-Rev-1-0:/etc/init.d$ dpkg -S virtualbox | grep /etc
virtualbox: /etc/default/virtualbox
virtualbox: /etc/init.d/virtualbox
ukey@ukey-Rev-1-0:/etc/init.d$
===================================
ukey@ukey-Rev-1-0:/lib$ sudo find / -name vboxdrv.ko
/lib/modules/3.13.0-35-generic/updates/dkms/vboxdrv.ko
/lib/modules/3.13.0-61-generic/updates/dkms/vboxdrv.ko
/var/lib/dkms/virtualbox/4.3.10/3.13.0-35-generic/i686/module/vboxdrv.ko
/var/lib/dkms/virtualbox/4.3.10/3.13.0-61-generic/i686/module/vboxdrv.ko
/var/lib/dkms/virtualbox/4.3.10/build/vboxdrv/vboxdrv.ko

=========
=编译 安装 =
====================================
ukey@ukey-Rev-1-0:/lib$ man dkms
ukey@ukey-Rev-1-0:/lib$ sudo dkms build virtualbox/4.3.10 -k 3.13.0-32-generic

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area....
make KERNELRELEASE=3.13.0-32-generic -C /lib/modules/3.13.0-32-generic/build M=/var/lib/dkms/virtualbox/4.3.10/build.........................
cleaning build area....

DKMS: build completed.
ukey@ukey-Rev-1-0:/lib$ sudo dkms install virtualbox/4.3.10 -k 3.13.0-32-generic

vboxdrv:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/3.13.0-32-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-32-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-32-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-32-generic/updates/dkms/

depmod.........
===============================

DKMS: install completed.
ukey@ukey-Rev-1-0:/lib$

=========
=安装完成=
=============================================

ukey@ukey-Rev-1-0:/lib$ sudo find /lib -name vboxdrv.ko
/lib/modules/3.13.0-32-generic/updates/dkms/vboxdrv.ko
/lib/modules/3.13.0-35-generic/updates/dkms/vboxdrv.ko
/lib/modules/3.13.0-61-generic/updates/dkms/vboxdrv.ko
ukey@ukey-Rev-1-0:/lib$

==============================================

ubuntu给不同版本的内核安装virtualbox内核模块


ubuntu上使用virtualbox安装win10:http://www.linuxdiyf.com/linux/13640.html

通过Virtualbox创建一个新虚机:http://www.linuxdiyf.com/linux/13377.html

Linux系统入门学习:教你在VirtualBox安装Fedora 22:http://www.linuxdiyf.com/linux/13349.html

Linux系统入门学习:教你在VirtualBox安装Ubuntu 15.04:http://www.linuxdiyf.com/linux/13348.html