Emulate serial port via USB #383

Open
opened 2026-02-20 08:22:21 -05:00 by deekerman · 5 comments
Owner

Originally created by @splack on GitHub (Aug 8, 2025).

A note for the community

Is it possible with the existing hardware to use the USB connection to add a serial port emulation (similar to kb/mouse) so the additional serial hardware is not required?

I wanted to get a quick idea if it's at all possible.

Disclaimer

  • I have read and understood the disclaimer.
  • I plan to implement the feature myself.

Subsystem

None

Feature description

Plug in the JetKVM and it appears to the host as a USB serial port at the same time as the KB/mouse emulation.

Originally created by @splack on GitHub (Aug 8, 2025). ### A note for the community Is it possible with the existing hardware to use the USB connection to add a serial port emulation (similar to kb/mouse) so the additional serial hardware is not required? I wanted to get a quick idea if it's at all possible. ### Disclaimer - [x] I have read and understood the disclaimer. - [ ] I plan to implement the feature myself. ### Subsystem None ### Feature description Plug in the JetKVM and it appears to the host as a USB serial port at the same time as the KB/mouse emulation.
Author
Owner

@DatDucati commented on GitHub (Sep 4, 2025):

Okay, so I fiddled around a bit with the code, and I managed to configure the serial gadget. I am able to send messages back and forth between the JetKVM and the host, or with a screen binary get a shell over the serial port. I can open a pull request for those (very few!) lines of code, but I've got no idea how to proceed from here.
Things that would have to be done:

  • get the information from the serial port into the backend (and thus into the frontend)
  • display the serial output in the web-UI and forward the keypresses to the backend
@DatDucati commented on GitHub (Sep 4, 2025): Okay, so I fiddled around a bit with the code, and I managed to configure the serial gadget. I am able to send messages back and forth between the JetKVM and the host, or with a screen binary get a shell over the serial port. I can open a pull request for those (very few!) lines of code, but I've got no idea how to proceed from here. Things that would have to be done: - get the information from the serial port into the backend (and thus into the frontend) - display the serial output in the web-UI and forward the keypresses to the backend
Author
Owner

@splack commented on GitHub (Sep 5, 2025):

@DatDucati That's great! I'd be happy to just ssh in and run picocom. That was the bit I was unsure of. Do you have a fork or branch I can grab the code from?

@splack commented on GitHub (Sep 5, 2025): @DatDucati That's great! I'd be happy to just ssh in and run picocom. That was the bit I was unsure of. Do you have a fork or branch I can grab the code from?
Author
Owner

@DatDucati commented on GitHub (Sep 5, 2025):

Then the shell solution might be a better fit for you (for now). I'd still like if the feature would be native to the webui, so one could just enable it.

#! /bin/ash
cd /sys/kernel/config/usb_gadget/jetkvm/
echo "" > UDC
mkdir functions/acm.usb0
ln -s functions/acm.usb0 configs/c.1/
echo $(ls /sys/class/udc/ | head -n 1) > UDC

If no output got produced, it will create /dev/ttyGS0. Now all that remains is to compile your favorite serial client for the jetkvm.

Please don't close this (partial solved) issue yet.

My changes are @ https://github.com/DatDucati/kvm/tree/add-serial-gadget-mode

@DatDucati commented on GitHub (Sep 5, 2025): Then the shell solution might be a better fit for you (for now). I'd still like if the feature would be native to the webui, so one could just enable it. ```sh #! /bin/ash cd /sys/kernel/config/usb_gadget/jetkvm/ echo "" > UDC mkdir functions/acm.usb0 ln -s functions/acm.usb0 configs/c.1/ echo $(ls /sys/class/udc/ | head -n 1) > UDC ``` If no output got produced, it will create /dev/ttyGS0. Now all that remains is to compile your favorite serial client for the jetkvm. Please don't close this (partial solved) issue yet. My changes are @ https://github.com/DatDucati/kvm/tree/add-serial-gadget-mode
Author
Owner

@splack commented on GitHub (Sep 6, 2025):

Thanks @DatDucati! I'd love to see this through.

The bigger use case for me is so I can have better automation of system activities like typing in BIOS passwords from scripts or unlocking LUKS devices or detecting why a boot fails without resorting to OCR. I've not tested this yet as I'm doing a migration this weekend but I'll get to it early next week and will keep this issue open for tracking progress.

I tried to get some kb automation going but the WebRTC was a real pain to automate without a full browser, which I didn't want in my environment as a browser is a very large dependency for system level things. I was able to take screen captures from the video cap device directly via root ssh and OCR, but I had to disconnect from the web ui first. It did make me think that a terminal server approach (like the old rs232 ones) might be a better interface for text as is should be much easier to drop in some existing OSS tool and integrate it into traditional management systems that talk to network kit etc.

@splack commented on GitHub (Sep 6, 2025): Thanks @DatDucati! I'd love to see this through. The bigger use case for me is so I can have better automation of system activities like typing in BIOS passwords from scripts or unlocking LUKS devices or detecting why a boot fails without resorting to OCR. I've not tested this yet as I'm doing a migration this weekend but I'll get to it early next week and will keep this issue open for tracking progress. I tried to get some kb automation going but the WebRTC was a real pain to automate without a full browser, which I didn't want in my environment as a browser is a very large dependency for system level things. I was able to take screen captures from the video cap device directly via root ssh and OCR, but I had to disconnect from the web ui first. It did make me think that a terminal server approach (like the old rs232 ones) might be a better interface for text as is should be much easier to drop in some existing OSS tool and integrate it into traditional management systems that talk to network kit etc.
Author
Owner

@rloomans commented on GitHub (Sep 15, 2025):

I'm using my JetKVM for a TrueNAS box, which natively has a text-based console once it's booted up, so if the JetKVM emulated a serial terminal over USB it would be much more convenient than the video, as I'd be able to cut and paste :)

@rloomans commented on GitHub (Sep 15, 2025): I'm using my JetKVM for a TrueNAS box, which natively has a text-based console once it's booted up, so if the JetKVM emulated a serial terminal over USB it would be much more convenient than the video, as I'd be able to cut and paste :)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/kvm#383
No description provided.