Can I put a card in a generic PC to make Linux have a serial console?
I have a couple Linux boxes at home, and they're all based on desktop-class machines (i.e., not rackmountable servers). For example, a run of the mill Asus i3 motherboard.
If I have an issue with the system or want to do something in single user mode, I have to drag a monitor/mouse/keyboard over to it and access it that way. I could invest in a KVM setup but that is really overkill - and I couldn't access the console if I was remote anyway. The boxes don't have serial ports on them (most PCs don't these days, alas) and I'm wondering if I can buy an add-on card and tell Linux "use this serial as your console" so that on boot all input goes there and I can connect to it from another server (via tip/cu). I also have a USB-to-serial device and am wondering if that is an option. Ideally, I'd have both boxes running their consoles on serial ports, and then those serial ports could be accessed via tip from one server. Or is this something that needs to be wired into the mobo? I have a Soekris box (which is a small embedded system) with a serial port, and this is exactly what I do - but that port is directly on the mobo and the BIOS supports it, while my Linux boxes are generic PCs. |
Member response
Hi,
If the system are on your LAN then why not use 'ssh' to access for work/maintenance? Have fun & enjoy! Hope this helps. :hattip: |
Yes, you can find lots of info on configuring a serial console but it depends on the distribution / version i.e using inittab or systemd etc. Most recent versions should be able to use a USB adapter but not confirmed.
|
Quote:
This might be useful: http://www.vanemery.com/Linux/Serial...l-console.html |
A bit dated but the basic concept has not changed. We need to know what distribution / version you are running. Many have gone to using systemd or upstart and inittab is not used anymore.
|
CentOS 7 and Debian 7, so both systemd and inittab at the moment. Would this only be supported on one or the other?
|
Quote:
|
Sorry, what I meant is "do Centos 7 and Debian 7 both support a serial console"?
I'm assuming they do, though the procedure for getting there is different, given that one is systemd and one is /etc/init.d |
Yes.
|
Well I'm a little further along with this but it isn't quite working.
What I'm hoping is that after BIOS, everything from the grub stage on will go to the serial console. I've got the serial console working, but it only seems to come up after boot is finished. I'm running Debian 7 and was using this guide: http://www.coreboot.org/Serial_console#GRUB2 I put this in /etc/default/grub: Code:
# Uncomment to disable graphical terminal (grub-pc only) I also tried the 40_custom which was the same. As I understand things, while I can't get BIOS over serial, I should be able to get everything from grub on forward over serial. What I'm looking for is to have the serial port as the console, not just another login. |
The magic sauce is that this is a two-phase problem. You have to tell grub and the kernel to use ttyS0.
So in addition to the above, you also need: Code:
GRUB_CMDLINE_LINUX="console=ttyS0,115200" Code:
[ ok ] Starting system message bus: dbus. |
Try adding:
GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0,115200n8" http://wiki.linuxservertech.com/inde...155&artlang=en |
Member response
Hi,
From: https://duckduckgo.com/l/?kh=-1&uddg...-4175528157%2F Looking at this if you have source installed; /usr/source/linux/Documentation/kernel-parameters.txt; You can also look at: kernel-parameters.txt , you will need to scroll down to console=; Quote:
Hope this helps. Have fun & enjoy! :hattip: |
Member response
Hi,
One thought that came to mind is what type of cable configuration are you using? Null modem cable for RS232 would be the easiest to setup if you not need handshaking. |
Adding the 'n8' to
Code:
GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0,115200n8" |
All times are GMT -5. The time now is 11:11 PM. |