Wineboot /symlink

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
alkisg
Level 1
Level 1
Posts: 7
Joined: Mon Sep 19, 2022 11:41 pm

Wineboot /symlink

Post by alkisg »

Code: Select all

$ du -sh ~/.wine/drive_c/windows/* | sort -h | tail -n 2
417M	/home/alkisg/.wine/drive_c/windows/syswow64
493M	/home/alkisg/.wine/drive_c/windows/system32
Currently, running even small portable.exe applications creates a 1 GB ~/.wine folder for each user.
For multi-user systems like schools, we now need +100 GB disks for every 100 students. It's 10 times more than the space we need for ALL the other user documents and files put together.
Would it be possible to create something like a `wineboot /symlink` option, which would symlink most of the .dlls instead of copying them?
If this isn't acceptable upstream, would it make sense to create an external program that would do such deduplication?
Would it work, or are there .exe programs that need write access to the initial dlls that wineboot creates?
Thank you!
madewokherd
Level 4
Level 4
Posts: 143
Joined: Mon Jun 02, 2008 5:03 pm

Re: Wineboot /symlink

Post by madewokherd »

Proton has a work-around that does this, but it's handled by the proton script (in Python) rather than Wine itself, and has some problems. The symlinks are visible to Windows programs, and in particular there's a way of getting file size that does not work for symlinks on Windows. Any installer that tries to write over those dll's will either fail due to lack of permissions, or write over the shared copy. So I don't think this is an acceptable approach for Wine.

There was a patchset submitted to Wine which created reflinks for Wine dll's on supported filesystems (btrfs and xfs being the main ones). This has none of the problems with symlinks, but the patchset was not accepted for some reason.

Both the symlink and reflink solution could probably be automated fairly easily for Winehq using an external script.

CrossOver (a paid product from a company I work for) has some solutions for managing multi-user setups like this, which use symlinks. An admin can install a Windows program and "Publish" it so that all users have access to the program. On each user's first run, a "stub bottle" will be created with symlinks to the published bottle. (Wine prefixes in CrossOver are referred to as "bottles".) Published bottles can also be packaged to .deb or .rpm. But, this system is not accurate to how multi-user works on Windows, and even on Windows non-admin accounts have problems sometimes, so it may not work with the software you're using or it may require tweaking the configuration to symlink or copy the correct files. Non-shared bottles still copy the dll's, so if you need students to be able to install their own software without taking up 1GB each, CrossOver won't solve that problem.
alkisg
Level 1
Level 1
Posts: 7
Joined: Mon Sep 19, 2022 11:41 pm

Re: Wineboot /symlink

Post by alkisg »

Thank you very much for this information.
In most schools here, students do not need to install their own programs.
I will also have a look at CrossOver, the multi user setup and the bottles.deb prefixes sound rather interesting!
Locked