How to access dolphin network mount through console?

In dolphin I can access e.g. smb://<some_IP_address> but I can’t find a mount point for it.

Is it possible to access this path from console?

IIRC, when you access a samba share using the smb:// KIO slave the share is not mounted as such, you’re just browsing the share using the samba protocol.

It is possible to mount a samba share with the gvfs-mount utility like this though…

gvfs-mount smb://192.168.1.2/path/to/share

enter the requested credentials, then the mount can be found under /run/user/1000/gvfs/ eg /run/user/1000/gvfs/smb-share:server=192.168.1.2,share=users/

and the mount command will show something like…

gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=7)

Thanks. I followed these instructions, entered credentials too but /run/user/1000/gvfs is empty and the mount doesn’t show anything about gvfs.

Any idea why?

OTOH it doesn’t allow me to do it again:

gvfs-mount smb://192.168.....
Error mounting location: Location is already mounted

so where is it mounted?

Did you do this as a regular user? Use the ‘mount’ command to check.

Run “mount” to find out.

Maybe you ran gvfs-mount as root? Then it would mount the share accessible for root only, in /run/user/0/gvfs/.
In other words: to mount something for your user, you need to run gvfs-mount as that user.

You can also use mount directly for mounting network shares. Something like:

sudo mount //HOST/SHARE *mountpoint* -o username=xxx,password=yyy

Yes, I did it as regular user.

I wouldn’t like to do it as root anyway. It would contradict the very idea of easiness I am looking for. I am just trying to access from console (from a script actually) a network location which is temporarily available (it is a shared smb folder on a VM guest running Windows).

You can also use mount directly for mounting network shares. Something like:

sudo mount //HOST/SHARE *mountpoint* -o username=xxx,password=yyy

Yes, that would be the “conventional” way. But I am rather looking to access something which is already mounted in dolphin, i.e. as user. Is that possible?

No, as dolphin doesn’t “mount” shares at all.

You could use smb4k to browse and mount them.
Or gvfs-mount.

wolfi@amiga:~> gvfs-mount smb://localhost/Texte
 Für den Speicherort texte auf localhost wird ein Passwort benötigt
User [wolfi]: 
Domain [HOME]: 
Password: 
wolfi@amiga:~> ls /run/user/$UID/gvfs/
smb-share:server=localhost,share=texte
wolfi@amiga:~> 

But yes, the share itself doesn’t show up in the output of “mount”. It’s /run/user/500/gvfs/ itself that’s mounted, gvfs-mount apparently just creates subdirectories there if you use it to “mount” something.

Alternatively, use KDE/KIO’s shell commands to access the share like dolphin would.
E.g. there’s kdecp5, kdemv5, or the general kioclient5:

wolfi@amiga:~> kioclient5 ls smb://localhost/Texte
...

See “kioclient5 --command” for a list of available commands.

I should note though that you need version 2.0.1 from the KDE:Extra repo.

The standard package in Tumbleweed has the mount functionality removed because the security team doesn’t like it… :’(

That’s weird. When I do the same, ls shows nothing, empty dir. Any idea why?

Alternatively, use KDE/KIO’s shell commands to access the share like dolphin would.
E.g. there’s kdecp5, kdemv5, or the general kioclient5:

wolfi@amiga:~> kioclient5 ls smb://localhost/Texte
...

See “kioclient5 --command” for a list of available commands.

That one seems to work! Thanks.

I will check that one too. Thank you.

ETA: I am using lightdm with Plasma in case that matters…

Not really.
Do you have gvfs-backend-samba installed?
Although I’d expect some error message if not.

I think I do:

~]: rpm -q gvfs-backend-samba
gvfs-backend-samba-1.28.3-2.2.x86_64

What is interesting is that gvfs-copy works…

Well, as demonstrated, it does work here on my 42.2 system. (though I find it a bit strange that I have to enter a password, the share is freely accessible and kioclient5 does not ask for a password…)

Maybe try to run nautilus, that should mount the share with gvfs-mount if you “open” it.
Does it work there, i.e. does nautilus list the files on the share?

What does “mount | grep gvfs” say?
Maybe the gvfs “filesystem” is mounted to a different place on your system…

