Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
0
votes
1
answers
1747
views
How to setup serial console on CentOS8/RedHat8?
I rely on serial console on CentOS 8 to debug. I ever set it up on CentOS 7 by editing file /etc/default/grub as below, ``` GRUB_CMDLINE_LINUX="crashkernel=auto console=tty0 console=ttyS0,115200n8 intel_iommu=on modprobe.blacklist=nouveau,amdgpu" GRUB_DISABLE_RECOVERY="true" GRUB_TERMINAL="console s...
I rely on serial console on CentOS 8 to debug.
I ever set it up on CentOS 7 by editing file /etc/default/grub as below,
GRUB_CMDLINE_LINUX="crashkernel=auto console=tty0 console=ttyS0,115200n8 intel_iommu=on modprobe.blacklist=nouveau,amdgpu"
GRUB_DISABLE_RECOVERY="true"
GRUB_TERMINAL="console serial"
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"
and execute "grub2-mkconfig -o /boot/grub2/grub.cfg" then reboot. It worked like a charm
But this time it doesn't work on CentOS 8.
Could anyone shed light on it?
codexplorer
(343 rep)
Sep 7, 2021, 07:57 AM
• Last activity: Jul 7, 2025, 04:09 AM
1
votes
0
answers
24
views
Linux Kernel: possible to enable hardware flow control for serial console?
How do you enable hardware flow control for the Linux serial console? Perhaps using GRUB arguments? [This post][1] asks about specifying arguments to QEMU and GRUB to use the serial console, but doesn't address hardware flow control. [1]: https://unix.stackexchange.com/questions/797516/qemu-starting...
How do you enable hardware flow control for the Linux serial console? Perhaps using GRUB arguments?
This post asks about specifying arguments to QEMU and GRUB to use the serial console, but doesn't address hardware flow control.
atod
(155 rep)
Jun 30, 2025, 01:31 PM
• Last activity: Jun 30, 2025, 01:38 PM
0
votes
1
answers
51
views
How do I adapt the /etc/issue file depending on how the terminal is attached: serial line vs. network?
I've got a machine running OpenSuSE Leap 15.5, which can be remote-controlled both by usign a local serial line (RS232), and via network (SSH). Now I've got an `/etc/issue` file auto-generated by `/usr/sbin/issue-generator` upon every system startup. Here is the content of `/etc/issue`: ``` Welcome...
I've got a machine running OpenSuSE Leap 15.5, which can be remote-controlled both by usign a local serial line (RS232), and via network (SSH). Now I've got an
/etc/issue
file auto-generated by /usr/sbin/issue-generator
upon every system startup. Here is the content of /etc/issue
:
Welcome to \S - Kernel \r (\l).
eth0: \4{eth0} \6{eth0}
It's obvious that the eth0
line doesn't make very much sense when accessing the machine via serial line. Here I would rather expect something like this: ttyS5 vt340 115200 8N1
And this is what /etc/sysconfig/issue-generator
looks like (comments omitted):
NETWORK_INTERFACE_REGEX="^[be]"
This makes it necessary for the getty
process in use (I'm using agetty
for the serial line) to find out which interface the terminal is attached to and to adapt the line stated above accordingly, but how? This is the serial getty service file (comments omitted):
[Unit]
Description=Serial Getty on %I
Documentation=man:agetty(8) man:systemd-getty-generator(8)
Documentation=http://0pointer.de/blog/projects/serial-console.html
BindsTo=dev-%i.device
After=dev-%i.device systemd-user-sessions.service plymouth-quit-wait.service getty-pre.target
After=rc-local.service
Before=getty.target
IgnoreOnIsolate=yes
Conflicts=rescue.service
Before=rescue.service
[Service]
ExecStart=-/sbin/agetty -L 115200 %I $TERM
Type=idle
Restart=always
UtmpIdentifier=%I
TTYPath=/dev/%I
TTYReset=yes
TTYVHangup=yes
IgnoreSIGPIPE=no
SendSIGHUP=yes
[Install]
WantedBy=getty.target
Neppomuk
(364 rep)
Jun 29, 2025, 01:47 PM
• Last activity: Jun 29, 2025, 03:40 PM
2
votes
2
answers
2480
views
Can't get kernel messages logged to the serial console of a systemd system
I would like to log the kernel messages of system to the serial console on ttyS0. A similar problem was addressed under [How to get kernel messages on serial console on a systemd system?][1] but I still don't get it to work. I've got `systemd.journald.max_level_console=debug` `console=ttyS0,115200`...
I would like to log the kernel messages of system to the serial console on ttyS0.
A similar problem was addressed under How to get kernel messages on serial console on a systemd system? but I still don't get it to work.
I've got
systemd.journald.max_level_console=debug
console=ttyS0,115200
loglevel=7
on my kernel command line and ShowStatus=no
set in */etc/systemd/system.conf*
Nevertheless, while I'll see kernel messages on the console at the beginning of the boot process, after the Journal Service is started I wont get any more kernel messages logged to the console.
If I, as an example, connect a USB mouse to the board, there is nothing logged to the console but journalctl -f shows:
Feb 11 10:09:45 a20 kernel: usb 3-1: new low-speed USB device number 4 using ohci-platform
Feb 11 10:09:45 a20 kernel: usb 3-1: New USB device found, idVendor=046d, idProduct=c069, bcdDevice=56.01
Feb 11 10:09:45 a20 kernel: usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Feb 11 10:09:45 a20 kernel: usb 3-1: Product: USB Laser Mouse
Feb 11 10:09:45 a20 kernel: usb 3-1: Manufacturer: Logitech
Feb 11 10:09:45 a20 kernel: input: Logitech USB Laser Mouse as /devices/platform/soc/1c14400.usb/usb3/3-1/3-1:1.0/0003:046D:C069.0005/input/input6
Feb 11 10:09:45 a20 kernel: hid-generic 0003:046D:C069.0005: input,hidraw2: USB HID v1.10 Mouse [Logitech USB Laser Mouse] on usb-1c14400.usb-1/input0
Any thoughts?
bey0nd
(977 rep)
Feb 11, 2020, 11:09 AM
• Last activity: Jun 17, 2025, 02:09 PM
1
votes
1
answers
815
views
Minicom - How do I store the newline delay setting?
In Minicom, I prefer to change my `Newline tx delay (ms)` setting via `CTRL-A T` to incorporate some delay between newlines, usually 100ms. That way there is a delay when I am pasting something into a serial console. How can I store this setting? Currently I need to set it every time I open a minico...
In Minicom, I prefer to change my
Newline tx delay (ms)
setting via CTRL-A T
to incorporate some delay between newlines, usually 100ms. That way there is a delay when I am pasting something into a serial console. How can I store this setting?
Currently I need to set it every time I open a minicom instance. I would have thought that this setting would be located inside the minicom configuration, but it seems to be more of a runtime setting.
joeshmo
(15 rep)
Feb 19, 2021, 07:38 PM
• Last activity: Jun 17, 2025, 07:58 AM
0
votes
1
answers
3563
views
Send binary file to ttyUSB0 serially in linux
I have a binary file(obtained from assembly code). I need to transfer this file to an fpga serially via ttyUSB0. I read in some posts that using cat and echo data can be transferred to ttyS0. ``` echo -ne '\033[2J' > /dev/ttyS1 cat < /dev/ttyS1 ``` Does this apply for ttyUSB0 as well? If not, please...
I have a binary file(obtained from assembly code). I need to transfer this file to an fpga serially via ttyUSB0.
I read in some posts that using cat and echo data can be transferred to ttyS0.
echo -ne '\033[2J' > /dev/ttyS1
cat < /dev/ttyS1
Does this apply for ttyUSB0 as well? If not, please suggest me other ways to transfer binary file via ttyUSB0.
karthik
(1 rep)
Jan 9, 2020, 10:59 AM
• Last activity: May 27, 2025, 02:04 AM
0
votes
1
answers
3781
views
Android Serial Port is being used for no permission to open
I have a Wandboard IMX 6 with Android OS. I can't read RS232 data. I was wrote an app for this on QtCreator with C++. I have an issue. When i pressed the connect button i take `serial port is being used for no permission to open` error. I listed my available serial ports a dropdown menu. I can see `...
I have a Wandboard IMX 6 with Android OS. I can't read RS232 data. I was wrote an app for this on QtCreator with C++.
I have an issue. When i pressed the connect button i take
serial port is being used for no permission to open
error.
I listed my available serial ports a dropdown menu. I can see ttymxc0
and ttymxc2
on dropdown but can't connect.
Takitaha
(9 rep)
Oct 22, 2018, 07:36 AM
• Last activity: Apr 8, 2025, 09:06 AM
51
votes
12
answers
38459
views
resizable serial console window?
When using the serial console of my system I always end up with `$COLUMNS=80` and `$LINES=24`. While I can change these variables manually it is somewhat annoying to do this any time when the client side terminal window has been resized. Usually I'm connecting to the console using `screen /dev/mytty...
When using the serial console of my system I always end up with
$COLUMNS=80
and $LINES=24
.
While I can change these variables manually it is somewhat annoying to do this any time when the client side terminal window has been resized.
Usually I'm connecting to the console using screen /dev/mytty baudrate
.
Changing the $TERM
environment variable to "screen" or "xterm" does not help.
Will I need to call getty
with some of those instead of vt100?
Needless to say that all of this works fine, when I connect to the same machine using ssh.
Sven Geggus
(861 rep)
Jul 13, 2011, 09:33 AM
• Last activity: Mar 26, 2025, 05:50 PM
4
votes
1
answers
2158
views
Serial device (/dev/serial/) not showing up on Android
Trying to connect a serial device (3d printer) through the USB port in order to communicate with it (klipper firmware) on an Android device (LOS 18.1/Android 11, 3.18 kernel). But I can't find it in /dev/serial/, it only shows up as /dev/ttyUSB0 and /dev/bus/usb/001/00[^1] and I can't communicate wi...
Trying to connect a serial device (3d printer) through the USB port in order to communicate with it (klipper firmware) on an Android device (LOS 18.1/Android 11, 3.18 kernel). But I can't find it in /dev/serial/, it only shows up as /dev/ttyUSB0 and /dev/bus/usb/001/00[^1] and I can't communicate with it through those. I've compiled the kernel with the ch341.c driver. 'lsusb -v' from a chrooted Debian through Linux deploy gives the following output, the device in question is called 'QinHeng Electronics CH340...':
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 3.00
bDeviceClass 9 Hub
bDeviceSubClass 0
bDeviceProtocol 3
bMaxPacketSize0 9
idVendor 0x1d6b Linux Foundation
idProduct 0x0003 3.0 root hub
bcdDevice 3.18
iManufacturer 3 Linux 3.18.140-Swan-gcb3e40e597b0-dirty xhci-hcd
iProduct 2 xHCI Host Controller
iSerial 1 xhci-hcd.0.auto
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 0x001f
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xe0
Self Powered
Remote Wakeup
MaxPower 0mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 9 Hub
bInterfaceSubClass 0
bInterfaceProtocol 0 Full speed (or root) hub
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0004 1x 4 bytes
bInterval 12
bMaxBurst 0
Hub Descriptor:
bLength 12
bDescriptorType 42
nNbrPorts 1
wHubCharacteristic 0x000a
No power switching (usb 1.0)
Per-port overcurrent protection
bPwrOn2PwrGood 10 * 2 milli seconds
bHubContrCurrent 0 milli Ampere
bHubDecLat 0.0 micro seconds
wHubDelay 0 nano seconds
DeviceRemovable 0x00
Hub Port Status:
Port 1: 0000.02a0 5Gbps power Rx.Detect
Binary Object Store Descriptor:
bLength 5
bDescriptorType 15
wTotalLength 0x000f
bNumDeviceCaps 1
SuperSpeed USB Device Capability:
bLength 10
bDescriptorType 16
bDevCapabilityType 3
bmAttributes 0x02
Latency Tolerance Messages (LTM) Supported
wSpeedsSupported 0x0008
Device can operate at SuperSpeed (5Gbps)
bFunctionalitySupport 3
Lowest fully-functional device speed is SuperSpeed (5Gbps)
bU1DevExitLat 0 micro seconds
bU2DevExitLat 0 micro seconds
can't get debug descriptor: Resource temporarily unavailable
Device Status: 0x0001
Self Powered
Bus 001 Device 003: ID 1a86:7523 QinHeng Electronics CH340 serial converter
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 255 Vendor Specific Class
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0x1a86 QinHeng Electronics
idProduct 0x7523 CH340 serial converter
bcdDevice 2.64
iManufacturer 0
iProduct 2 USB Serial
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 0x0027
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 98mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 3
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 1
bInterfaceProtocol 2
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0020 1x 32 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0020 1x 32 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 1
can't get debug descriptor: Resource temporarily unavailable
Device Status: 0x0000
(Bus Powered)
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 9 Hub
bDeviceSubClass 0
bDeviceProtocol 1 Single TT
bMaxPacketSize0 64
idVendor 0x1d6b Linux Foundation
idProduct 0x0002 2.0 root hub
bcdDevice 3.18
iManufacturer 3 Linux 3.18.140-Swan-gcb3e40e597b0-dirty xhci-hcd
iProduct 2 xHCI Host Controller
iSerial 1 xhci-hcd.0.auto
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 0x0019
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xe0
Self Powered
Remote Wakeup
MaxPower 0mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 9 Hub
bInterfaceSubClass 0
bInterfaceProtocol 0 Full speed (or root) hub
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0004 1x 4 bytes
bInterval 12
Hub Descriptor:
bLength 9
bDescriptorType 41
nNbrPorts 1
wHubCharacteristic 0x000a
No power switching (usb 1.0)
Per-port overcurrent protection
TT think time 8 FS bits
bPwrOn2PwrGood 10 * 2 milli seconds
bHubContrCurrent 0 milli Ampere
DeviceRemovable 0x00
PortPwrCtrlMask 0xff
Hub Port Status:
Port 1: 0000.0103 power enable connect
can't get device qualifier: Resource temporarily unavailable
can't get debug descriptor: Resource temporarily unavailable
Device Status: 0x0001
Self Powered
How can I communicate with the serial device? Are there any other kernel modules I should compile? Does newer Android handle serial devices in a different way than Linux does? I've seen other people run this firmware on Android in chrooted Linux like here , here , here . So it is possible, I just must be missing something. I'm happy to post other debugging information/logs.
martinvince
(41 rep)
Feb 22, 2022, 11:47 AM
• Last activity: Mar 23, 2025, 10:02 AM
1
votes
1
answers
89
views
Grub2 serial terminal over USB ACM
I am trying to use a usb cable from a Raspberry (in peripheral mode, serial CDC ACM) to a PC to access GRUB2 serial console (on the PC). I succeeded with a pl2303 usb ttl adapter, the usbserial_pl2303 module in grub works ok. But what I want is instead to use directly a usb cable in what is called "...
I am trying to use a usb cable from a Raspberry (in peripheral mode, serial CDC ACM) to a PC to access GRUB2 serial console (on the PC).
I succeeded with a pl2303 usb ttl adapter, the usbserial_pl2303 module in grub works ok.
But what I want is instead to use directly a usb cable in what is called "usb gadget". I correctly configured the Raspberry to act like a peripheral, both with the g_serial module and the libcomposite module. After the PC starts it sees the Raspberry as a "CDC Abstract Control Model" and I can use the "serial" connection on /dev/ttyACM0. It works with both g_serial and libcomposite. But only AFTER the PC starts.
It does not work in GRUB.
I tried to enable all the 3 grub usbserial modules (usbserial_pl2303, usbserial_ftdi, usbserial_usbdebug) but terminfo and terminal_output do not show any new terminal. The grub command "usb" shows the connected usb "device" (i.e. the Raspberry) as a "CDC Abstract Control Model" but clearly it is not able to use it as a serial terminal.
Again, if I connect the usb pl2303 adapter to the PC, grub sees it and I can connect to grub serial console.
So my question is: how can I convince GRUB2 to see the CDC ACM "serial" port and use it as a terminal?
Kzar
(111 rep)
Mar 2, 2025, 08:47 PM
• Last activity: Mar 3, 2025, 06:19 AM
15
votes
2
answers
1388
views
VT320 over ttyUSB0 crashes when encountering emoji
For better or worse, I hooked up my VT320 to my Linux machine. I'm trying to run some software on, but the serial connection seems to end up in a crashed state whenever somes emojis are rendered. [![Picture of VT320 in crashed state][1]][1] Not sure if it's important, but in this case it was the ...
For better or worse, I hooked up my VT320 to my Linux machine. I'm trying to run some software on, but the serial connection seems to end up in a crashed state whenever somes emojis are rendered.
Not sure if it's important, but in this case it was the 🎲 (die) emoji. Instead, I get a mirrored question mark and the terminal doesn't render anything else.
I know emojis would never work. I'll settle for an incorrect character or none at all, but I would like to know if it's possible to avoid freezing the connection.
In case it's relevant, this is how agetty is configured in

