"lxc launch" over ssh need pseudo-terminal allocation?


I’m just stuck on a problem I never had before. THis command just freeze for ever, not output (even with -v and --debug):

ssh A.B.C.D lxc launch images:debian/buster test

If i add the -t option to ssh:

ssh -t A.B.C.B lxc launch images:debian/buster test

Creating test
Starting test

All fine.

I tried from two different machines, on two differents lxd host, same.

Any idea ?

If stdin isn’t a terminal, lxc launch attempts to read from it to get a container config yaml.
If reading from that ends up blocking, then the command will block.

-t forces a pty allocation which avoids this, normally, forcing stdin to be /dev/null also fixes that though I’m not sure how well ssh replicates this setup.

Does running ssh a.b.c.d lxc launch ... < /dev/null behave any better?

Hello Stéphane,

Thank you for the feedback.
Indeed it work with < /dev/null on the SSH command.
Is that a normal behaviour ?

That would be normal behavior for a program which reads from stdin when stdin isn’t a terminal, yeah.