No serial port - Console Access using USB?

Started by Lantern5, August 06, 2024, 03:39:42 AM

Previous topic - Next topic
Hi all,
Just started using Opnsense, bare metal install on a Lenovo M900 tiny PC. The unit I bought does not have a serial port, and the slot is taken up by the second NIC anyways. The system is in a tight spot and I want some kind of out of band access.

Is it possible to get console access using a USB - Serial convertor? I was thinking of getting two of these with a female-female adaptor in between. Both ends of the cable will be USB, one on the opnsense host and the other on my laptop. Will this work? Or do I need to look at other options?

https://www.amazon.com/gp/product/B0759HSLP1/ref=ox_sc_act_title_1?smid=A1IR1GJH6XB88L&th=1

I had problems with FTDI-Adapters, Adapters with PL2303-Chip (RS232) worked directly without problems...
https://www.prolific.com.tw/US/ShowProduct.aspx?pcid=41&showlevel=0017-0037-0041

Otherwise try an adapter for RS232. (I mostly needed to install a driver, which doesnt exist for Freebsd)
https://ftdichip.com/product-category/products/cables/

But i dont know if they are supported now with Freebsd 13/14.

ok I found another one with a PL2303 chip, but will it work off a USB port on the opnsense box?

This is what I have in mind, will it work?

Opnsense box --> USB  -->DB9Serial<-->DB9Serial-->USB -->Laptop

PL2303 works just fine when you enable the USB serial console setting.

Quote from: doktornotor on August 06, 2024, 09:13:13 AM
PL2303 works just fine when you enable the USB serial console setting.

As in USB on the Opnsense box? And do I need a serial convertor or can it be straight USB to USB?

You will probably need a null-modem coupler between the two serial connections, especially since they will likely both have the same connector on the end.

Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)


Quote from: doktornotor on August 06, 2024, 07:43:17 PM
Quote from: Patrick M. Hausen on August 06, 2024, 03:18:25 PM
Apparently USB-Nullmodems exist:

https://hackaday.com/2020/08/25/the-usb-null-modem-cable-is-now-a-thing/
https://ftdichip.com/products/usb-nmc-2-5m/
https://de.aliexpress.com/item/1005001407066778.html

Well, this has worked for me a couple of times:

https://a.co/d/6rdWQW9

That's what I was thinking of, but I normally build my own (having parts on hand).

I like that first link that Patrick gave us, that's pretty cool and might be useful down the road for those odd times when needed. I'll have to look into it a bit more.

Thanks everyone, I bought the USB to serial cable and am able to get console access to the Opnsense box. However, there's no console output until the OS fully boots up.

The link below seems to indicate that serial can be active during boot. I'm using a VGA image, will switching to the serial image help to get console access during boot?

https://serverfault.com/questions/918972/serial-over-usb-during-boot

System - Settings - Administration - Console: Primary console

Quote from: doktornotor on August 28, 2024, 12:59:00 PM
System - Settings - Administration - Console: Primary console

Already set to Serial Console and "Use USB-based serial ports" is ticked. Do I need to change any other settings?

Well, using a USB based serial console needs OS support, so no wonder you get output only once it is booted. Your system's BIOS as well as the boot loader do not support USB serial devices as console, so there is no way to access these phases of the boot process.

You would need a builtin serial port and BIOS support to see anything before the OS is up and running.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

Quote from: Patrick M. Hausen on August 28, 2024, 09:29:50 PM
Well, using a USB based serial console needs OS support, so no wonder you get output only once it is booted. Your system's BIOS as well as the boot loader do not support USB serial devices as console, so there is no way to access these phases of the boot process.

You would need a builtin serial port and BIOS support to see anything before the OS is up and running.

Pardon my ignorance, but USB boot and install from USB storage is possible; and I guess that means USB is enabled at power up? And I believe Serial being bi-directional it doesnt matter which end (USB or RS-232) is plugged into the opnsense box?

Console is different. Seriously. I know of no BIOS that would support a USB serial console.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)