Skip to content

Conversation

@songpola
Copy link
Contributor

@songpola songpola commented Oct 13, 2025

Fix #43


The overlayfs already supported virtiofs since this PR: torvalds/linux@c6b80eb

Specifically, these two commits:

  1. torvalds/linux@bccece1
  2. torvalds/linux@d80172c

Now, looking at the current implementation (Linux Kernel v6.17), the overlayfs will check for xattr support of the upper , by trying to set (trusted|user).overlay.* xattr. By default, it will set using the trusted namespace, which requires CAP_SYS_ADMIN capability:

  1. Which will fail the ovl_setxattr() call
  2. noxattr will be set to true
  3. And finally, this check will fail, since the virtiofs was considered a remote filesystem.

To mitigate this, we can use userxattr mount option to use the user namespace instead.


Also, using the NixOS' new overlay fileSystems API can increase code readability and maintainability.

References:
NixOS/nixpkgs#290730
https://github.com/NixOS/nixpkgs/blob/nixos-unstable/nixos/modules/tasks/filesystems/overlayfs.nix

Copy link
Member

@SuperSandro2000 SuperSandro2000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first 3 commits should be one as their are just fixups and the last commit should have the message from the 2nd last.

@songpola
Copy link
Contributor Author

The first 3 commits should be one as their are just fixups and the last commit should have the message from the 2nd last.

Done. Please check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cannot boot VM with writableStoreOverlay + shares

2 participants