LoginSignup
3

More than 5 years have passed since last update.

systemd-nspawnのコンテナからホストのUSBデバイスさわる

Last updated at Posted at 2014-12-02

systemd-nspawnコンテナ内からホストのUSBデバイスに触る方法を調べたので残しておく。

dockerの例を参考に、以下のようにbindしたらできた。

systemd-nspawn --boot --bind=/dev/bus/usb --directory=/var/lib/container/sample

lsusb などを叩いて、ホスト側と同じ結果が返ってくればOK。

場合によっては --boot ではなく、chroot相当の --share-system を使わなければならないこともあるかもしれないが、ひとまずこれだけで問題なかった。

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