Skip to content

Instantly share code, notes, and snippets.

@hagevvashi
Last active March 7, 2021 13:31
Show Gist options
  • Save hagevvashi/2dbe0388164c8837a69e881397f9f685 to your computer and use it in GitHub Desktop.
Save hagevvashi/2dbe0388164c8837a69e881397f9f685 to your computer and use it in GitHub Desktop.
Virtualbox 上の ubuntu server に USB デバイスを認識させる

やったこと

Extension Pack を導入

https://www.virtualbox.org/wiki/Downloads

VirtualBox 6.1.18 Oracle VM VirtualBox Extension Pack
 All supported platforms
Support for USB 2.0 and USB 3.0 devices, VirtualBox RDP, disk encryption, NVMe and PXE boot for Intel cards. See this chapter from the User Manual for an introduction to this Extension Pack. The Extension Pack binaries are released under the VirtualBox Personal Use and Evaluation License (PUEL). Please install the same version extension pack as your installed version of VirtualBox.

USB デバイスフィルタの設定

ゲストOSをシャットダウンしておく

ホストOS側でUSB機器をさした状態でVirtualBoxコンソール上のVNMの設定を開く

Port タブを開く

USB タブを開く

USB3.0をチェックしておく

右側上から二番目のプラスマークのアイコンをクリックしてUSBデバイスを選択する

デバイスが追加されるのでデバイスを右クリックしてフィルターを編集する

  • [名前]
  • [メーカー]
  • [製品名]
  • [シリアルNo]

以外空欄にする

リモートは任意に変更した

その後ホストOSから対象デバイスを外し再度接続する

聞かれる問い合わせに「取り出す」を選択しておく

ゲストOSを起動すると勝手に認識してくれると思うけどしてくれなかったらウィンドウ右下のUSBマークから対象のデバイスをクリックしておく

sudo lsusb

sudo fdisk -l /dev/sdb

で確認できる

マウントする方法

mkdir -vp /media/usb
sudo mount /dev/sdb /media/usb

マウントを解除する方法

sudo umount /dev/sdb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment