4 ms·
is there a way to forward usb/serial ports from my local machine to the dev container? maintaining consistent firmware development environments using container
by jareklupinski 2y ago
is there a way to forward usb/serial ports from my local machine to the dev container?
maintaining consistent firmware development environments using containers is a great idea, and current solutions involving proxying the compiled binary work well for flashing quickly, but switching back and forth between UART and Serial Debug is always more convenient when the IDE can handle it all
- nottorp 2y agoI've done linux/arm yocto development from VMs. The best solution to pass usb/serial was still VMWare the last time I had to.
- deivid 2y agoNot sure what your host OS is, if Linux, QEMU can pass usb devices to the guest. Otherwise you could pipe serial over TCP
- jareklupinski 2y agointeresting, specifically I'm on a host Mac and trying to use the ESP IDF dev containers in VSCode (https://docs.espressif.com/projects/vscode-esp-idf-extension/en/latest/additionalfeatures/qemu.html https://docs.espressif.com/projects/vscode-esp-idf-extension...) will try again with sockets/TCP, thought i hit a roadblock after reading https://github.com/docker/for-mac/issues/5263#issuecomment-762955441 https://github.com/docker/for-mac/issues/5263#issuecomment-7...
- nneonneo 2y agoVMWare has an excellent implementation of this which can selectively connect devices to the guest, and it properly remembers the action for each device you connect to your computer.
- watermelon0 2y agoYou mean forwarding to VSCode dev container? If you are using Docker Engine directly on Linux, you can forward a device to a container via docker-compose `devices` setting. If you are using Docker Desktop (or similar), there is no native way. However, there are ways to share USB devices via network (USB/IP is an open source implementation of this), in which case you setup server on host device (can be macOS/Windows/Linux), and then run a client software inside a container.