LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-26-2017, 01:46 AM   #1
neo3matrix
LQ Newbie
 
Registered: Nov 2009
Posts: 12

Rep: Reputation: 0
Enable /dev/ttyS0 on Centos 7 vm on ESX server


Hi,

I have created a centos 7 VM on VMWare vsphere ESX server.
I have not attached serial port to this VM to begin with.
But I still need to enable /dev/ttyS0.
How can achieve this? I remember on Centos 6 it was working fine even without attaching serial port.

Any operations I do on /dev/ttyS0 results in ttyS0: input/output error.
dmesg | grep tty only shows:
Quote:
console [ttyS0] enabled.

But if I attach a serial port to this VM, ttyS0 works just fine.
Then, the dmesg | grep tty shows:
Quote:
console [ttyS0] enabled.
ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A <---- this tells me that somewhere ttyS0 is now mapped(?) to some pci irq slot which was not happening in the above case.
I tried even playing with systemd files like [email]serial-getty@ttyS0.service but no luck!
If I try to start the service serial-getty@ttyS0, agetty gives error as "/dev/ttyS0 is not a character device."

Could someone please help me?

Thanks in advance.
 
Old 05-26-2017, 05:39 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,703

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
It is not clear what you are trying to achieve. You can set up a serial port in several ways depending on what you want to accomplish i.e using a physical port on the host, send output to a file, connect to a named pipe or connect over a network.


https://pubs.vmware.com/vsphere-50/i...962ABC9E3.html
 
Old 05-26-2017, 12:05 PM   #3
neo3matrix
LQ Newbie
 
Registered: Nov 2009
Posts: 12

Original Poster
Rep: Reputation: 0
Thanks michaelk for your reply.

Let me explain you what I am trying to achieve here:

We have our linux software which can work centos 6 as well as centos 7.
One of the task of that software is to ask user password on the console. (It's a shell script that used "read" command.) User enters that password and it is stored at some location on filesystem.
Now, for a vm instance, a user can use the graphical console of VMWare ESX server (tty1) OR he can use a serial port (ttyS0) connected to this VM - we don't know what he will configure/use at his end.

So, our shell script is generic - something like this:

Quote:
for t in /dev/tty0 /dev/ttyS0; do
prompt_user_for_password_script $t &
:
:
done
some other important logic "assuming" there are 2 processes running in background.


Now, if I have 2 VMs - one is centos 6 VM and other is Centos 7 VM (Both VMs doesn't have any serial port configured):
1. For centos 6 VM, the above script shows there are 2 processes running in background for prompt_user_for_password script.
2. for centos 7 VM, one of the background process dealing with /dev/ttyS0 fails and returns immediately. Also, if you run any command like stty, or echo or anything on /dev/ttyS0, it fails with error "ttyS0: Input/Output error".
But, if I attach a serial port to centos 7 VM, then the above script works fine.


I think it has something to do with systemd's dynamic tty logic or something.
Can someone please help me?

Last edited by neo3matrix; 05-26-2017 at 12:15 PM.
 
Old 05-26-2017, 02:48 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,982

Rep: Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626
thoughts.

A vm is a software version of a real computer and in many real computers that is a uart or parts for a serial console even if no shell connector. At first glance we'd think that the Centos version is to blame in some way. To prove it may be slightly harder. My question may be to decide if 7 enables the hardware in a different way or is it somehow changed to detect a vm or lack of serial support in config at install causes this.???


My question would be why not configure a serial port?

Last edited by jefro; 05-27-2017 at 02:30 PM.
 
Old 05-27-2017, 01:02 AM   #5
R03L
Member
 
Registered: Feb 2008
Location: Emmer-compascuum
Distribution: redhat* debian* arch* slack*
Posts: 216

Rep: Reputation: 31
try
Code:
chmod 666 /dev/ttyS0
its just a wild guess
 
  


Reply

Tags
centos7, serial console, systemd, ttys0, vmware



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Link /dev/mouse -> /dev/ttyS0 undone at reboot. stf92 Slackware 4 12-07-2012 05:37 PM
Cloning CentOS 6.2 Server to another ESX 4.1 host baldur2630 Linux - Virtualization and Cloud 1 03-19-2012 04:28 PM
SSH enable on ESX 4 sherimm Linux - Software 1 06-03-2009 08:57 PM
Minicom in /dev/ttyS0 Luis GUSTAVO Linux - Software 0 07-31-2003 05:42 PM
/dev/ttyS0 problems rbermude Linux - Software 2 06-27-2001 10:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration