Giter Site home page Giter Site logo

Comments (2)

sickcodes avatar sickcodes commented on July 19, 2024

https://github.com/sickcodes/Docker-OSX#mount-usb-drive-hotplughot-plug-usb

  • Mount USB Drive (Hotplug/Hot Plug USB)

Start your container.

Pick a port, for example,7700.

lsusb to get vid:pid

On Linux: sudo usbredirserver -p 7700 1e3d:2096

Now, in the Docker window hit Enter to see the (qemu) console.

You can add/remove the disk using commands like this, even once the machine is started:

chardev-add socket,id=usbredirchardev1,port=7700,host=172.17.0.1

device_add usb-redir,chardev=usbredirchardev1,id=usbredirdev1,debug=4

from kvm-opencore.

blarrow avatar blarrow commented on July 19, 2024

https://github.com/sickcodes/Docker-OSX#mount-usb-drive-hotplughot-plug-usb

  • Mount USB Drive (Hotplug/Hot Plug USB)

Start your container.

Pick a port, for example,7700.

lsusb to get vid:pid

On Linux: sudo usbredirserver -p 7700 1e3d:2096

Now, in the Docker window hit Enter to see the (qemu) console.

You can add/remove the disk using commands like this, even once the machine is started:

chardev-add socket,id=usbredirchardev1,port=7700,host=172.17.0.1

device_add usb-redir,chardev=usbredirchardev1,id=usbredirdev1,debug=4

Thanks!

Finally, I use usb-storage as the target device instead of virtio-blk/nvme.

  1. add a qemu-xhci controller:
    -device qemu-xhci,id=xhci,bus=pci.1,addr=0x1e

  2. hot plug/unplug a usb-storage device
    drive_add 0 file=vm-102-disk-hot.qcow2,if=none,id=drive-hotplug,cache=writeback,aio=io_uring,format=qcow2 device_add usb-storage,drive=drive-hotplug,id=usb1,bus=xhci.0

from kvm-opencore.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.