0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

VirtualBox7+Ubntu24で「USBデバイスをアタッチできません」

Posted at

投稿の背景

VirtualBox上の仮想マシンに外付けHDDを接続しようしたら、タイトルの通りエラーがでました。エラー名で検索すると「VirtualBox Extension Pack」をインストールする必要がある、と多くの記事がでてきますが、調べたところVirtualBox7からは拡張不要でUSBデバイスを接続できる、ということでしたので、試してみました。

前提条件

  • VirtualBox 7.1.10
  • Ubuntu 24.04.1 LTS
  • 「VirtualBox Extension Pack」は使わないで外付けHDDを接続したい

エラー時の手順

仮想マシンを起動した状態で、仮想マシンの画面上から「デバイス」→「USB」→接続したいUSB機器名を選択。
すると次のエラーが画面右側に表示されました。

エラー

USBデバイスをアタッチできません

USB デバイス"BUFFALO HD-xxxxxxx"の仮想マシン"xxxxxxxx"への割り当てに失敗しました。
Failed to create a proxy device for the USB device. (Error: VERR_PDM_NO_USB_PORTS).
終了コード :
E_FAIL (0x80004005)
Result Detail:
-2861 (0xfffff4d3)
コンポーネント:
ConsoleWrap
インターフェース:
IConsole {xxxxxxxxxxxxxxxxxxxxxxx}

念のためfdiskで確認してみます。
(fdiskコマンドはパーティションを解放したり確保したりする機能があるので、使い方に注意してください。)

$ sudo fdisk -l
Disk /dev/sda: 50 GiB, 53687091200 bytes, 104857600 sectors
Disk model: VBOX HARDDISK
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: E3D7D1B1-1BAD-43EE-B745-B8F8ABE7F994

Device       Start       End   Sectors Size Type
/dev/sda1     2048      4095      2048   1M BIOS boot
/dev/sda2     4096   4198399   4194304   2G Linux filesystem
/dev/sda3  4198400 104855551 100657152  48G Linux filesystem


Disk /dev/mapper/ubuntu--vg-ubuntu--lv: 24 GiB, 25765609472 bytes, 50323456 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

/dev/sdaは内蔵のHDDで、それ以外認識していない。

接続できた手順

仮想マシンをオフしてマシンの設定を開きます。設定から上のタブをBasicからExpertにします。

設定

サイドメニューよりUSBを選択します。

Expertを選択

USB3.0を選択、USBデバイスフィルターのプラスボタンから接続HDDを選択します。

USBメニュー

最後にOKを押します。
この設定後に仮想マシンを起動して、下記コマンドでデバイスが認識されていればOK!

$ sudo fdisk -l
Disk /dev/sda: 50 GiB, 53687091200 bytes, 104857600 sectors
Disk model: VBOX HARDDISK
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: E3D7D1B1-1BAD-43EE-B745-B8F8ABE7F994

Device       Start       End   Sectors Size Type
/dev/sda1     2048      4095      2048   1M BIOS boot
/dev/sda2     4096   4198399   4194304   2G Linux filesystem
/dev/sda3  4198400 104855551 100657152  48G Linux filesystem


Disk /dev/mapper/ubuntu--vg-ubuntu--lv: 24 GiB, 25765609472 bytes, 50323456 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sdb: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: Portable HDD
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xdc187417

Device     Boot Start        End    Sectors  Size Id Type
/dev/sdb1          64 3907029119 3907029056  1.8T  7 HPFS/NTFS/exFAT

外付けHDDが/dev/sdbとして認識されました!

おわりに

VirtualBox7の仮想マシンに外付けHDDを接続する場合、「VirtualBox Extension Pack」が無くても接続することができました。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?