How to change console to ttyUSB0?

dealy663

Dabbler
Joined
Dec 4, 2021
Messages
32
Hi, I'm on TN Scale TrueNAS-SCALE-22.02.4 and am trying to get a serial console connection working. The hangup seems to be that TrueNas is trying to use ttyS0 for the console, and there is no option to change it to ttyUSB0 (which is where my USB to serial cable is assigned). I see that when I make other changes to the serial console in the GUI that the changes show up in /etc/default/grub.d/truenas.cfg. Editing this file by hand isn't enough, the changes don't survive a restart.

I am thinking that I need to change:

GRUB_CMDLINE_LINUX="console=ttyS0,115200 console=tty1"
to
GRUB_CMDLINE_LINUX="console=ttyUSB0,115200 console=tty1"

How can I make this change to enable my USB to Serial cable? I've seen a few references here and in other places suggesting using the midclt command can change kernel extra options. But I can't find any documentation on that command anywhere so far, and am not sure if it can update the GRUB_CMDLINE_LINUX option in that file.

Thanks in advance, Derek
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
TrueNAS does not generally support odd or unusual configurations. Their may be a way to make this USB to serial adapter work for serial console access. But, it is outside of most SOHO servers. Plus, most if not all Enterprise servers would use IPMI for console.

As I have said before, TrueNAS & ZFS are not the end all to NAS software. The both have limitations and quirks that can make them less suitable, or not suitable, for some people.


But, if you want to see if it might work, first verify that the OS drivers are installed. Meaning if you plug the USB to serial adapter in, does it work as a simple serial port.

If not, then you likely have to jump through some hoops and navigate mazes to get it work. (Like enable SCALE Developer mode and rebuild the kernel...)
 

vlhjkasnkl31

Cadet
Joined
Jan 7, 2024
Messages
7
TrueNAS does not generally support odd or unusual configurations. Their may be a way to make this USB to serial adapter work for serial console access. But, it is outside of most SOHO servers. Plus, most if not all Enterprise servers would use IPMI for console.



But, if you want to see if it might work, first verify that the OS drivers are installed. Meaning if you plug the USB to serial adapter in, does it work as a simple serial port.

If not, then you likely have to jump through some hoops and navigate mazes to get it work. (Like enable SCALE Developer mode and rebuild the kernel...)
Lot to unpack here.

I'd phrase this as a default configuration variance, not "odd or unusual", one that TrueNAS has effectively accounted for:

Screenshot 2024-03-15 at 3.07.53 PM.png


The problem here is, while ttyusb0 exists after plugging an adapter in, it's not enumerated in the list. ttyS0, or the default first UART serial, is.

There's nothing special about attaching a usb serial adapter, and having it work within grub, getty, etc.
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
The pull down list you have shown above, is to support different, builtin serial ports. For example, some server system boards have more than 1 builtin serial port.

You can put in a feature request to add "ttyusbX" devices to that list. Simply use "Report a Bug" at the top of any forum page. Then, publish the bug number here and request people vote for it. (Upper right blue thumbs up if I remember correctly.)

Next, beyond any doubt, USB to serial devices ARE ODD OR UNUSUAL for TrueNAS SCALE console. You can disagree but it won't change SCALE's lack of support for such. Can you get a generic Linux to support your USB to serial for console? If not, then SCALE won't be any easier.

Their are 4 things related to serial console for Unix / Linux. Not all have to be implemented.
  1. BIOS
  2. Grub
  3. Linux kernel
  4. Linux distro / OS
In most cases 3 & 4 are related, BUT are done by different files. Not configuring both can lead to partial support.

For item 1, their are BIOSes that support serial consoles. I've configured and used them. Just requires setting the terminal type so that ANSI color text & cursor positioning works. But, it is vendor & BIOS specific.

Item 2 requires changing Grub configuration. AND in your case would require Grub to have the USB to serial driver builtin. Or having the BIOS support the USB to serial device as console. I don't know how that would work.

Now of course, you may know all that. I've clearly shown this for others reading this is in the future. Or the original poster.


My miniature media server has a builtin serial port, with BIOS support for serial console, (if I remember correctly). However, for me, just items 2, 3 & 4 were suitable for remote management of that computer. (It's in a different room than my desktop, or where I would use my laptop.) To be clear, that media server runs more generic Linux, not TrueNAS SCALE.

if you, or someone else needs the details for 2, 3 or 4, let me know and I can give examples. (Those work for me, on my miniature media server.)
 
Top