I need to exchange files between my host (Debian) and Whonix-Workstation. I use KVM. The best option should be KVM shared folders, right (Whonix ™ for KVM)?
However, I use a headless server and the guide only shows the GUI way to enable shared folders. Please help.
Is there anybody who can help me out?
Free Support for Whonix ™ applies. This can be figured out using a non-Whonix VM. I.e. for example a Debian VM.
Maybe I asked my question too vague, because I am pretty sure that the community can answer my question:
How to share files under KVM on a headless server (Host <—> Workstation)?
How to create KVM shared folders on the cli
Notice: Replace <user_name> with your host user name.
- Edit the Whonix-Workstation XML file:
sudo virsh -c qemu:///system edit Whonix-Workstation
- Add the flowing lines inside the
<devices></devices>
tag:
<filesystem type='mount' accessmode='mapped'>
<source dir='/home/<user_name>/shared'/>
<target dir='shared'/>
</filesystem>
- Create a shared folder on the host:
mkdir /home/<user_name>/shared
- Set correct permission for the folder
sudo chmod 777 -R /home/<user_name>/shared
- Restart the Whonix-Workstation
sudo virsh shutdown Whonix-Workstation
sudo virsh start Whonix-Workstation
- Login to the Whonix-Workstation
sudo virsh console Whonix-Workstation
- Create a test file inside the shared folder mounted at
/mnt/shared
cd /mnt/shared
nano test-from-guest
- Logout from Whonix-Workstation
exit
STRG + ALT + 5
- Check for the file
cd /home/<user_name>/shared
ls
You should see your created test file.
Question: Is there a better option without the <user_name>? Because, this can be considered a leak, right?