4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

VirtualBox バージョンアップ後、ウィンドウの自動リサイズができなくなった件

Last updated at Posted at 2018-12-12

なにが起きたか

VirtualBox をバージョンアップしたらウィンドウの自動リサイズがきかなくなった。
「ゲストOSの画面を自動リサイズ」を選択しようとしても、クリックできないようになっていて選択できない。

こんな感じでウィンドウを広げても上下左右にグレーの枠が入るだけで大きくならない。

キャプチャ.PNG

追記(2018/12/18)

本記事の方法でひとまずリサイズは可能になりましたが、今度はクリックが効かなくなるなど謎の現象に悩まされました。。

GNOME の再インストールなど行いましたが解決せず。

最終的に、GNOME をやめて Xfce をインストールしたところ直りました。
→ これはCentOS(カーネル)側の問題のようでした。コメントありがとうございます。

ただし、GNOME を再インストールしたタイミングで mysql、VSCode、phpMyAdmin などがアンインストールされてしまったようで、少しめんどくさいことになりました(mysql のデータベース自体は生き残っていました)。

もし原因がわかる方がいたらぜひご教示ください。

(それでも開発環境を0から作り直すよりはよっぽどましですが。。)

Guest Additions をインストール

Guest Additions をインストールしようとしたところエラーが発生。

Installing additional modules ...
VirtualBox Guest Additions: Building the VirtualBox Guest Additions kernel modules.  This may take a while.

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.
Press Return to close this window...

/var/log/vboxadd-setup.log を見ろと言われますので確認します。

Building the main Guest Additions module.
Building the shared folder support module.
Building the graphics driver module.
Error building the module.  Build output follows.
make V=1 CONFIG_MODULE_SIG= -C /lib/modules/3.10.0-957.1.3.el7.x86_64/build SUBD
IRS=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 -j2 modules
make[1]: warning: -jN forced in submake: disabling jobserver mode.
test -e include/generated/autoconf.h -a -e include/config/auto.conf || (        
        \
echo >&2;                                                       \
echo >&2 "  ERROR: Kernel configuration is invalid.";           \
echo >&2 "         include/generated/autoconf.h or include/config/auto.conf are 
missing.";\
echo >&2 "         Run 'make oldconfig && make prepare' on kernel src to fix it.
";      \
echo >&2 ;                                                      \
/bin/false)
mkdir -p /tmp/vbox.0/.tmp_versions ; rm -f /tmp/vbox.0/.tmp_versions/*
make -f scripts/Makefile.build obj=/tmp/vbox.0

以下略

なるほどわからん。

結論

調べてみると yum update すれば直るとか必要なプラグインを入れれば直るとか書かれていますが、ダメでした。
最終的に、私の場合は Guest Additions のバージョンがよくなかったようです。

VirtualBox バージョンアップ後のそれぞれのバージョンは下記のとおりでした。

VirtualBox: 5.2.22
Guest Additions: 5.2.22

これを Guest Additions のバージョンだけ変更して

VirtualBox: 5.2.22
Guest Additions: 5.2.23

このようにすると動きました。

Guest Additions のイメージファイルはここからダウンロードしました。
ページ下部にある Guest Additions をクリックすればイメージファイルが落とせます。

落としてきたイメージファイルを CentOS の仮想ドライブへ挿入して実行すれば完了です。

参考

4
4
6

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?