2

I have a requirement to share a single serial port between two or more linux containers. The LXCs are spawned by the host linux.

I explored the option of socat, wherein the host will open a TCP connection to which the guest containers will connect and map their virtual ttys to this TCP connection. And I am also thinking of providing a way to identify the clients at the server based on which the host can switch the connection that will actually write into the host tty.

I am not sure if this will fly in all scenarios, so checking with learned people to see if there is any other solution to the problem or if the proposed solution will even work.

Andrew Schulman
  • 8,811
  • 21
  • 32
  • 47
  • 1
    What kind of application is this. Most applications using serial ports require exclusive access. – Zoredache Feb 04 '15 at 21:13
  • Thanks for your response. I do not have full list of apps that will be running within each of the LXCs yet, but I certainly want to run agetty to run a login prompt. I do not think the apps themselves need the console, but I need to be able to run a login prompt. – networknovice Feb 04 '15 at 23:33
  • And to clarify further, only one LXC needs to be holding the serial port at any given point in time. If LXC-A gets the serial port then it will hold it till it decides to relinquish. – networknovice Feb 05 '15 at 00:39

0 Answers0