VBoxLinuxAdditions.run を実行して Unit vboxadd.service not loaded. になった時の対応方法

  • 0
    いいね
  • 0
    コメント

    MacのVirtualBoxに作った仮想マシンへGuest Additionsをインストールする をしていた時のしくじりです。

    環境

    • ホストOS : macOS Sierra Virsion 10.12.5
    • VirtualBox : Version 5.1.22 r115126 (Qt5.6.2)
      • ゲストOS : CentOS Linux 7.3.1611(Core)
      • 接続 : ブリッジ接続
      • Yum version : 3.4.3

    事象 : VBoxLinuxAdditions.run を実行したらエラーになってログファイルにUnit vboxadd.service not loaded.と書かれていた

    $ sudo sh /mnt/cdrom/VBoxLinuxAdditions.run
    Verifying archive integrity... All good.
    Uncompressing VirtualBox 5.1.22 Guest Additions for Linux...........
    VirtualBox Guest Additions installer
    You appear to have a version of the VirtualBox Guest Additions
    on your system which was installed from a different source or using a
    different type of installer.  If you installed it from a package from your
    Linux distribution or if it is a default part of the system then we strongly
    recommend that you cancel this installation and remove it properly before
    installing this version.  If this is simply an older or a damaged
    installation you may safely proceed.
    
    Do you wish to continue anyway? [yes or no] y
    Copying additional installer modules ...
    Installing additional modules ...
    vboxadd.sh: Starting the VirtualBox Guest Additions.
    Failed to set up service vboxadd, please check the log file
    /var/log/VBoxGuestAdditions.log for details.
    
    $ vi /var/log/VBoxGuestAdditions.log
    ▼▼▼▼▼▼▼▼▼▼▼▼ VBoxGuestAdditions.logの中身 ▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼
    Redirecting to /bin/systemctl stop  vboxadd-x11.service
    Failed to stop vboxadd-x11.service: Unit vboxadd-x11.service not loaded.
    Redirecting to /bin/systemctl stop  vboxvfs.service
    Failed to stop vboxvfs.service: Unit vboxvfs.service not loaded.
    Redirecting to /bin/systemctl stop  vboxadd-timesync.service
    Failed to stop vboxadd-timesync.service: Unit vboxadd-timesync.service not loaded.
    Redirecting to /bin/systemctl stop  vboxadd-service.service
    Failed to stop vboxadd-service.service: Unit vboxadd-service.service not loaded.
    Redirecting to /bin/systemctl stop  vboxadd.service
    Failed to stop vboxadd.service: Unit vboxadd.service not loaded.
    vboxadd.sh: failed: Configuration file /var/lib/VBoxGuestAdditions/config not found.
    vboxadd.sh: failed: Look at /var/log/vboxadd-install.log to find out what went wrong.
    vboxadd.sh: failed: Look at /var/log/vboxadd-install.log to find out what went wrong.
    vboxadd.sh: failed: modprobe vboxguest failed.
    

    原因 : よくわからない

    対応 : 勧められたとおりに一旦削除してやり直す

    we strongly recommend that you cancel this installation and remove it properly before installing this version.
    ざっくり和訳 :
    このバージョンをインストールする前に、このインストールをキャンセルして正しく削除することを強くお勧めします。

    1. CentOSを停止します。
    $ shutdown -h now
    ==== AUTHENTICATING FOR org.freedesktop.login1.power-off ===
    Authentication is required for powering off the system.
    Authenticating as: mana
    Password: 
    ==== AUTHENTICATION COMPLETE ===
    Connection to 192.168.0.6 closed by remote host.
    Connection to 192.168.0.6 closed.
    

    2. 削除する
    Screen Shot 2017-07-18 at 0.01.05.png
    Screen Shot 2017-07-18 at 0.01.19.png

    3. CentOSを起動して[Devices] > [Insert Guest Additions CD image...]を選択します。
    4. マウントしてVBoxLinuxAdditions.run を実行します。

    $ sudo mount /dev/cdrom /mnt/cdrom/
    [sudo] password for mana: 
    mount: /dev/sr0 is write-protected, mounting read-only
    $ sudo sh /mnt/cdrom/VBoxLinuxAdditions.run