PS, another option to “mount” shares as user is this:
http://software.opensuse.org/package/fusesmb
(available in the standard repos, so you can just install it with YaST or zypper)
I never tried that though.

Or you could also use Samba’s own smbclient. I don’t really know how to use it in scripts though. If you run it with just a share, it will be interactive like ftp, but it is possible to pass a list of commands to execute.
From “man smbclient”:

       -c|--command command string
           command string is a semicolon-separated list of commands to be
           executed instead of prompting from stdin.
            -N is implied by -c.

           This is particularly useful in scripts and for printing stdin to
           the server, e.g.  -c 'print -'.

This will list all files on a share e.g.:

smbclient //localhost/Texte -c ls

For more complex use, you’d have to experiment yourself and/or consult the man page.

I don’t have nautilus installed. I use plasma with lightdm.

What does “mount | grep gvfs” say?
Maybe the gvfs “filesystem” is mounted to a different place on your system…

I grepped this already but it is empty, nothing. I don’t know why it should be mounted on another place. How can I check?

That doesn’t mean that you cannot install it.

I am using Plasma here too, but with kdm (not that it matters), and do have nautilus installed (and a full GNOME desktop actually).

I grepped this already but it is empty, nothing. I don’t know why it should be mounted on another place. How can I check?

You can check with “mount | grep gvfs”, as I wrote.
This will show where/how gvfs is mounted.

If that’s empty, it doesn’t seem to be mounted at all.
That may be the reason why it doesn’t work.

I have no idea how gvfs works (I never use it anyway), so I don’t know why that would happen either.

Though, as it is mounted via fuse (to be able to mount it as user), check that the packages “fuse” and “gvfs-fuse” are installed.

Yes, I know but it wants to install too many other packages. I don’t want to clutter the system with things which I am not going to use anyway.

You can check with “mount | grep gvfs”, as I wrote.
This will show where/how gvfs is mounted.

If that’s empty, it doesn’t seem to be mounted at all.
That may be the reason why it doesn’t work.

It is empty but the strange thing is that it is mounted because a second attempt to mount it gives an error message:

Error mounting location: Location is already mounted

That’s why I say it is weird.

I have no idea how gvfs works (I never use it anyway), so I don’t know why that would happen either.

Though, as it is mounted via fuse (to be able to mount it as user), check that the packages “fuse” and “gvfs-fuse” are installed.

I have never used it either. Both these packages are installed.
But anyway I don’t want to bother you more. For the purpose of my script I will be able to do use gfvs-copy.

Thanks a lot!

Ok, but you might have had it installed already. I couldn’t know when I suggested it. :wink:

Anyway, I just wrote that because nautilus would use gvfs too.

It is empty but the strange thing is that it is mounted because a second attempt to mount it gives an error message:

Error mounting location: Location is already mounted

You seem to be mixing things up here.

One thing is mounting gvfs itself, the other thing is “mounting” shares (or other things) to that gvfs “filesystem”.

That error message means that you already “mounted” the share via gvfs-mount. It doesn’t say anything about gvfs itself.

Again, to avoid misunderstandings:
“mount | grep gvfs” should show if (and where) the virtual “gvfs” filesystem is mounted, that’s where things mounted via gvfs-mount would appear.
If that command doesn’t give any output, it doesn’t seem to be mounted at all, so obviously /run/user/$UID/gvfs will stay empty.

I’m not sure what mounts it though, or when.

But if gvfs-copy works, that’s probably sufficient for you.

PS: if I forcefully unmount /run/user/$UID/gvfs/ here (with “umount /run/user/$UID/gvfs/”), the directory will indeed stay empty when I run gvfs-mount, and running gvfs-mount a second time for the same share/location will bring up the mentioned error message that it’s already mounted.
I don’t know (yet) how to mount /run/user/$UID/gvfs/ again though.

Ok, killing gvfsd seems to “fix” that.
If I then run gvfs-mount again, it gets restarted and the share shows up again in /run/user/$UID/gvfs/ (even though I get the error message that the share is already mounted).

The question is: why doing the same what you do shows an empty /run/user/$UID/gvfs/ (although it is obviously “mounted”) and nothing in “mount | grep gvfs”.

Yes. Just trying to find out if there is some other issue on my system re. mount.