-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update XDG handlers to use GIVC instead of SSH #941
Conversation
The failure in the pre-merge-pipeline Lenovo-X1 tests was likely due to a loose robot finger. No further action is needed for this PR because of that. |
Tested on Lenovo-X1 (first X1 does not boot properly, gets stuck at boot logs. Host, net-vm and a few other vm:s are responding normally.
|
This may be caused by host shared folders missing |
Exactly. In previous versions of microvm.nix, there was 'mkdir -p "$SOURCE"' in the microvm-virtiofsd service but after the latest bump, it no longer creates the source folder. I didn't notice this because I use nixos-rebuild switch all the time. I suppose I can just add all the folders to microvm-host.nix. |
Thanks for testing. I've made an update to create shared directories on the host with correct permissions which should fix the issue. |
Signed-off-by: Yuri Nesterov <[email protected]>
Tested on Lenovo-X1 (
|
Description of changes
This updates XDG handlers to use GIVC and virtiofs storage instead of SSH and SCP.
For file sharing, this approach uses a shared XDG folder with the following structure:
/shared/xdg/mime/appvm
. Within the XDG folder there is a separate folder for each MIME type. These folders are passed to the VMs that can handle those types as virtiofs devices. Currently,zathura-vm
is used for handling both PDFs and images. Inside each MIME type folder there are subfolders for each appvm. These subfolders are passed to their respective appvms. This way appvms can share files withzathura-vm
by simply copying them into they folder.For example,
chrome-vm
has the/share/xdg/pdf/chrome-vm
folder mounted as/run/xdg/pdf
in the guest, but it can’t access the entire mime folder or other appvms files because only/share/xdg/pdf/chrome-vm
is passed as virtiofs device. However,zathura-vm
has access to the entire MIME folder, which includes subfolders for all appvms.The advantage of this approach is that files are shared through simple copying with no network data transfers and appvms cannot access files from other appvms since they are isolated at the virtiofs device level.
Checklist for things done
x86_64
aarch64
riscv64
make-checks
and it passesnixos-rebuild ... switch
Instructions for Testing
Lenovo X1
This doesn't introduce new functionality. It just changes the way XDG handlers work to remove SSH dependency.
On the Lenovo X1, open PDF and image files (JPG, PNG) either from a USB drive or those downloaded from Chrome. It should still work as expected. Compared to the previous implementation files may open more quickly but this difference is unlikely to be noticeable.