Shared Folder Host-Side implementation

This topic is to track tasks needed to implement host-side shared folders for KVM.

  1. Incron install and config for auto permission adjustment.
  2. shared folder help package additions

  1. Status: Incron policy for permission command application upon certain file actions testing and working.

  2. Status:WIP

systemd service change to add a directory in the user’s home folder if it detects non-virtual environment. Will need to distinguish between Whonix-Host and Whonix Physical builds on x64 and ARM somehow since that would be irrelevant. @Patrick what if set it to look for a certain “this is Whonix-Host” file that’s only available in a Whonix Host build?

Two parts:
*mkdir /home/$USER/shared
*Adding a shared folder device to Whonix-Workstation using virt-xml. DONE. User name needs to be variable scripted though.

sudo virt-xml Whonix-Workstation --add-device --filesystem source=/home/user/shared,target=shared,type=mount,accessmode=mapped

systemd supports ConditionVirtualization=false, does that help?

On host or in VM?

What about the already established /mnt/shared folder by https://github.com/Whonix/shared-folder-help package?

Not yet, but will be implemented.

It should.

All host side.

Good idea. Are /mnt/ permissions lenient or will they cause problems for files in /shared ?

Are /mnt/ permissions lenient or will they cause problems for files in /shared ?

It’s whatever we make them. Worked well inside VMs. (See
shared-folder-help.postinst.)

Since the same directory location is readily available on host and guest this part of the package doesn’t need conditionals.

Only the part about pulling/sarting the incron package should be on the host. Is it possible to control whther a dependency gets pulled depending on the environment? Or maybe the incron daemon can be adjusted to only start when it detects it’s not virtualized.

Not that I know, but no need since the dependency could be added to the host package whonix-host-xfce-kvm-freedom which only gets installed on Whonix Host Xfce KVM.

1 Like

Should I add it now or when a full configuration is added?

1 Like

Dunno. I don’t know what would speak about doing it now.

add

virt-xml "Whonix-Workstation" --add-device --filesystem source=/mnt/shared,target=shared,type=mount,accessmode=mapped`

below

https://github.com/Whonix/whonix-libvirt/blob/master/usr/lib/whonix-libvirt/install#L69-L78

?

1 Like

And above, add

mkdir --parents /mnt/shared
chmod 777 /mnt/shared

?

Then this is fully implemented? No need for ConditionVirtualization=false or any other changes?

OK these two commands need to precede the virt-xml one or else it fails becuase the folder doesn;t exist

No need for service conditions now after this. incron can just go into the host package you mentioned.

1 Like

Ok. Could you add too please?

virt-xml “Whonix-Workstation” --add-device --filesystem source=/mnt/shared,target=shared,type=mount,accessmode=mapped` || true

Does it need -c qemu:///system?

1 Like

OK Does it need to be in a if-then block?

No this is a dedicated tool that doesn’t use this notation

No, since these commands are idempotent.

1 Like

Done

This commit does not show up in git master branch.

Commits · Kicksecure/libvirt-dist · GitHub

I also don’t see a new branch.

It also does not show up in https://github.com/Whonix/whonix-libvirt/blob/master/usr/lib/whonix-libvirt/install

git fetch followed by git show does not show commit 25649bd7f16f8030a5c9d812146b53711c5e330f either.

Really strange.

Did you use “directly commit to git” using github web? I have no idea how to use that or how to make use of such commits (without manual copy/paste which would be besides the point and loose authorship and commit messages).

I’m using the web interface right now and it seems to have messed things upat your end? I was commiting the patch to the master branch

1 Like

Never mind I missed Add shared folder by HulaHoopWhonix · Pull Request #85 · Kicksecure/libvirt-dist · GitHub which will work as usual.

1 Like

Merged.

1 Like

Do you think Whonix GW should have it added as well? Or leaveit on per user basis?

I imagine this could be part of a usability tool on the GW where users want to backup/restore onion keys on demand.

1 Like