How do I copy a file/directory from host into a LXD container?

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?

1

1 Answer

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 .

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like