Serial connection between 2 computers

8,587

First, when connecting two computers back-to-back via serial RS-232, you need to use a null-modem connector (crossover) so that you connect input to output and output to input. You can get a null-modem cable, or you can get an adapter to replace the gender changer.

Once connected, your thought of using putty is on the right track. You need to be sure both ends are trying to talk with the same baud rate (bit transfer speed), and using the same parity (even, odd, or none). Both ends will probably default to the same, but you should be sure to check them.

When you get these tested and are comfortable with the setup, you can try enabling the getty on one end (getty is the program that prompts for "login:"). You should be able to see the login prompt in the putty session on the other end.

Be sure to only enable getty on your headless servers, not on the computer on other end of the serial connection - they will both think the other's "login:" prompt is the login name and start echoing back and forth.

Share:
8,587
David Harris
Author by

David Harris

Updated on September 17, 2022

Comments

  • David Harris
    David Harris over 1 year

    I recently purchased a USB to serial cable to connect to other desktop computers (reason is for headless servers), and I don't know if it is working right or I am just doing something wrong. The USB cable has a male end if that matters any.

    As a test I fired up the Ubuntu installer on a to-be server with an additional parameter:

    console=ttyS0
    

    However, I fired up putty and connected to the COM port that device manager told me that USB adapter was using and did not get any output.

    I just now connected the USB to serial cable to an old laptop and fired up putty on both computers and mashed some keys to see if I could see ANY output on one of the terminals. Nothing. So, am I completely ignorant on how serial is supposed to work?

    Note: In order to connect the laptop to the other laptop I had to purchase a gender changer.

  • David Harris
    David Harris over 14 years
    Makes sense, I'll pick up a null-modem adapter tomorrow and see what happens. Thanks for the answer! Just a quick question though, if I mash keys on one end I should see the keys in the terminal on the other end correct?
  • Shannon Nelson
    Shannon Nelson over 14 years
    If you are running putty or some other terminal emulator on both ends, you might and you might not. You might only see the letters on the opposite screen if you don't have echo turned on. I believe putty turns on local echo, so you should be okay there. The other thing to watch for is the CR/LF options - you may need to play with that to get your line-feeds to work as expected. See the Terminal options in the putty config dialog.
  • Shannon Nelson
    Shannon Nelson over 14 years
    Does your old laptop have a (a) real serial port or (b) are you using another USB gizmo? If (a), does the laptop bios need to be tweaked to enable the serial port? If (b), is the OS on the old laptop new enough to know about serial-USB? Maybe start with a low baud rate on both ends to deal with sloppy UART timing on the older laptop, e.g. 2400 rather than 115.2k.