kb84tkhrのブログ

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

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

VirtualBoxの画面をフルスクリーンにしたい
っていうか、「表示」-「フルスクリーンモード」は選択できるんだけれども
画面全体が黒くなってまんなかに今までと同じ大きさでデスクトップが
表示されるだけ
そんなんじゃないんだやりたいのは

検索してみるとVirtualBox Guest Additionsをインストールせよと
いう記事が出てくる
Vagrantが何か手伝ってくれるんじゃないかと検索してみたけれども
どうも出てこない
手でやるしかないのかなあ

光学ドライブにイメージをマウントしてインストールするらしいけど
どこかからダウンロードして実行すればいいのならVagrantfileに
書いて実行でもよさそうではある
ただしこれまで手でやった分は消えてしまうと思うけど

とりあえず手でやるか

まず仮想マシン光学ドライブを追加する
VirtualBoxを起動して、対象のVMを選択
「設定」-「ストレージ」で「光学ドライブの追加」アイコンをクリック
仮想光学ディスクを割り当てますか、と聞かれるが空のままにする
(あとでイメージをマウントするので)

仮想マシンを起動
「デバイス」メニューで「Guest Additions CDイメージを挿入」を選択
マウントできねえぞと

f:id:kb84tkhr:20190411224817p:plain

ダメ元で普通にコマンドラインからマウントしたらすんなりいけた
なんなの

root@ubuntu-xenial:~# mount /dev/sr0 /media/cdrom
mount: /dev/sr0 is write-protected, mounting read-only
root@ubuntu-xenial:~# ls /media/cdrom
AUTORUN.INF                        VBoxSolarisAdditions.pkg
NT3x                               VBoxWindowsAdditions-amd64.exe
OS2                                VBoxWindowsAdditions-x86.exe
TRANS.TBL                          VBoxWindowsAdditions.exe
VBoxDarwinAdditions.pkg            autorun.sh
VBoxDarwinAdditionsUninstall.tool  cert
VBoxLinuxAdditions.run             runasroot.sh

VBoxLinuxAdditions.runってやつを実行すればいいらしい

root@ubuntu-xenial:~# cd /media/cdrom
root@ubuntu-xenial:/media/cdrom# ./VBoxLinuxAdditions.run 
Verifying archive integrity... All good.
Uncompressing VirtualBox 6.0.4 Guest Additions for Linux........
VirtualBox Guest Additions installer
This system appears to have a version of the VirtualBox Guest Additions
already installed.  If it is part of the operating system and kept up-to-date,
there is most likely no need to replace it.  If it is not up-to-date, you
should get a notification when you start the system.  If you wish to replace
it with this version, please do not continue with this installation now, but
instead remove the current version first, following the instructions for the
operating system.

If your system simply has the remains of a version of the Additions you could
not remove you should probably continue now, and these will be removed during
installation.

Do you wish to continue? [yes or no]

もう入ってるから入れなくていいよ
そうですか

Vagrantが最初から入れてくれてたってことか
そりゃ記事に出てこないわけだな
でフルスクリーンはどうしてくれんの

そういえば
Additionsが入ってるならクリップボードも共有されそうなものなんだけど
それもできてないんだよな
なにかおかしいのでは

そういえば "If it is not up-to-date, you should get a notification
when you start the system." って書いてあったなと思って確認したら
起動時のメッセージにこんなのが出てた

    default: The guest additions on this VM do not match the installed version of
    default: VirtualBox! In most cases this is fine, but in rare cases it can
    default: prevent things such as shared folders from working properly. If you see
    default: shared folder errors, please make sure the guest additions within the
    default: virtual machine match the version of VirtualBox you have installed on
    default: your host and reload your VM.
    default:
    default: Guest Additions Version: 5.1.38
    default: VirtualBox Version: 6.0

これか!
結局さっきのでyesにしてインストールを続行してみればいいのか?

Do you wish to continue? [yes or no]
yes
touch: '/var/lib/VBoxGuestAdditions/skip-4.4.0-145-generic' に touch できません: そのようなファイルやディレクトリはありません
Copying additional installer modules ...
Installing additional modules ...
VirtualBox Guest Additions: Building the VirtualBox Guest Additions kernel 
modules.  This may take a while.
VirtualBox Guest Additions: To build modules for other installed kernels, run
VirtualBox Guest Additions:   /sbin/rcvboxadd quicksetup <version>
VirtualBox Guest Additions: Building the modules for kernel 4.4.0-145-generic.

VirtualBox Guest Additions: Look at /var/log/vboxadd-setup.log to find out what 
went wrong
VirtualBox Guest Additions: Running kernel modules will not be replaced until 
the system is restarted
VirtualBox Guest Additions: Starting.
VirtualBox Guest Additions: Building the modules for kernel 4.4.0-145-generic.

VirtualBox Guest Additions: Look at /var/log/vboxadd-setup.log to find out what 
went wrong

だめっぽいな
いちおう再起動してみる
やっぱり変わってない

今日はここまで