# Using a serial console



## balanga (Apr 17, 2021)

People have mentioned using a serial console to find out what is going on if the screen goes blank. Has anyone used one?

From what I've read you need a comms port and a serial cable, but when did you last see a computer with a comms port?

Will a USB-RS232 adapter suffice? And if so, how should it be configured?


----------



## tingo (Apr 18, 2021)

with a usb-to-serial adapter, you might lose some of the messages at start, because the usb serial ports needs to be configured, and that can't happen until the kernel is loaded (and a while later). They might be buffered, but you won't know until you try.

Using a usb serial port on a FreeBSD machine (say amd64) to access the built in serial port on another FreeBSD machine (example: Raspberry Pi) works great.

Note: usb serial adapters (and usb serial ports on single board computers like the Raspberry Pi, BeagleBone, etc) comes in various models: 5V, 3.3V. Make sure you don't accidentally connect a 5V device to a device which only can handle 3.3V.

You might need to configure the serial console on the FreeBSD machine, the handbook has an example: https://docs.freebsd.org/en/books/handbook/serialcomms/#serialconsole-setup


----------



## balanga (Apr 18, 2021)

Can I use a usb-to-serial adapter on a laptop if I want to see the system  bootup on another system? I guess I would need another usb-to-serial adapter on the other system... unless I can find something with a RS232 port...


----------



## kpedersen (Apr 18, 2021)

You will need something like 2 of these:
https://thepihut.com/products/usb-to-ttl-serial-cable

Then make sure to switch the RX (receive) and TX (transmit).

I am not sure if this will help debug i.e a kernel panic. Generally the USB subsystem is the first to go in this kind of environment.

Perhaps a PCI rs-232 card will allow you to read debug output a little earlier on in the boot.


----------



## Phishfry (Apr 18, 2021)

balanga said:


> but when did you last see a computer with a comms port?


Umm every Supermicro motherboard I have ever owned. Also PC Engines APU1/2/3.


----------



## hruodr (Apr 18, 2021)

Or the port may be internal in the motherboard, then you need something like this:






						Delock Products 89268 Delock Slot Bracket > 2 x Serial Pin layout: 1:1
					






					www.delock.com


----------



## zirias@ (Apr 18, 2021)

Adding to that: an on-board "COM" port was a key requirement when I was looking for a board for building my server a few years ago  IMHO, a server shouldn't have any gfx chip, and serial console is the "natural" thing to do. A decent server board should also have a BIOS that works with a serial console.

Of course, this doesn't help when trying to get last messages from a crashing kernel… struggling with a similar issue right now, trying to debug why radeonkms.ko only loads fine every ~5th attempt on my "evergreen" hardware (PALM chip)…


----------



## VladiBG (Apr 18, 2021)

On Intel platform that support AMT you can use Intel® AMT serial-over-LAN using Intel Manageability Commander to access the console.


----------



## balanga (Apr 18, 2021)

VladiBG said:


> On Intel platform that support AMT you can use Intel® AMT serial-over-LAN using Intel Manageability Commander to access the console.


Don't know anything about AMT... Is this supported on FreeBSD and how do I tell if a ThinkPad X220 supports it?


----------



## VladiBG (Apr 18, 2021)

balanga said:


> Is this supported on FreeBSD



Intel ME is out of band management, it's allow you to manage the computer remotely even if it's turned off or without installed OS.


Depend of the model of the CPU but according the spec it support  AMT. You can check your Bios and enable it, after that you need to boot into intel ME set up the strong password.





						Detailed specifications - ThinkPad X220 - Lenovo Support US
					






					support.lenovo.com
				






> Ethernet
> Non-vPro model: Intel 82579LF Gigabit Network Connection (Lewisville), PHY, PCIe x1
> *vPro model: Intel 82579LM* Gigabit Network Connection (Lewisville), PHY, PCIe x1
> 
> Intel Active Management Technology (iAMT)


----------



## balanga (Apr 18, 2021)

VladiBG said:


> Detailed specifications - ThinkPad X220 - Lenovo Support US
> 
> 
> 
> ...



There it is:-



Communications


Network

Intel Active Management Technology (iAMT)





Never heard of it before but my interest has been peaked, and will investigate further. Thanks for bringing it to my attention.


----------



## VladiBG (Apr 18, 2021)

Only if you have *vPro model: Intel 82579LM*


----------



## balanga (Apr 18, 2021)

Where do I find this? Is it in the BIOS?

I notice that   Config -> Intel (R) AMT -> Console Type  -> [ PC ANSI, VT100, VT100+, VT-UTF8]

Machine Type Model is 4290NP3


----------



## balanga (Apr 19, 2021)

VladiBG said:


> Only if you have *vPro model: Intel 82579LM*


I guess you meant the NIC....

Is this one OK?


```
em0@pci0:0:25:0:<------>class=0x020000 card=0x21ce17aa chip=0x15028086 rev=0x04 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '82579LM Gigabit Network Connection (Lewisville)'
    class      = network
    subclass   = ethernet
```


----------



## VladiBG (Apr 19, 2021)

Yes it's ok. You can enable Intel ME enter in the configuration usually with ctrl+P and set up the initial password and IP address then you can try to connect from another machine using intel manageability commander or mesh commander.

Note that the Intel ME password must be 8-32 symbols long with strong complexity ( at least one digit, one symbol except ":" "," ‘”’ , one lower-case letter and one upper case later" otherwise it will not allow you to set the password. The Default password is "admin"  when you first initialize it from the bios.


----------

