kb84tkhrのブログ

何を書こうか考え中です あ、あと組織とは関係ないってやつです 個人的なやつ

PPP3: Ubuntuデスクトップの構築(横道・続き3)

“The guest additions on this VM do not match the installed version of VirtualBox”で
検索してみたら先人の知恵らしきものが

VagrantのboxのGuest Additionsのアップデート方法 - Qiita

Guest Additionsを入れたりアップデートしてくれたりするプラグインがあるらしい

GitHub - dotless-de/vagrant-vbguest: A Vagrant plugin to keep your VirtualBox Guest Additions up to date

インストール

$ vagrant plugin install vagrant-vbguest
Installing the 'vagrant-vbguest' plugin. This can take a few minutes...
Fetching: micromachine-2.0.0.gem (100%)
Fetching: vagrant-vbguest-0.17.2.gem (100%)
Installed the plugin 'vagrant-vbguest (0.17.2)'!

通常の使い方であればこれだけであとvagrant upすればアップデートしてくれるらしい

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'ubuntu/xenial64' version '20190406.0.0' is up to date...
  :
  :
==> default: Machine booted and ready!
Got different reports about installed GuestAdditions version:
Virtualbox on your host claims:   5.0.18
VBoxService inside the vm claims: 6.0.4
Going on, assuming VBoxService is correct...
  :
  :
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: flag to force provisioning. Provisioners marked to run always will still run.

Virtualboxは5.0.18って言ってるけど仮想マシン上のVBoxServiceは
6.0.4だって言ってる、6.0.4のほうを信じるよ

だって
ごちゃごちゃ試してた痕跡でも残ってるのかなあ
すんなりとはいかないものだね

コマンドで状態を確認することもできる

$ vagrant vbguest --status
Got different reports about installed GuestAdditions version:
Virtualbox on your host claims:   5.0.18
VBoxService inside the vm claims: 6.0.4
Going on, assuming VBoxService is correct...
[default] GuestAdditions 6.0.4 running --- OK.

同じだ

$ vagrant vbguest
Got different reports about installed GuestAdditions version:
Virtualbox on your host claims:   5.0.18
VBoxService inside the vm claims: 6.0.4
Going on, assuming VBoxService is correct...
[default] GuestAdditions 6.0.4 running --- OK.
Got different reports about installed GuestAdditions version:
Virtualbox on your host claims:   5.0.18
VBoxService inside the vm claims: 6.0.4
Going on, assuming VBoxService is correct...

変わらんな

VBoxClientとやらがエラーになってるぞ
なんだこれ
いつの間に出るようになった
Guest Additionsが半端にインストールされてしまったか?

うがー
消せるのか?

vagrant@ubuntu-xenial:~$ cd /opt
vagrant@ubuntu-xenial:/opt$ ls
VBoxGuestAdditions-6.0.4
vagrant@ubuntu-xenial:/opt$ cd VBoxGuestAdditions-6.0.4/
vagrant@ubuntu-xenial:/opt/VBoxGuestAdditions-6.0.4$ ls
LICENSE  bin  init  installer  lib  other  routines.sh  sbin  src  uninstall.sh
vagrant@ubuntu-xenial:/opt/VBoxGuestAdditions-6.0.4$ cd ..
vagrant@ubuntu-xenial:/opt$ sudo ./VBoxGuestAdditions-6.0.4/uninstall.sh
Removing installed version 6.0.4 of VirtualBox Guest Additions...
vagrant@ubuntu-xenial:/opt$ ls
vagrant@ubuntu-xenial:/opt$

消えたようだ
これで再起動すればもしかして・・・

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
  :
  :
[default] GuestAdditions versions on your host (6.0.4) and guest (5.0.18) do not match.
  :
Copy iso file C:\Program Files\Oracle\VirtualBox\VBoxGuestAdditions.iso into the box /tmp/VBoxGuestAdditions.iso
Mounting Virtualbox Guest Additions ISO to: /mnt
mount: /dev/loop0 is write-protected, mounting read-only
Installing Virtualbox Guest Additions 6.0.4 - guest version is 5.0.18
: VirtualBox Guest Additions: Look at /var/log/vboxadd-setup.log to find out what went wrong
: Unmounting Virtualbox Guest Additions ISO from: /mnt Got different reports about installed GuestAdditions version: Virtualbox on your host claims: 5.0.18 VBoxService inside the vm claims: 6.0.4 Going on, assuming VBoxService is correct...

途中まではよさげにみえたけど結局ビルドに失敗してさっきと同じ状態に
死にそうだ

まっさらな状態でやったらどうなるんだ?

$ vagrant init ubuntu/xenial64
$ vagrant up
  :
VirtualBox Guest Additions: Look at /var/log/vboxadd-setup.log to find out what
went wrong
  :

ダメか
こりゃさすがにどうしようもないか
ってなんでそんなにどうしようもないんだ?
みんな困ってるのか?

もう万策尽きたかなあ
そうだ
bento/ubuntu-16.04でも試してみるか

$ vagrant box add bento/ubuntu-16.04
$ vagrant init bento/ubuntu-16.04
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
  :
[default] GuestAdditions versions on your host (6.0.4) and guest (5.2.22) do not match.
  :
VirtualBox Guest Additions installer
  :
VirtualBox Guest Additions: Starting.
An error occurred during installation of VirtualBox Guest Additions 6.0.4. Some functionality may not work as intended.
In most cases it is OK that the "Window System drivers" installation failed.
Unmounting Virtualbox Guest Additions ISO from: /mnt
  :

なんかできたっぽい?
けどデスクトップ環境が入ってないから“Window System drivers”が
入らないってことだな?

ちょっと望みが出てきた