Incus File Pull - Unexpected behavior

Hi. I was not expecting this:

For a container c1 (either running OR not running on host):
incus file pull c1/path/file1 . #Gives me a copy of ‘file1’ on the host, as I expect

For a virtual machine v1 RUNNING on host:
incus file pull v1/path/file2 . #Also gives me a copy of ‘file2’ on the host, also as I expect; BUT

For a virtual machine NOT RUNNING, the same command:
incus file pull v1/path/file2 . Gives me ‘Error: Instance is not running’, which I was not expecting

Is this normal behavior please?
Is there a way I can extract a file from a stopped vm?



Yes, it’s expected behavior.

A system container, whether it is running or not, has its files easily accessible by the host. A system container is in essence a hierarchy of processes (a process tree) that is spawned by Incus.

In contrast, a virtual machine requires a special agent software that is added transparently by Incus. Incus then uses this middleman-agent when you run incus exec, incus file, etc.

You should be able to manually access the files from a virtual machine. This would depend on the type of the storage pool.

1 Like

simos explained it, but in addition to:

Is there a way I can extract a file from a stopped vm?

You can mount the raw image with qemu-nbd for example to see and access files inside it. Not saying this is better than just launching it via incus, but another way.

1 Like