Procedure of connecting to Linux through serial port

Source: Internet
Author: User
Test in a virtual machine. 1. Modify the file/etc/inittab to edit the file inittab. Add the TTY: 2345: respawn:/sbin/agetty ttys0 9600 VT100 content: # vi/etc/inittab # Run Gettys in standard runlevels1: 2345: respawn:/sbin/mingetty tty12: 2345: respawn:/sbin/mingetty tty23: 2345: respawn: /sbin/mingetty tty34: 2345: pushed:/sbin/mingetty tty45: 2345: respawn:/sbin/mingetty tty56: 2345: pushed:/sbin/mingetty tty6tty: 2345: pushed: /sbin/agetty ttys0 9600 VT100 "tty" is the ID of the modified line "2345" indicates that the running level of the modified line is 2, 3, 4, and 5. "respawn" indicates that the command is executed again after exiting, so that other users can log on; "/sbin/agetty ttys0 9600 VT100" indicates the specific command, that is, it is used to open the serial port/dev/ttys0 (COM1 ), followed by the baud rate and Terminal Mode 2. Modify the/etc/securetty file to edit the file/etc/securetty and add the ttys0 content: this file is a list of tty devices that allow root login, these devices are read by the/bin/login program. To enable the user to log on as the root user through the serial port, you need to add "ttys0" to the file ", the system considers COM1 safe. # vi/etc/securetty policlettys0 ...... 3. Modify/boot/GRUB/menu. or modify the/etc/GRUB file. modify/boot/GRUB/menu in the conf file. in the LST file, add "console = ttys0, 9600 console = tty0" to the kernel line of the file. To make the file take effect, restart the system. # vi/boot/GRUB/menu. LST # grub. conf generated by Anaconda # note that you do not have to rerun grub after making changes to this file # notice: you do not have a/boot partition. this means that # All kernel and initrd paths are relative to/, eg. # root (hd0, 0) # Kern El/boot/vmlinuz-version Ro root =/dev/sda1 # initrd/boot/initrd-version.img # boot =/dev/sdadefault = 0 timeout = 5 splashimage = (hd0, 0) /boot/GRUB/splash.xpm.gz hiddenmenutitle centos (2.6.18-164. EL5) Root (hd0, 0) kernel/boot/vmlinuz-2.6.18-164.el5 Ro root = label =/rhgb quiet crashkernel = 128m @ 16 m console = ttys0, 9600 console = tty0 initrd/boot/initrd-2.6.18-164.el5.img 4. shut down two virtual machines, one linxu, and one XP, respectively, on the two virtual machines, add a serial device and set it. Edit the first virtual machine, add a serial port, select use named pipe, and enter the MPs queue name ://. /pipe/com_1, and then select this end is the server. and the other end is an application. You can check the yield CPU on Poll. The name of the second virtual machine is the same as that of the other virtual machine, especially the pipe. Select this end is the client.
5. install and set Named Pipe TCP proxy software install and set Named Pipe TCP proxy on the host to open Named Pipe TCP proxy, select Edit → new, and set Named Pipe name and port number pipe: //. /pipe/com_1 (same as the name in vmare) port is set to 2001 (random), other default.
6. Test the connection by using putty on the XP Virtual Machine with COM1. The baud rate is 9600. The connection is successful and the system is logged on.
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.