1.去官网下载deb包,例如包名:linux
virtualbox-5.2_5.2.18-124319_Debian_stretch_amd64.deb
2.安装web
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-amd64ui
咱们只须要安装便可:spa
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
最后执行:code
sudo /sbin/vboxconfig
至此Virtual Box应该无大问题。blog
另外Virtual Box还有USB的拓展包能够去官网查看安装。get