[RFC PATCH 0/5] Reducing prefix size with FUSE OverlayFS

Rémi Bernon rbernon at codeweavers.com
Mon Mar 30 07:24:25 CDT 2020

Hi all!

I have been playing with fuse-overlayfs [1] lately to reduce prefix size
and speed up wine startup time, and I thought maybe someone else could
be interested, and I would definitely be interested in some feedback,
especially if anyone already tried.

So far it has been working good for me, but to be fair I haven't used it
extensively yet. To enable the overlays, define the WINEPREFIX_OVERLAYS
environment variable to point to one or more drive_c to stack under
the prefix's drive_c, from top to bottom. For instance, creating a new
layered prefix with an existing default prefix and an additional
intermediate layer:

  WINEPREFIX_OVERLAYS=$PWD/pfx_layer1/drive_c:$PWD/default_pfx/drive_c \
  wine winecfg

Another possible advantage is that it makes it immediately clear which
files were modified by an application, as only these files will reside
in the upper layer.

Then there's a few drawbacks with this approach, notably prefix updates
becomes a bit complicated. The file updates aren't a real issue, and
it's actually very fitting for that, as the lower-most dir would
probably be a default wine prefix with all the builtin libraries, and
the upper dir contain only custom installed dlls. But the registry
updates on the other hand are more tricky as the registry backing files
quickly gets modified and copied to the upper dir.

For now I just disabled prefix updates when overlays are used, for
simplicity. I have a few ideas on how to do that properly but I didn't
implement anything yet.

Also, for simplicity only drive_c is currently overlayed, and I moved
wine-specific files under it. Having the whole prefix mounted creates
additional trouble as we use the prefix directory inode and dev numbers
for server identification, and having a mount here changes the values
after the initial server startup.


[1] https://github.com/containers/fuse-overlayfs

* OverlayFS is a file system concept with a set of "lower" read-only
  directories layered under an "upper" read-write directory. The lower
  dirs files are copied-on-write to the "upper" directory.

* fuse-overlayfs is a FUSE implementation of overlayfs so that it's
  possible for a unpriviledged user to mount such a filesystem. It's
  available on most linux distros as far as I know.

Rémi Bernon (5):
  server: Move registry files to drive_c/.wine.
  wineboot: Move .update-timestamp to drive_c/.wine.
  wineboot: Open update-timestamp read-only first.
  wineboot: Disable prefix update if overlays are used.
  server: Support mounting a FUSE overlayfs on drive_c.

 programs/wineboot/wineboot.c | 39 ++++++++++++--------
 server/main.c                | 71 ++++++++++++++++++++++++++++++++++++
 server/registry.c            | 13 +++++--
 3 files changed, 104 insertions(+), 19 deletions(-)


More information about the wine-devel mailing list