CLOVER🍀

That was when it all began.

Ubuntu Linux 18.04 LTSに、VirtualBox 6.0をaptでインストールする

VirtualBoxを、これまでdebファイルをダウンロードしてインストールしていたのですが、aptでインストールしてみようかなと。

Oracle VM VirtualBox

VirtualBox自体の説明はしません。

今回の環境は、こちら。Ubuntu Linux 18.04 LTSです。

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.3 LTS
Release:    18.04
Codename:   bionic

Linux向けのインストール方法は、こちら。

https://www.virtualbox.org/wiki/Linux_Downloads

DebianベースのLinuxディストリビューション向けのインストール方法も書いてあるのですが、Ubuntu Linuxの場合はどうしましょうか、と。

Debian-based Linux distributions

まずは、aptで使う鍵を追加。

$ 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リポジトリを追加します。

$ sudo add-apt-repository 'deb https://download.virtualbox.org/virtualbox/debian bionic contrib'

「bionic」というのは、Ubuntu Linux 18.04 LTSのコードネームです。ドキュメントにはUbuntu Linuxのコードネームの場合については
書いていませんが、これで大丈夫なんですね。

「apt update」してから

$ sudo apt update

VirtualBox 6.0をインストール。

$ sudo apt install virtualbox-6.0

VirtualBoxを起動。

$ VirtualBox

f:id:Kazuhira:20190928223029p:plain

とりあえず、入りました、と。

Ubuntu LinuxVirtualBoxとセキュアブートとの相性

セキュアブートが有効な場合、ハマったというか、面倒になって諦めました…。

VirtualBox + Secure Boot + Ubuntu = fail – Øyvind Stegard

VirtualBox起動時に、こんなメッセージが出ている場合(この問題を修正しないと、仮想マシンを開始できないと言ってます)

         WARNING: The vboxdrv kernel module is not loaded. Either there is no module
         available for the current kernel (4.15.0-64-generic) or it failed to
         load. Please recompile the kernel module and install it by

           sudo /sbin/vboxconfig

         You will not be able to start VMs until this problem is fixed.

指示通りコマンドを実行して

$ sudo /sbin/vboxconfig

上手くいきません…。

$ sudo /sbin/vboxconfig
vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Starting VirtualBox services.
vboxdrv.sh: You must sign these kernel modules before using VirtualBox:
  vboxdrv vboxnetflt vboxnetadp vboxpci
See the documenatation for your Linux distribution..
vboxdrv.sh: Building VirtualBox kernel modules.
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
vboxdrv.sh: Failed to enroll secure boot key..
vboxdrv.sh: failed: modprobe vboxdrv failed. Please use 'dmesg' to find out why.

There were problems setting up VirtualBox.  To re-start the set-up process, run
  /sbin/vboxconfig
as root.  If your system is using EFI Secure Boot you may need to sign the
kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) before you can load
them. Please see your Linux system's documentation for more information.

このメッセージでは、「/var/cache/debconf/config.dat」がロックされていると言っているのですが、それを解除しても失敗します。

調べていくとこのあたりにたどり着くのですが、面倒になってやめました…。

VirtualBox + Secure Boot + Ubuntu = fail – Øyvind Stegard

第444回 Ubuntuにおけるセキュアブートの仕組み:Ubuntu Weekly Recipe|gihyo.jp … 技術評論社