LoginSignup
3
3

More than 5 years have passed since last update.

VirtualBoxで構築したUbuntu上で、adbコマンド(shell/logcat)が失敗する問題の対処法

Last updated at Posted at 2017-04-01

Environment

  • Vagrant
  • VirtualBox
  • ホストOS: macOS Sierra 10.12.4
  • ゲストOS: Ubuntu 14.04

Problem

VagrantとVirtualBoxでUbuntu環境を構築し、Android端末をつないで、Ubuntu上でadbshelllogcatコマンドを実行すると、結果が返ってこない(hanging)する場合があった。

Solution

stackoverflowで同様の問題があがっており、解決法も書いてあった。
adb can list devices but adb shell/logcat doesn't work

I had the exact same problem with adb shell hanging. I am running an Ubuntu 12.04 VM guest on an Ubuntu host. The problem for me was the USB Compatibility setting for the VM was set to 1.1, it needs to be at least 2.0. To change the setting power down the VM and choose the "Edit virtual machine settings" in the VMPlayer startup menu. Then select the "USB Controller" device and change "USB Compatibility" to USB 2.0.

要は、VMのUSBコントローラの設定を2.0以上に上げればよいということ。

具体的な手順

1. VirtualBoxのゲストOSを電源オフ状態にする

$ vagrant halt

2. 最新のVirtualBoxOracle VM VirtualBox Extension Packをインストールする

以下のサイトからダウンロードして、インストールする。
http://www.oracle.com/technetwork/server-storage/virtualbox/downloads/index.html?ssSourceSiteId=otnjp#extpack

3. VirtualBoxの設定でUSBコントーラを2.0にする

  1. VirtualBox > 設定 > ポート > USB
  2. USB 2.0 (EHCI)コントローラーにチェック

スクリーンショット 2017-04-02 0.34.27.png

4. Vagrantを起動する

$ vagrant up
3
3
0

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
3
3