[lxc-users] why doesn't this redirection work? (lxc exec remote:container command > file.txt)

Tomasz Chmielewski mangoo at wpkg.org
Tue Jun 9 12:02:16 UTC 2020


This works as expected (outputs to stdout):

# lxc exec lxd05:tomasztest -- hostname
tomasztest


This doesn't work as expected (output file is empty, zero bytes):

# lxc exec lxd05:tomasztest -- hostname > output.txt

# cat output.txt

# ls -l output.txt
-rw-r--r-- 1 root root 0 Jun  9 11:56 output.txt


Note! The above redirection works if both servers are "bare metal".
The above redirection DOES NOT work if the remote is "bare metal", but 
commands are executed in a LXD container.


I think it did work with LXD installed from deb (i.e. v. 3.0.3).

Tomasz


More information about the lxc-users mailing list