Pull file not wroking

lxd ubuntu container gui1804 in /home/bunutu/ there’s a file cxdiag.txt

ubuntu@gui1804:~$ ls
 Scapple-installer.exe                crossover_18.5.0-1.deb   standard-notes-3.0.8-x86_64.AppImage
 ShuffleStudy-1.4.3-x86_64.AppImage   **cxdiag.txt**
'Standard Notes Backups'              newly
ubuntu@gui1804:~$ file cxdiag.txt 
cxdiag.txt: ASCII text

This is the example from lxd getting started

lxc file pull first/etc/hosts

While on the host machine Sherab-PureOS
I am using the lxc file pull as follows

sherab@Sherab-PureOS:~$ lxc file pull gui1804/home/ubuntu/cxdiag.txt

Which looks similar to the explanation on LXD getting started page

But here’s what i get back

sherab@Sherab-PureOS:~$ lxc file pull gui1804/home/ubuntu/cxdiag.txt
  Pull files from containers

  lxc file pull [<remote>:]<container>/<path> [[<remote>:]<container>/<path>...] <target path> [flags]

  lxc file pull foo/etc/hosts .
     To pull /etc/hosts from the container and write it to the current directory.

  -p, --create-dirs   Create any directories necessary
  -r, --recursive     Recursively transfer files

Global Flags:
      --debug            Show all debug messages
      --force-local      Force using the local unix socket
  -h, --help             Print help
      --project string   Override the source project
  -q, --quiet            Don't show progress information
  -v, --verbose          Show all information messages
      --version          Print version number
Error: Invalid number of arguments

I do not see what I am doing wrong

You also need to specify the target path as well. That is, into which directory on the host to put the copied files.

Normally you would do the following to put the file into /tmp,

lxc file pull gui1804/home/ubuntu/cxdiag.txt /tmp/

or use . to put the file into the current directory. . is the current directory.

lxc file pull gui1804/home/ubuntu/cxdiag.txt .
1 Like

I forgot to say
thanks !!!