■debian stretchにvirtualboxを導入する。
参考:Download VirtualBox for Linux Hosts
https://www.virtualbox.org/wiki/Linux_Downloads
$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 9.3 (stretch)
Release: 9.3
Codename: stretch
■aptリポジトリを追加
$ echo 'deb http://download.virtualbox.org/virtualbox/debian stretch contrib' | \
sudo tee /etc/apt/sources.list.d/virtualbox.list >/dev/null
$ grep ^[fh].*proxy /etc/wgetrc | sed -e 's/[0-9]/X/g'
http_proxy = http://XXX.XX.XX.XX:XXXX/
https_proxy = http://XXX.XX.XX.XX:XXXX/
ftp_proxy = http://XXX.XX.XX.XX:XXXX/
$ wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
OK
$ wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -
OK
$ apt-key list 2>&1 | head -12
Warning: apt-key output should not be parsed (stdout is not a terminal)
/etc/apt/trusted.gpg
--------------------
pub rsa4096 2016-04-22 [SC]
B9F8 D658 297A F3EF C18D 5CDF A2F6 83C5 2980 AECF
uid [ unknown] Oracle Corporation (VirtualBox archive signing key) <info@virtualbox.org>
sub rsa4096 2016-04-22 [E]
pub dsa1024 2010-05-18 [SC]
7B0F AB3A 13B9 0743 5925 D9C9 5442 2A4B 98AB 5139
uid [ unknown] Oracle Corporation (VirtualBox archive signing key) <info@virtualbox.org>
sub elg2048 2010-05-18 [E]
■aptリポジトリを反映
$ grep Proxy /etc/apt/apt.conf | sed -e 's/[0-9]/X/g'
Acquire::http::Proxy "http://XXX.XX.XX.XX:XXXX/";
$ cat ./myscripts/update.sh
echo -e "update\nupgrade\nautoremove\nautoclean" | \
awk '{print "apt-get -y "$1};END{print "apt-get clean all"}' | sudo sh
$ ./myscripts/update.sh
■virtualboxを検索、インストール。
$ apt-cache search ^virtualbox
virtualbox-5.0 - Oracle VM VirtualBox
virtualbox-5.1 - Oracle VM VirtualBox
virtualbox-5.2 - Oracle VM VirtualBox
$ sudo apt-get install -y virtualbox-5.2
$ sudo apt-get install -y linux-headers-4.9.0-4-amd64 linux-headers-amd64
$ su root -c '/sbin/vboxconfig'
パスワード:
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.
vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules.
vboxdrv.sh: Starting VirtualBox services.
$ virtualbox -h | head -3
Oracle VM VirtualBox Manager 5.2.8
(C) 2005-2018 Oracle Corporation
All rights reserved.