You can transfer files using SCP protocol working on the same port as SSH. For that you need to redirect the port 22 and connect withon the virtual machine to a local port (ssh2222
to that portin this example):
kvm -m 2G -hda image.raw -hdb image.data.qcow2 -redir tcp:11180::80 -redir tcp:2222::22
ssh -p 2222 localhost
You might need to add the account name beforeand connect with localhostssh
to that port:
ssh -p 2222 user@localhost
To transfer files you can then use scp
:
scp -p 2222 local_copyfile.txt user@localhost: file.txt