How to send/upload a file from Host OS to guest OS in KVM?(not folder sharing)

Just hit upon two different ways:

  • Transfer files via network. For example you can run httpd on the host and use any web browser or wget/curl to download files. Probably most easy and handy.
  • Build ISO image on the host with files you want to transfer. Then attach it to the guest's CD drive.

    genisoimage -o image.iso -r /path/to/dir
    virsh attach-disk guest image.iso hdc --driver file --type cdrom --mode readonly
    
    • You can use mkisofs instead of genisoimage.
    • You can use GUI like virt-manager instead of virsh CUI to attach an ISO image to the guest.
    • You need to create a VM beforehand, supply that VM's ID as guest. You can see existing VMs by virsh list --all.