I frequently connect to a remote device that has its own WiFi hotspot. I do this for a couple of purposes:
to transfer files from the remote to this computer
to run via VNC something on the remote device
To do #1, I have been using Nautilus → Other Locations → Enter Server Address, then click the connect button. Of course, the computer must at that point in time have been connected to the remote Hotspot, not to my home network.
Once the connection is made, if, in Nautilus, I try to open my home directory, to copy files to a subdirectory of home, after copying the files, Nautilus is sometimes but not always unable to display the contents of my home directory. This is very annoying and I’d like to understand it. Even if my computer is connected to the remote hotspot that should not prevent the home directory from being displayed.
What you are seeing is a quirk of Nautilus, not a problem with your /home
folder.
When you click Other Locations - Connect, Nautilus mounts the remote
hotspot with the gvfs SSH backend.
While that mount is active Nautilus keeps a single worker thread busy
talking to the remote machine. If the hotspot is slow—or drops for a
second every other tab that still belongs to that Nautilus window can
stall while it waits for the remote I/O to finish. It looks as if
Home is missing, but it’s just the UI waiting on a network timeout.
Three quick ways around it
Unmount the hotspot as soon as the copy is done
Click the little icon next to the remote entry in the sidebar, or run
gio mount -u "ssh://user@192.168.x.x/"
The moment the mount is gone Nautilus snaps back to normal.
Open a second Nautilus window for /home before you connect.
The hang is per-window; a fresh window stays responsive.
Copy files to ~/remote in Nautilus (or the terminal), then
fusermount -u ~/remote
sshfs runs in its own process, so Nautilus never blocks.
Nothing is happening to your home directory Nautilus is just waiting on the
slow remote mount. Unmount, use a new window, or switch to sshfs and the
problem disappears.
Thank you @thingizkhan. I’ve tried that unmounting of the hotspot. Sometimes it worked, sometimes it didn’t. I don’t think I did this right after the copy was done. so that may be why.
The second nautilus window idea sounds good.
Your third suggestion is unclear to me. Do the sshfs and fusermount commands have to be entered every time I want to transfer files? I don’t suppose it can be made permanent since the computer is only occasionally connected to the hotspot.
Glad the second-window idea helps.
Here’s a bit more detail on sshfs:
How sshfs works
sshfs user@host:/ ~/remote mounts the remote machine at ~/remote.
It’s just like plugging in a USB stick the folder appears instantly. fusermount -u ~/remote (or click the icon in Files) unmounts it.
Nothing persists after you unmount, so you run those two commands only when you actually need the connection.
Then you can mount with mount ~/remote and unmount with umount ~/remote.
Because sshfs runs in its own process, Nautilus windows never freeze even if the hotspot is slow or drops out at worst the mounted folder shows an I/O error while the rest of Files stays responsive.
It’s not really a bugjust a limitation of Nautilus’ design. One remote mount = one worker thread; if that thread stalls, the whole window stalls. External tools like FileZilla or sshfs run in their own processes, so they stay responsive (and leave Nautilus alone). So:
Nautilus: convenient, but can freeze while the hotspot is busy.
FileZilla / sshfs: a bit more setup, but no freezes.
Thanks. I think I’m going to try the sshfs way. My remote device does not use port 22 for the sftp. What would be the syntax in sshfs to indicate this and what would be the syntax is fstab?
+1 for fstab. You can then access the files as if they were local. SSHFS is very cool, secure too. If you use SSH keys then you won’t be pestered for credentials