debian 9 安装Virtual Box

本文详细介绍了在Debian系统中安装VirtualBox的过程,包括解决安装过程中遇到的问题,如缺失GCC、Make、Perl等依赖包及Linux内核头文件。通过安装所需软件包并运行vboxconfig命令,确保VirtualBox正常工作。

1.去官网下载deb包,例如包名:

virtualbox-5.2_5.2.18-124319_Debian_stretch_amd64.deb

2.安装

sudo dpkg -i virtualbox-5.2_5.2.18-124319_Debian_stretch_amd64.deb

3.可能会出现如下问题:

root@debian:/home/kevin/下载# dpkg -i virtualbox-5.2_5.2.18-124319_Debian_stretch_amd64.deb 
(正在读取数据库 ... 系统当前共安装有 159348 个文件和目录。)
正准备解包 virtualbox-5.2_5.2.18-124319_Debian_stretch_amd64.deb  ...
正在将 virtualbox-5.2 (5.2.18-124319~Debian~stretch) 解包到 (5.2.18-124319~Debian~stretch) 上 ...
正在设置 virtualbox-5.2 (5.2.18-124319~Debian~stretch) ...
addgroup: 组"vboxusers"已经是系统组。退出。
Created symlink /etc/systemd/system/multi-user.target.wants/vboxdrv.service → /lib/systemd/system/vboxdrv.service.
Created symlink /etc/systemd/system/multi-user.target.wants/vboxballoonctrl-service.service → /lib/systemd/system/vboxballoonctrl-service.service.
Created symlink /etc/systemd/system/multi-user.target.wants/vboxautostart-service.service → /lib/systemd/system/vboxautostart-service.service.
Created symlink /etc/systemd/system/multi-user.target.wants/vboxweb-service.service → /lib/systemd/system/vboxweb-service.service.
This system is currently not set up to build kernel modules.
Please install the gcc make perl packages from your distribution.
Please install the Linux kernel "header" files matching the current kernel
for adding new hardware support to the system.
The distribution packages containing the headers are probably:
    linux-headers-amd64 linux-headers-4.9.0-8-amd64
This system is currently not set up to build kernel modules.
Please install the gcc make perl packages from your distribution.
Please install the Linux kernel "header" files matching the current kernel
for adding new hardware support to the system.
The distribution packages containing the headers are probably:
    linux-headers-amd64 linux-headers-4.9.0-8-amd64

There were problems setting up VirtualBox.  To re-start the set-up process, run
  /sbin/vboxconfig
as root.
正在处理用于 systemd (232-25+deb9u4) 的触发器 ...
正在处理用于 mime-support (3.60) 的触发器 ...
正在处理用于 hicolor-icon-theme (0.15-1) 的触发器 ...
正在处理用于 shared-mime-info (1.8-1+deb9u1) 的触发器 ...
Unknown media type in type 'all/all'
Unknown media type in type 'all/allfiles'

上面已经提示我们缺少gcc make perl 包,linux的内核头文件:linux-headers-amd64 linux-headers-4.9.0-8-amd64

我们只需要安装即可:

sudo apt-get install gcc
sudo apt-get install make
sudo apt-get install perl
sudo apt-get install linux-headers-amd64
sudo apt-get install linux-headers-4.9.0-8-amd64

最后执行:

sudo /sbin/vboxconfig

至此Virtual Box应该无大问题。

另外Virtual Box还有USB的拓展包可以去官网查看安装。

转载于:https://www.cnblogs.com/SirPi/p/9737978.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值