9

I have a file/directory on the host that I want to copy into the LXD container.

What is the command to copy the host -> container?

Jake
  • 401
  • 3
  • 5
  • 8
  • From the host cp source destination. What problem are you having with that, we need more information – Panther Jun 20 '18 at 17:08

1 Answers1

13

Suppose we want to copy file.txt from host to /home/ubuntu/ directory of the container1

lxc file push file.txt container1/home/ubuntu/

to copy a directory from host to container, use -r

lxc file push -r direcoty/ vm1/home/ubuntu/

to copy file from container to host, use pull

lxc file pull vm1/home/ubuntu/file.txt .