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:
But if I attach a serial port to this VM, ttyS0 works just fine. Then, the dmesg | grep tty shows: Quote:
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. |
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 |
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:
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? |
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? |
try
Code:
chmod 666 /dev/ttyS0 |
All times are GMT -5. The time now is 02:13 AM. |