Hi, I’m new to the forums and to LXC in general.
I’ve been experimenting with a container, and I’m adding a host pty as a unix-char device to the container, specifically source=/dev/ttyp0 as path=/dev/ttyFake.
Then when I go into the container and try open the /dev/ttyFake via os.open() in python and tried to use stty to see settings of the device and both of these return [Errno5] Input/output error.
Is there something I’m doing inherently wrong here?
any help will be appreciated, thanks in advance!
Thank you Simos,
I’m pretty new to the topic but my command set seem similar to the ones you used in the example just with ‘lxc‘ instead of ‘incus’ so I hope I’m not using the wrong version and that my question is actually relevant here.
Thanks for the example, it seems that a tty device works when adding it as a device without any problems, but when trying to do the same with pseudo-TTY I get this input/output error when running ‘stty’.
So I think this error is coming from something else, and not anything LXC related,
but thanks for the help!
When you run sudo stty -F /dev/tty0 on the host and you get some output, it means that this device has some process behind it. It’s a test on whether the device is alive or not.
Then, you create the proxy device in the container container, and you should be able to repeat the test to verify that it still works in the container.
I do not have /dev/ttypX on my recent Linux. Is that some other Linux flavor?
You are currently using LXD. Weirdly, in LXD the command-line client is named lxc which adds a lot to the confusion. See the earlier link to migrate to Incus. This discussion forum also supports LXC (note the capitalization), which is an older (but still supported) software for containers. In LXC, the commands to manage containers look like lxc-start, lxc-execute, lxc-stop and so on.