[Bug]: Drives stop working
Describe the bug
Occasionally, whenever i go to open a file in the program i launched using Bottles, the wine file explorer will not display any files or folders in my custom drives, s: and h:, being links to /home/bazzite/.steam/steam/steamapps/, and /home/bazzite respectively.
If i go to .../bottles/[Bottle name]/dosdevices/ in Dolphin, i can see that the files named h: and s: are unknown files, strangely executables, but still being links to their previously mentioned locations. However, the c: and z: drives remain standard linked folders.
I can temporarily fix this by simply adding links with the names of s: and h:, but they seem to re-corrupt later, but not immediately.
To Reproduce
Unfortunately, I have almost zero idea on how to reproduce this :(
Package
Flatpak from Flathub
Distribution
Bazzite 43
Debugging Information
Official Package: true
Version: '62.0'
DE/WM: plasma
Display:
X.org: true
X.org (port): :0
Wayland: true
Graphics:
vendors:
nvidia: &id002
vendor: nvidia
envs:
__NV_PRIME_RENDER_OFFLOAD: '1'
__GLX_VENDOR_LIBRARY_NAME: nvidia
__VK_LAYER_NV_optimus: NVIDIA_only
icd: /usr/share/vulkan/icd.d/nvidia_icd.json
nvngx_path: /usr/lib/x86_64-linux-gnu/GL/nvidia-595-45-04/lib/nvidia/wine
intel: &id001
vendor: intel
envs:
DRI_PRIME: '1'
icd: /usr/share/vulkan/icd.d/intel_icd.x86_64.json:/usr/share/vulkan/icd.d/intel_hasvk_icd.x86_64.json:/usr/lib/x86_64-linux-gnu/GL/vulkan/icd.d/intel_icd.x86_64.json:/usr/lib/x86_64-linux-gnu/GL/vulkan/icd.d/intel_hasvk_icd.x86_64.json:/usr/lib/i386-linux-gnu/GL/vulkan/icd.d/intel_icd.i686.json:/usr/lib/i386-linux-gnu/GL/vulkan/icd.d/intel_hasvk_icd.i686.json
prime:
integrated: *id001
discrete: *id002
Kernel:
Type: Linux
Version: 6.17.7-ba28.fc43.x86_64
Disk:
Total: 16720699392
Free: 16718950400
RAM:
MemTotal: 31.1GiB
MemAvailable: 25.1GiB
Bottles_envs: null
Troubleshooting Logs
Additional context
No response
If you create the drives via the Bottles GUI then the directories are opened using the flatpak documents portal.
Basically this will create a symlink in a /run/user subdirectory e.g. /run/user/1000/doc/198f3f04/SomeDirectory so that sandboxed applications can access the path without seeing everything else. These symlinks get recreated each login when a flatpak application starts (it won't exist when you initially log-in).
So if I make a drive k: that points to /home/name/SomeDirectory then dosdevices/k: is a symlink to /run/user/1000/doc/198f3f04/SomeDirectory which is a second symlink to /home/name/SomeDirectory
I had a similar bug where I would make a bottle in a custom directory and then the symlink wouldn't get recreated when I started bottles back up, so the bottle would just disappear. I think it's a bug with the daemon that creates the symlinks rather than a problem with bottles, but I had to manually edit the paths to work around the bug.
In the Dolphin file manager, a broken symlink will display as an unknown file (the icon for which looks similar to the executable icon but it has a question mark in the middle of it). In your case, I think the dosdevices symlinks still point to the /run/user ones that haven't been recreated. If you manually created the symlinks (e.g. via the terminal) to point directly to the target directory, I have no idea why they've reverted like that,
You could try creating the drives via winecfg. In the bottle details view it's under "Tools" > "Legacy Wine Tools" > "Configuration". The drives editor is in the "Drives" tab. This should create a symlink that points directly to the target instead of using the documents portal.
You will need to add an override for the path too e.g. flatpak override --user --filesystem="/home/name/SomeDirectory" com.usebottles.bottles so that bottles can follow the link.
I think this might have worked, the drives look and work normal now, but i'll give it a few days before i close this issue just to be sure.
I tried to reproduce the bug in many ways without success, keeping it open for further investigations.
Well so far, Graham--M's solution has been working perfectly ever since since march with no issues.
If you create the drives via the Bottles GUI then the directories are opened using the flatpak documents portal.
Basically this will create a symlink in a
/run/usersubdirectory e.g./run/user/1000/doc/198f3f04/SomeDirectoryso that sandboxed applications can access the path without seeing everything else. These symlinks get recreated each login when a flatpak application starts (it won't exist when you initially log-in). [...] In the bottle details view it's under "Tools" > "Legacy Wine Tools" > "Configuration".
If Bottles could let me just type the path instead of forcingme to use the file-picker, I could work around this xdg-desktop-portal issue without using legacy tools or editing config files...
@mirkobrombin Thanks, I just tested this:
- Flatpak has access to the /mnt/Games drive via Flatseal already.
- Picking via the directory portal works and gives me a /mnt/Games path since the Flatpak already has permissions to it, so no /run/user here.
- Manually typing /mnt/Games works too, but it took me too long to realize that I had to press an apply-button that appeared in the text field. I tried pressing enter which did nothing. Apart from that UX downside, it's working great! ❤️