[TrueNAS SCALE 24.04.x] Adding a USB Serial Port and Assignign a TTY for Login over Serial? How?

Hello,

I’ve attached a USB serial port to my TrueNAS Scale server.

[Mon Sep 23 14:52:19 2024] ch341-uart ttyUSB0: break control not supported, using simulated break
[Mon Sep 23 14:52:19 2024] usb 1-4: ch341-uart converter now attached to ttyUSB0

The docs don’t cover how to configure SCALE to use a USB serial device for the Serial Console under Advanced → Console.

The GUI for setting up the serial console doesn’t actually see the ttyUSB0 device as an option, and I’ve also noticed that there’s no serial-getty service running for it.

On any other linux system, I’d systemctl enable serial-getty@ttyUSB0.service to get the system to activate the serial port, and then add console=ttyUSB0,115200n8 to grub’s kernel command line with an update grub to activate everything.

Even if that worked, I’m pretty sure that wouldn’t magically sync up the GUI. I’m also aware that extra kernel parameters are supposed to be set with a … middleware control tool? I feel really in the weeds with this, but something tells me that the most stable way to get this to work is to be able to set up the serial connection via the GUI … which I can’t do if it doesn’t show me the USB serial port.

I just looked at what I thought was the full grub config, and I don’t even see my full kernel commandline.

vectorsigma /etc/default/grub.d% cat truenas.cfg 
GRUB_DISTRIBUTOR="TrueNAS Scale"
GRUB_TIMEOUT=10
GRUB_DISABLE_RECOVERY="true"
GRUB_CMDLINE_LINUX_DEFAULT="libata.allow_tpm=1 amd_iommu=on iommu=pt kvm_amd.npt=1 kvm_amd.avic=1 intel_iommu=on zfsforce=1 nvme_core.multipath=N"
GRUB_TERMINAL_INPUT="console"
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX=""

EDIT: I found a similar, unanswered question here: TrueNAS Scale 24.04.02 Serial over Lan (SOL)

Note: Added reply to describe where I ended up with this. tl;dr TrueNAS SCALE does not appear to support serial USB adapters at all right now.

I found this on the archived old forums.

Reproducing @Arwen 's post there, in case the old forum vanishes.

TrueNAS does not generally support odd or unusual configurations. There 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…)

I’ll admit, this is disappointing. I get that iX likely doesn’t want to allow USB devices (or anything more than the first on-motherboard serial port that might exist (ttyS0), as getting proper serial access to a Linux system so it acts like a terminal when the system boots requires (1) editing the boot command line (e.g., via GRUB) and enabling a special serial-getty service.

That said, I’m using an otherwise powerful, modern, perfectly capable system to run TrueNAS in production, and would feel a lot better if I could access it via serial if it ever fell off the network for any reason. I can’t keep a KVM setup plugged into it, and I’m not always going to be right next to it when it breaks so I can find a monitor and keyboard to hook up to it and try to fix it.

I have a serial console server that I can SSH into or get physical access to, for exactly this sort of maintenance. I was able to set up OPNSense, Proxmox, my switches, and my UPS/PDU to all be accessible via serial. The Proxmox box is too new to have a real serial port on board, so it uses a USB-to-serial adapter just like I wanted to use with TrueNAS. Getting the Proxmox box to work required editing the kernel boot command and adding a serial-getty SystemD service, but that only took 5 minutes or so. The FTDI serial chipset is well supported by modern Linux kernels.

My TrueNAS box is the only thing I can’t make work, since the GUI doesn’t enumerate USB serial adapters (and presumably, the middleware can’t update the boot command and SystemD services as necessary to enable the USB serial console).

So, that’s unfortunate and disappointing, but at least now I know why it doesn’t work.

You might check your system board’s manual. Some include a header for serial ports and just need a cable and back panel connector. That on-board serial port might be supported, (not saying it will be…).

Now on the topic of unfortunate and disappointing, TrueNAS was not written for us, the SOHO free users. We are in essence testers for the Enterprise data center crowd.

To be clear for future readers, TrueNAS is appliance software. Not a Linux distro with wide capabilities. Ever since iX started the Linux based SCALE fork, we have gotten lots of people, (not just hundreds, but thousands), who expect SCALE to do more that it’s stated purpose. And I mean even beyond VMs or Apps. That would be fair for a normal Linux distro, but certainly did not exist for the FreeBSD based TrueNAS Core.

In any case, good luck.