Jaybanuan's Blog

どうせまた調べるハメになることをメモしていくブログ

Ubuntu 18.04でVMWare Workstation Player 14が動作するまで

はじめに

Ubuntu 18.04でVMWare Workstation Player 14を動かすのに苦労したので、記録を残しておく。

環境

$ uname -srvm
Linux 4.15.0-20-generic #21-Ubuntu SMP Tue Apr 24 06:16:15 UTC 2018 x86_64

初回の起動に失敗 (1)

インストール完了後の初回起動時、GCCをインストールしていなかったので、以下のようにGCCのパスを入力するように求められた。

f:id:redj:20180522031302p:plain

一旦終了し、以下のようにGCCをインストールして解消。

$ sudo apt install gcc build-essential linux-headers-$(uname -r)

初回の起動に失敗 (2)

追記:これはVMWare Workstation Player 14.0.0がUbuntu 18.04に未対応だったためであり、14.1.2から正式サポートとのこと。

再度VMWare Workstation Playerを起動したが、以下のようにモジュールのビルドで失敗して起動できなかった。

f:id:redj:20180522005445p:plain

続いて以下のようにポップアップが出た。

f:id:redj:20180522005441p:plain

ポップアップのメッセージに従ってログを確認。

$ sudo cat /tmp/vmware-root/vmware-14987.log
(中略)
2018-05-18T22:20:59.882+09:00| vthread-1| I125: Extracting the vmmon source from "/usr/lib/vmware/modules/source/vmmon.tar".
2018-05-18T22:20:59.917+09:00| vthread-1| I125: Successfully extracted the vmmon source.
2018-05-18T22:20:59.917+09:00| vthread-1| I125: Building module with command "/usr/bin/make -j8 -C /tmp/modconfig-hTdKsp/vmmon-only auto-build HEADER_DIR=/lib/modules/4.15.0-20-generic/build/include CC=/usr/bin/gcc IS_GCC_3=no"
2018-05-18T22:21:06.590+09:00| vthread-1| W115: Failed to build vmmon.  Failed to execute the build command.

vmmon.tarに含まれるソースのビルドに失敗している。 コンパイルエラーの詳細が出力されていないので、ログに記録されている一時ディレクトリを作成し、一度そこで自力でビルドしてエラーを確認してみる。 なお、いちいちsudoが面倒なので、以降ではsudo su -を実行済みの状態でコマンドを打っている。

$ mkdir /tmp/vmware-root/modconfig-hTdKsp
$ cd /tmp/vmware-root/modconfig-hTdKsp
$ tar xf /usr/lib/vmware/modules/source/vmmon.tar
$ /usr/bin/make -j8 -C /tmp/modconfig-hTdKsp/vmmon-only auto-build HEADER_DIR=/lib/modules/4.15.0-20-generic/build/include CC=/usr/bin/gcc IS_GCC_3=no
(中略)
/tmp/modconfig-hTdKsp/vmmon-only/linux/driver.c: In function ‘LinuxDriverInitTSCkHz’:
/tmp/modconfig-hTdKsp/vmmon-only/linux/driver.c:254:22: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
    tscTimer.function = LinuxDriverEstimateTSCkHzDeferred;
                      ^
/tmp/modconfig-hTdKsp/vmmon-only/linux/driver.c:256:12: error: ‘struct timer_list’ has no member named ‘data’
    tscTimer.data     = 0;
            ^
(後略)

「ポインタの型が違う」とか「メンバ変数がない」とか言っているので、どうもカーネルの構造体に非互換があるように思える。 ググった結果、以下にSUSEのエンジニア(?)によるパッチがあることが判明。

README.mdおよびINSTALLを参照してパッチを適用すると、VMWare Workstation Playerの起動に成功した。

VMのリストが表示できない

VMWare Workstation Playerの起動に成功したものの、「Create a New Virtual Machine」しようが「Open a Virtual Machine」しようが、VMがリストに表示されず、VMの起動ができない。

f:id:redj:20180519014917p:plain

ググってみると、衝撃の回答を発見。

This only happens if you have deactivated 'Record file & application usage' in Ubuntu System Settings 'All Settings / Security & Privacy / Files & Applications'.

If you activate 'Record file & application usage' your list of VMs will not be lost anymore, as the file 'recently-used.xbel' will no longer be emptied. I'm actually very happy to have discovered this, because before I had to manually restore the list of VMs dozens of time.

回答はUbuntu 14.04に対するものなので設定箇所は若干違うが、今でもこの挙動らしい。 「設定」→「プライバシー」→「使用と履歴」の「最近使用したファイル」をオンにして解決。 信じられない仕様だな。。。

f:id:redj:20180519015505p:plain