How to Copy Files into a VM with libvirt, if the VM is using NAT?
How to Copy Files into a VM with libvirt, if the VM is using NAT?
Make sure the VM is shut down first
sudo virsh shutdown
Copy the file
sudo virt-copy-in -a /var/lib/libvirt/images/
Start the VM again
sudo virsh start
To copy out files:
Make sure the VM is shut down first
sudo virsh shutdown
Copy the file out
sudo virt-copy-out -a /var/lib/libvirt/images/
Start the VM again
sudo virsh start
The last argument must be a directory on your local system (not a filename) You can copy multiple files at once by listing them before the destination directory To copy entire directories, use the -R (recursive) flag