/lib/systemd/system/serial-getty@.service
. I opted for the VT220, as it's the closest to what I have.
ExecStart=-/sbin/agetty -h -L 19200 %I vt220
Output of stty -a
:
speed 19200 baud; rows 24; columns 80; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = ;
eol2 = ; swtch = ; start = ^Q; stop = ^S; susp = ;
rprnt = ; werase = ; lnext = ; discard = ;
min = 1; time = 0;
-parenb -parodd -cmspar cs8 hupcl -cstopb cread clocal crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon ixoff
-iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon -iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
-echoctl echoke -flusho -extproc
Evert
(262 rep)
Feb 16, 2025, 02:17 AM
• Last activity: Feb 18, 2025, 02:27 PM
1
votes
1
answers
40
views
Connect Minitel1B to Ubuntu 20.04
I'm trying to use a Minitel as a console to connect to my Ubuntu. I've read a lot of information about this, but it seems to work with older versions of Ubuntu. These two files : - etc/inittab - etc/gettydefs ... don't do the job for me ! My inittab: 1:2345:respawn:/sbin/agetty ttyUSB0 4800v23 My ge...
I'm trying to use a Minitel as a console to connect to my Ubuntu. I've read a lot of information about this, but it seems to work with older versions of Ubuntu.
These two files :
- etc/inittab
- etc/gettydefs
... don't do the job for me !
My inittab:
1:2345:respawn:/sbin/agetty ttyUSB0 4800v23
My gettydefs :
4800v23# B4800 CS7 PARENB -PARODD GLOBAL # B4800 ISTRIP CS7 PARENB -PARODD GLOBAL BRKINT IGNPAR ICRNL IXON IXANY OPOST ONLCR CREAD HUPCLISIG ICANON ECHO ECHOE ECHOK #@S login: #4800v23
The result of "sudo lsusb -v" :
Bus 003 Device 002: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 255 Vendor Specific Class
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0x1a86 QinHeng Electronics
idProduct 0x7523 HL-340 USB-Serial adapter
bcdDevice 2.64
iManufacturer 0
iProduct 2 USB Serial
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 0x0027
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 98mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 3
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 1
bInterfaceProtocol 2
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0020 1x 32 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0020 1x 32 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 1
can't get debug descriptor: Resource temporarily unavailable
Device Status: 0x0000
(Bus Powered)
Today I can do this :
sudo stty -F /dev/ttyUSB0 4800 parenb cs7 hupcl cread ignpar clocal ixon ixoff opost onlcr isig echoe echok echoctl echoke
and this :
echo "Hello Minitel" > /dev/ttyUSB0
... prints
Hello Minitel
on my Minitel screen. But I'm not able to have a prompt on my minitel.
Thanks for your help, and sorry for my "poor english" (I'm an old french developer ;)
DroiTof
(11 rep)
Feb 13, 2025, 10:50 AM
• Last activity: Feb 13, 2025, 06:51 PM
8
votes
1
answers
1101
views
How to enable the second console to a FreeBSD guest running in bhyve?
# Background I'm running FreeBSD 12.1-RELEASE as a host for [bhyve](https://www.freebsd.org/cgi/man.cgi?bhyve) virtual machines. I have a FreeBSD 12.1-RELEASE guest running inside a VM. I would like to have two TTY-class devices configured for it. According to the manual page, in order to start the...
# Background
I'm running FreeBSD 12.1-RELEASE as a host for [bhyve](https://www.freebsd.org/cgi/man.cgi?bhyve) virtual machines.
I have a FreeBSD 12.1-RELEASE guest running inside a VM. I would like to have two TTY-class devices configured for it.
According to the manual page, in order to start the VM with two TTY-class devices I have to start bhyve with command-line options similar to those:
-l com1,/dev/nmdm0B -l com2,/dev/nmdm1B
. Then I should be able to connect to the guest via those two [nullmodem terminals](https://www.freebsd.org/cgi/man.cgi?nmdm) with cu -l /dev/nmdm0A
and cu -l /dev/nmdm1A
.
# Problem
The first command works as expected: cu -l /dev/nmdm0A
shows me the main console of the guest.
The second command, however, attaches to the guest, but shows nothing. I would expect to show me a login prompt as if switched to another TTY.
*What am I missing?*
---
## Additional details
- The guest is a fresh installation of FreeBSD.
- The output of dmesg | grep uart
on the guest is as follows:
uart0: port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
uart0: console (115200,n,8,1)
uart1: port 0x2f8-0x2ff irq 3 on acpi0
- I've tried setting hint.uart.1.flags
first to 0x10
and then to 0x80
(although this one is for kernel debuggers from what I understand from [uart(4)](https://www.freebsd.org/cgi/man.cgi?uart)) and rebooted after each change. It didn't work.
### References
- https://bsdjhb.blogspot.com/2018/10/using-bhyve-for-freebsd-development.html
- https://gist.github.com/landonf/d00a15ede7d5ccb0e371
Mateusz Piotrowski
(4983 rep)
Jun 26, 2020, 03:39 PM
• Last activity: Oct 1, 2024, 11:44 AM
1
votes
2
answers
3245
views
How can I install OpenBSD using the serial console, without external monitor? With a bootable USB stick?
How can I install OpenBSD on my HP Server using the serial console, without external monitor? I have no monitor in the Datacenter, but I have my Laptop with Debian/GNU/Linux. So far so good. How do you make under OpenBSD a bootable USB stick? To install OpenBSD over the serial console without the ne...
How can I install OpenBSD on my HP Server using the serial console,
without external monitor?
I have no monitor in the Datacenter, but
I have my Laptop with Debian/GNU/Linux. So far so good.
How do you make under OpenBSD a bootable USB stick?
To install OpenBSD
over the serial console without the need of an external monitor?
Vim
(229 rep)
Jun 29, 2016, 02:39 PM
• Last activity: Aug 17, 2024, 10:13 PM
0
votes
1
answers
571
views
Serial console: How can I switch off automatic login?
I've got a cluster of four nodes running Debian Bullseye. All of them are connected to a controller board via a UART for admin purposes. The control board uses `picocom` to access the serial console of the respective node. Now I've got an issue: When typing `exit`, the respective node logs me back i...
I've got a cluster of four nodes running Debian Bullseye. All of them are connected to a controller board via a UART for admin purposes. The control board uses
picocom
to access the serial console of the respective node.
Now I've got an issue: When typing exit
, the respective node logs me back in and starts a new shell immediately. I also get the root shell without having to type in username and password.
Apparently, an instance of agetty
is providing the shell:
root@blade3n2:~# ps -ef | grep getty
root 1127 1 0 18:27 tty1 00:00:00 /sbin/agetty -o -p -- \u --noclear tty1 linux
root 1836 1646 0 18:35 ttyFIQ0 00:00:00 grep getty
As this is a security flaw to me, I'd like to switch off this behavior, so that…
- …I'll have to log in with user name and password each time I connect to one of the nodes, and…
- …I'll get disconnected and picocom
closed when a session is closed (with an exit
or somehow else).
**UPDATE:** After receiving some advice, I did some diagnostics:
root@blade3n1:~# ps -fwwwC agetty
UID PID PPID C STIME TTY TIME CMD
root 1121 1 0 20:55 tty1 00:00:00 /sbin/agetty -o -p -- \u --noclear tty1 linux
root@blade3n1:~# pstree -ap 1121
agetty,1121 -o -p -- \\u --noclear tty1 linux
root@blade3n1:~# grep -r ttyFIQ0 /etc
root@blade3n1:~# systemctl cat serial-getty@ttyFIQ0.service
# /lib/systemd/system/serial-getty@.service
# SPDX-License-Identifier: LGPL-2.1+
#
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
[Unit]
Description=Serial Getty on %I
Documentation=man:agetty(8) man:systemd-getty-generator(8)
Documentation=http://0pointer.de/blog/projects/serial-console.html
BindsTo=dev-%i.device
After=dev-%i.device systemd-user-sessions.service plymouth-quit-wait.service ge>
After=rc-local.service
# If additional gettys are spawned during boot then we should make
# sure that this is synchronized before getty.target, even though
# getty.target didn't actually pull it in.
Before=getty.target
IgnoreOnIsolate=yes
# IgnoreOnIsolate causes issues with sulogin, if someone isolates
# rescue.target or starts rescue.service from multi-user.target or
# graphical.target.
Conflicts=rescue.service
Before=rescue.service
[Service]
# The '-o' option value tells agetty to replace 'login' arguments with an
# option to preserve environment (-p), followed by '--' for safety, and then
# the entered username.
ExecStart=-/sbin/agetty --autologin root --noclear %I $TER
#ExecStart=-/sbin/agetty -o '-p -- \\u' --keep-baud 115200,38400,9600 %I $TERM
Type=idle
Restart=always
UtmpIdentifier=%I
TTYPath=/dev/%I
TTYReset=yes
TTYVHangup=yes
KillMode=process
IgnoreSIGPIPE=no
SendSIGHUP=yes
[Install]
WantedBy=getty.target
Neppomuk
(364 rep)
Jul 7, 2024, 04:33 PM
• Last activity: Jul 10, 2024, 07:45 AM
1
votes
1
answers
143
views
How can I set the character to Latn-1 or MCS when using serial-getty?
I'd like to use my old VT420 terminal as system console. Adding RS232 ports and setting up `serial-getty` are not a problem, but: For years, almost all Linux distros have been using UTF-8 as the standard character set, whereas the VT only speaks Latin-1 (ISO 8859-1) and the old DEC multinational cha...
I'd like to use my old VT420 terminal as system console. Adding RS232 ports and setting up
serial-getty
are not a problem, but: For years, almost all Linux distros have been using UTF-8 as the standard character set, whereas the VT only speaks Latin-1 (ISO 8859-1) and the old DEC multinational character set.
So: What can I do to make serial-getty
use one of the character sets supported by the terminal? Is there an easy-to-implement solution for that? My current distros are:
- OpenSuSE Leap 15.6
- OpenWRT, current version
Please note that the VT420 does allow to define custom (bitmap) characters, but this is hard work.
Neppomuk
(364 rep)
Jun 20, 2024, 07:38 PM
• Last activity: Jun 21, 2024, 09:35 AM
2
votes
2
answers
1952
views
No login prompt from Getty over serial console
My Ubuntu 20.04 system has a serial port over which I would like to provide console access. I can confirm that I can communicate over the serial port with sudo picocom -b 115200 /dev/ttyS5 I start the Getty instance with sudo systemctl start serial-getty@ttyS5 which starts the command /sbin/agetty -...
My Ubuntu 20.04 system has a serial port over which I would like to provide console access.
I can confirm that I can communicate over the serial port with
sudo picocom -b 115200 /dev/ttyS5
I start the Getty instance with
sudo systemctl start serial-getty@ttyS5
which starts the command
/sbin/agetty -o '-p -- \u' --keep-baud 115200,38400,9600 ttyS5 vt220
However, no login prompt appears on the remote system.
rgov
(253 rep)
Mar 28, 2022, 05:07 PM
• Last activity: Jun 15, 2024, 04:00 AM
3
votes
3
answers
3524
views
how can I slow down pasting text into a serial terminal?
I'm working on a raspberry pi, and trying to paste some text files into a command-line text editor `nano`... but the text ends up corrupted on the remote end (partial/incomplete text). I can only guess the paste function of my PC (xubuntu 16.04) is pushing the data too fast (the serial baud is 11520...
I'm working on a raspberry pi, and trying to paste some text files into a command-line text editor
nano
... but the text ends up corrupted on the remote end (partial/incomplete text).
I can only guess the paste function of my PC (xubuntu 16.04) is pushing the data too fast (the serial baud is 115200).
Can I slow down the paste function somehow?
nmz787
(210 rep)
Feb 28, 2020, 11:28 AM
• Last activity: May 12, 2024, 08:34 AM
0
votes
1
answers
105
views
What is the equivalent of "clear line con 0"?
What is the equivalent of `clear line con 0` in Cisco IOS? I'm using `serial-getty@ttyS0`.
What is the equivalent of
clear line con 0
in Cisco IOS?
I'm using serial-getty@ttyS0
.
viator
(77 rep)
May 5, 2024, 08:36 AM
• Last activity: May 5, 2024, 03:16 PM
0
votes
1
answers
91
views
KVM: Recover console of VM which connected to console of another VM
How do I recover the console of the first guest when itself is connected to a guest of which it is the host? ``` Host1:~$ virsh console Guest1 ... Connected to domain 'Guest1' Escape character is ^] (Ctrl + ]) Guest2 login: ``` Guest1 has been connected to Guest2 using the `virsh console Guest2` com...
How do I recover the console of the first guest when itself is connected to a guest of which it is the host?
Host1:~$ virsh console Guest1
...
Connected to domain 'Guest1'
Escape character is ^] (Ctrl + ])
Guest2 login:
Guest1 has been connected to Guest2 using the virsh console Guest2
command.
Guest2 runs on Guest1 with the same KVM and LIBVIRT packages as Guest1 does on Host1.
I do not want to reboot any machine.
I possess the credentials of all machines.
viator
(77 rep)
May 4, 2024, 09:52 AM
• Last activity: May 4, 2024, 10:08 AM
Showing page 1 of 20 total questions