WSL2からホストマシンのWebカメラにアクセスできなかったメモ
wslにホストマシンにつないでるusbのdeviceにアクセスできるように、下記手順を試す
PowerShellを一応管理者で起動して、
$ winget install --interactive --exact dorssel.usbipd-win
インストールが完了しました
$ usbipd list
Connected:
BUSID VID:PID DEVICE STATE
1-12 1462:7d36 USB 入力デバイス Not shared
1-19 1bcf:2c99 USB video Capture Not shared
4-3 1bcf:2285 papalook FHD Camera, papalook Microphone Not shared
5-1 0499:1756 Yamaha AG03MK2, Line (Yamaha AG03MK2), Yamaha AG03MK2-1 Not shared
7-3 8087:0029 インテル(R) ワイヤレス Bluetooth(R) Not shared
なるほど、こんな感じか
あとwsl内の状況も確認してみる
$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
$ usbipd bind --busid 1-19
$ usbipd list
Connected:
BUSID VID:PID DEVICE STATE
1-12 1462:7d36 USB 入力デバイス Not shared
1-19 1bcf:2c99 USB video Capture Shared
4-3 1bcf:2285 papalook FHD Camera, papalook Microphone Not shared
5-1 0499:1756 Yamaha AG03MK2, Line (Yamaha AG03MK2), Yamaha AG03MK2-1 Not shared
7-3 8087:0029 インテル(R) ワイヤレス Bluetooth(R) Not shared
指定したデバイスがSharedになった
次にwslに割当
$ usbipd attach --wsl --busid 1-19
usbipd: info: Using WSL distribution 'Ubuntu' to attach; the device will be available in all WSL 2 distributions.
usbipd: info: Using IP address 172.27.208.1 to reach the host.
usbipd: warning: A firewall appears to be blocking the connection; ensure TCP port 3240 is allowed.
ここまでやって、改めてwslで確認
$ lsusb
Bus 002 Device 002: ID 1bcf:2c99 Sunplus Innovation Technology Inc. USB video Capture
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
増えてる!
が、/devには出ない
他にも色々調べながら、コマンド打って行ってみるかー
$ usbipd wsl list
wslの引数は消されちゃったみたい
でもこれはwslが不要になっているって感じ
ん-、WSLを通すのはややこしいのでいったんやめる!
更新履歴
2025/01/27 備忘残し