2019独角兽企业重金招聘Python工程师标准>>>
本想甩掉Windows从不再用的,没想到最近想做单片机开发。必须用到Windows下的Keil。那么装一个VirtualBox看看。
下载了RPM包:VirtualBox-4.3-4.3.6_91406_el6-1.i686.rpm
用命令安装:
$ sudo yum -ivh VirtualBox-4.3-4.3.6_91406_el6-1.i686.rpm
warning: VirtualBox-4.3-4.3.6_91406_el6-1.i686.rpm: Header V4 DSA/SHA1 Signature, key ID 98ab5139: NOKEY
Preparing... ########################################### [100%]1:VirtualBox-4.3 ########################################### [100%]Creating group 'vboxusers'. VM users must be member of that group!No precompiled module for this kernel found -- trying to build one. Messages
emitted during module compilation will be logged to /var/log/vbox-install.log.Stopping VirtualBox kernel modules [ OK ]
Recompiling VirtualBox kernel modules [FAILED](Look at /var/log/vbox-install.log to find out what went wrong)
结果没有成功。打开/usr/log/vbox-install.log文件,里面的错误信息如下:
Makefile:183: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=
说要用KERN_DIR环境变量指定内核路径。找 /usr/src/kernels/ 下,发现有内核目录 2.6.32-431.3.1.el6.i686。
如果没有找到,可能通过执行:
sudo yum install kernel-devel
来安装内核头文件。
在root权限下执行:
KERN_DIR=/usr/src/kernels/2.6.32-431.17.1.el6.i686 /etc/init.d/vboxdrv setup
Stopping VirtualBox kernel modules [ OK ]
Recompiling VirtualBox kernel modules [ OK ]
Starting VirtualBox kernel modules [ OK ]
然后就可以用了。