Search

Language:  
Search for:

Available article translations:

How to set up a serial console to a Linux server

APPLIES TO:
  • Parallels Operations Automation 5.5
  • Parallels Cloud Server
  • Parallels Virtuozzo Containers for Linux
  • Parallels Server

Symptoms

Sometimes it is necessary to set up a serial console to troubleshoot kernel crashes and server hang issues on Parallels Server Bare Metal or Parallels Containers for Linux.

Resolution

  1. Connect the Parallels Server Bare Metal or Parallels Containers node (hereafter HW) with the monitoring node (hereafter MN) using a null-modem cable between the two COM ports.
  2. Try to find which of the tty consoles is responsible for the connected COM ports. On MN:

    [root@monitor ~]# ls -l /dev/ttyS?
    crw-rw---- 1 root uucp 4, 64 Feb 23 11:06 /dev/ttyS0
    crw-rw---- 1 root uucp 4, 65 Feb 23 11:06 /dev/ttyS1
    crw-rw---- 1 root uucp 4, 66 Feb 23 11:06 /dev/ttyS2
    crw-rw---- 1 root uucp 4, 67 Feb 23 11:06 /dev/ttyS3
    [root@monitor ~]# cat /dev/ttyS0
    

    If it is not the correct console, you will get this error:

    [root@monitor ~]# cat /dev/ttyS3
    cat: /dev/ttyS3: Input/output error
    

    If you are using correct terminal, then you will see a similar output:

    [root@monitor ~]# cat /dev/ttyS0
    _
    

    Now, jump to HW:

    [root@pvcfl46x64 ~]# for COMPORT in `ls /dev/ttyS?`; do echo ${COMPORT}; echo test > ${COMPORT} ;done
    /dev/ttyS0
    /dev/ttyS1
    -bash: echo: write error: Input/output error
    /dev/ttyS2
    -bash: echo: write error: Input/output error
    /dev/ttyS3
    -bash: echo: write error: Input/output error
    

    We see that /dev/ttyS0 is the correct console.

    Now, jump back to MN and you should see the following message:

    [root@monitor ~]# cat /dev/ttyS0
    test
    

    If you see some garbled text, then the baud rates do not match (but they will be configured later).

  3. Configuring HW:

    Set the debug output to the required console device, e.g., /dev/ttyS0:

    [root@pvcfl46x64 ~]# grep console /etc/grub.conf

    kernel /boot/vmlinuz-2.6.18-028stab070.14 ro root=LABEL=/1 debug console=ttyS0,115200 console=tty

    ttyS0 is the COM port we found in pp.2 and 115200 is the baud rate for sending information.

    Also, the enable debug output in /etc/sysctl.conf:

    [root@pvcfl46x64 ~]# grep printk /etc/sysctl.conf
    kernel.printk = 8 4 1 7
    [root@pvcfl46x64 ~]# sysctl -p
    
  4. Configuring MN:

    Note: It is best to set up ttylogd as per Parallels Containers User Guide:

    1. Find the ttylogd RPM, e.g., from the Parallels Containers distribution, which can be downloaded using the instructions from this KB article:

      [root@pvcfl46x64 ~]# ./virtuozzo-4.0.0-448-x86_64.sfx -d virtuozzo --extract
      extracting...
      Extraction success
      [root@pvcfl46x64 ~]# find virtuozzo/ -iname '*ttylogd*'
      virtuozzo/virtuozzo/RPMS/ttylogd-3.0.0-3.swsoft.x86_64.rpm
      

      Alternatively, you can get the needed package directly:

      1. For 64-bit
      2. For 32-bit
    2. Copy the RPM to MN:

      [root@pvcfl46x64 ~]# scp virtuozzo/virtuozzo/RPMS/ttylogd-3.0.0-3.swsoft.x86_64.rpm root@monitor:/
      The authenticity of host 'monitor (10.55.63.11)' can't be established.
      RSA key fingerprint is 77:91:fa:65:b1:68:43:8e:fa:5a:a2:8c:72:86:99:4c.
      Are you sure you want to continue connecting (yes/no)? yes
      Warning: Permanently added 'monitor' (RSA) to the list of known hosts.
      root@monitor's password:
      ttylogd-3.0.0-3.swsoft.x86_64.rpm 100% 12KB 12.2KB/s 00:00
      [root@pvcfl46x64 ~]#
      
    3. Install ttylogd:

      [root@monitor ~]# rpm -Uvh /ttylogd-3.0.0-3.swsoft.x86_64.rpm
      warning: /ttylogd-3.0.0-3.swsoft.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 2425c37e
      Preparing... ########################################### [100%]
      1:ttylogd ########################################### [100%]
      
    4. Configure ttylogd:

      [root@monitor ~]# cat /etc/ttylog.conf
      DAEMONS="1"
      PORT_OPTIONS_GLOBAL="115200 cs8 -hupcl -cstopb cread clocal -crtscts -icrnl ixon \
      ixoff -opost -isig -icanon -iexten -echo"
      PORT1=/dev/ttyS0
      HOST1=pvcfl46
      LOG1="/var/log/console-${HOST1}.log"
      

      /dev/ttyS0 is the COM port found on MN in pp.2.

      [root@monitor ~]# /etc/init.d/ttylogd restart
      Shutting down ttylogd: [FAILED]
      Starting ttylogd /dev/ttyS0: [ OK ]
      [root@monitor ~]#
      
    5. Reboot the HW node, and in the meantime, check the log on MN:

      [root@monitor ~]# tail -f /var/log/console-pvcfl46.log
      Feb 23 12:10:10 pvcfl46 ttylogd v.2.1.0-5 started
      

Now, if the kernel is crashed, it will be possible to collect and analyze the log on MN.

Note: It is also possible to use USB-to-Serial adapters, and in this case, the device names should be /dev/ttyUSBx instead of /dev/ttySx.

Note: Two Hardware Nodes can be monitors for each other.

Additional Information

For more information, see:

Parallels Containers User guide pages:

For more information about obtaining the full distribution, refer to this article:

  • 10043: How to download full distribution of Parallels Containers for Linux

Search words:

server crash

server hang

serial console

hardware node hang




2897d76d56d2010f4e3a28f864d69223 eb0ea3b827d18de2329b6477e24c1d59 909d99074e442b52ce54cc7b31cf065d ca05eaf5b843fbd53589c90d7228a6df bf1c3a170005eae151f49ba2720abde9 64cafed7cc15bceb3b240d8c2f92dce3 caea8340e2d186a540518d08602aa065 f61d9c3a6d233f5fda89aa20fffd1398 c65eaff5333f2b87eda32041b8ac987f

FEEDBACK
Was this article helpful?
Tell us how we may improve it.
Yes No
 
 
 
 
 
 
Desktop Virtualization
- Parallels Desktop 9 for Mac
- Parallels Transporter
- Parallels Desktop Switch to Mac Edition
- Parallels Desktop for Mac Enterprise Edition
- Parallels Management-Mac for Microsoft SCCM
Server Virtualization
- Parallels Cloud Server
- Parallels Containers for Windows 6.0 Beta
- Parallels Virtuozzo Containers
Automation
- Parallels Automation
- Parallels Automation for Cloud Infrastructure
- Parallels Business Automation Standard
- Parallels Virtual Automation
- Parallels Plesk Panel Suite
- Web Presence Builder
- Parallels Plesk Automation
- Parallels Small Business Panel
- Value-added Services for Hosters
- Parallels Partner Storefront
Services & Resources
- Cloud Acceleration Services
- Professional Services
- Support Services
- Training & Certification