Where can Samba shares accessed by KDE be found in the Linux file system?

When Gnome accesses a remote Samba share, the shared folder, with all its subdirectories and other files, can be found somewhere in /run. Where can KDE’s Samba shares be found in the Linux file system? I haven’t been able to find them

I need to know this because I have a command-line utility that I want to be able to run in a directory on a Samba share.

2 Likes

You need to install kio-fuse and then those mounts becomes visible.

Alternatively you can use mount -t cifs or fstab configuration.

Yes kio fuse should do this automatically once it’s installed and active, and you have accessed the resource something via KDE.

One caveat. The path is not static, changes on every boot. So for example if I access smb://192.168.243.4/media/incoming/ in Dolphin, I can then go to /run/user/1000/kio-fuse-IyoDdi/smb/192.168.243.4/media/incoming/ in the shell, where IyoDdi is the id given to the resource for this boot.

There is an open issue about this in Gitlab, I hope this could be improved upon so the path is shorter and static across boots. I have to look into how Gnome does it again, afaik there the path is static and they have a way of handling it correctly should the connection to the share drop for some reason.

For the time being I prefer using fstab mounts honestly. Because I want a short and easy static path I can interact with in the shell. This has the caveat that when you access the share via Dolphin or other KDE apps, you will experience UI hangs because access to these drives is (as I understand it) sequential in nature, which is the precise issue kio-fuse is here to solve because it enables asynchronous access for KDE apps. I can live with that now but it’s something to be aware of.

In my example I’m using fstab nfs4 mount
192.168.243.4:/mnt/flash/m/media /mnt/m nfs auto,vers=4,timeo=14 0 0

1 Like

did you try something like:

findmnt -t cifs,nfs4,smb

‘and active’ is the crucial one here. How do I make it so? I have a Kubuntu running where kio-fuse is installed, but it is not activated. The documentation in /usr/share is not applicable if you just want to run the installed version, not testing a dev version.

So how does it get activated (automatically)?

I tried with systemctl --user enable --now kio-fuse.service, but it errored out:

emk2203@M4800:~$ systemctl --user enable --now kio-fuse.service
The unit files have no installation config (WantedBy=, RequiredBy=, UpheldBy=,
Also=, or Alias= settings in the [Install] section, and DefaultInstance= for
template units). This means they are not meant to be enabled or disabled using systemctl.
 
Possible reasons for having these kinds of units are:
• A unit may be statically enabled by being symlinked from another unit's
  .wants/, .requires/, or .upholds/ directory.
• A unit's purpose may be to act as a helper for some other unit which has
  a requirement dependency on it.
• A unit may be started when needed via activation (socket, path, timer,
  D-Bus, udev, scripted systemctl call, ...).
• In case of template units, the unit is meant to be enabled with some
  instance name specified.
Job for kio-fuse.service failed because the control process exited with error code.
See "systemctl --user status kio-fuse.service" and "journalctl --user -xeu kio-fuse.service" for details.

If you go in dolphin in a samba folder and try to open the file it should activate and make the fuse mount if you don’t open using a KDE application or video files with vlc (they don’t need kio-fuse to work).

I know it does work in Arch with mpv for instance, but for Kubuntu with older packages I can’t be certain this works.

1 Like

My Kubuntu is 26.04dev, so the packages have (for the moment) equal versions to Arch, more or less.

I tried what you suggested with the addition of using

emk2203@M4800:~$ systemctl --user edit --full kio-fuse
Successfully installed edited file '/home/emk2203/.config/systemd/user/kio-fuse.service'.
emk2203@M4800:~$ cat /home/emk2203/.config/systemd/user/kio-fuse.service 
[Unit]
Description=Fuse interface for KIO
PartOf=graphical-session.target

[Service]
ExecStart=/usr/lib/x86_64-linux-gnu/libexec/kio-fuse -f /home/emk2203/mnt_kio
BusName=org.kde.KIOFuse
Slice=background.slice

to get a stable, reproducible share without random directory names.

This directory above stayed empty until I opened a file from Dolphin with mpv as you suggested.

Afterwards, even when closing mpv, the directory stayed populated.

My question now would be: What is the easiest way to trigger kio-fuse to light? It’s impractical to always open a video file with mpv. It’s not enough to touch emptyfile in the samba share – I tried.

Observation:

The kio-fuse is a lot more reliable than Dolphin. After triggering kio-fuse, I have access in ~/mnt_kio/smb/emk2203\@nuc10i3fnk.local/ to all five available shares. There’s one share which Dolphin never shows (even though it should) and one share which only opens after I have opened another share, otherwise I only get failed login attempts. This behavior is erratic (number of login attempts) and not really reproducible.

Overall, flaky behavior.

The kio-fuse directory lets me see and open all the shares, reproducible.

Now I just need to automount it after login.

I really like KDE, but in comparison to Gnome’s gvfs, this leaves a lot to be desired.

Any application launched opening a file from dolphin (or plasma) result the same.

What would be the way to do this programmatically, let’s say directly after login?

This can probably be done have a look at the kio-fuse doc: System / KIOFuse · GitLab

At this point you might as well us a smb mount is /etc/fstab or autofs.

I read this, but since they cover only ftp, I thought it’s not applicable. So something like ftp://user:password@server/directory could be replaced by smb://user:password@smbserver/share?

I have to look into autofs more. I associated it mainly with nfs. /etc/fstab is too inflexible, think road warrior with different samba servers at different places.

ftp was just an example here. smb, nfs, sftp would work the same.
kio-fuse is not restricted to some protocols, its point is precisely to abstract them.

You could have tried.

Yes, I agree. But there’s also so much time in a day, and this was more of a side quest for me while trying to work around issues which kept me from being productive.

Thanks for your patience.

Final questions:

kio-fuse mounts all the samba shares, even though I specified only one. Is this intended behavior? (This is why a smb example in the docs would be nice…)

kio-fuse mounts shares effortlessly which I can never see in Dolphin (home on remote server), or shares which I have trouble mounting in Dolphin. This one share mounts only after I mounted another share, and even then not reliably (repeated login windows).

Can I file this as a Dolphin bug?