File Open Dialog - No Network Drives

More
10 years 9 months ago #69101 by Todd Zuercher
I don't think it will matter which gui you use. This isn't a new or Linuxcnc problem. It is a general Linux problem, problem with how the way most Linux application access the file system. It was much simpler back when Linuxcnc was using Ubuntu as the OS. Ubuntu had a hidden directory where windows (samba) shares were mounted, and you could easily set up a simlink from there to a directory that you could easily access with with the file chooser of your application. Work-arrounds like this don't always work with different versions and some of us less proficient Linux users have been left struggling to figure out how to make the newer Debian based Linuxcnc versions work. So to use Linuxcnc (and most other Linux applications) with your network share, you will need to set up a mounting point for it somewhere. This cifs-utils seems to be one of the simplest ways to do it, But I'm still working out the details of how to make it work smoothly for myself as well.

Please Log in or Create an account to join the conversation.

More
10 years 9 months ago - 10 years 9 months ago #69104 by Todd Zuercher
Ok I think I have it sorted out. Part of what was giving me all sorts of grief was the fact that the network share I was trying to mount had a "space" in one of the directory names.

I found this set of instructions to be quite helpful as well.
wiki.ubuntu.com/MountWindowsSharesPermanently

Anyway, I would open your share that you are trying to access with file browser from there you should be able to copy the path name for it. (should be something like smb://your_windows_share/)
Next you need to create a directory where ever you'd like to mount your network share. (my example will use /home/username/linuxcnc/ngcfiles/network)
Then after you've installed cifs-utils, you can do a test mount to make sure you've gotten it all straight. From a terminal type:
Code:
sudo mount.cifs //your_windows_share/ /home/username/linuxcnc/ngcfiles/network/

This will mount your windows share at that location. Check to see that it is there with a file browser or in Linuxcnc.
Unfortunately this will disappear next time you reboot. To make it perminant you will have to add an entry to the fstab file in /etc/
To do that you must have root privlages, so from a terminal type sudo leafpad /etc/fstab (or use sudo "what ever editor you like"). At the bottom of the fstab file add a new line :
Code:
//your_windows_share/ /home/username/linuxcnc/ngcfiles/network/ cifs guest,uid=1000,iocharset=utf8 0 0

reboot your computer and make sure it works. If your windows share requires certain usernames and passwords you will need to make adjustments to the fstab line.

Oh and about spaces in your path names. The terminal command mount.cifs when a directory has a space or other special character in it put that directory name in double quotes such as //server_name/"dir name"/ but in the fstab file you use \040 to replace a space like this //server_name/dir\040name/
Last edit: 10 years 9 months ago by Todd Zuercher.
The following user(s) said Thank You: HDVideo

Please Log in or Create an account to join the conversation.

More
10 years 9 months ago #69106 by HDVideo
Thanks for that, I'll give it a try. I had read much the same and was working on it. Cifs-Utils installed with no problems, but I couldn't quite get the mount command to work. I think the problem was with my Windows share name.

I appreciate the help.

Please Log in or Create an account to join the conversation.

More
10 years 9 months ago - 10 years 9 months ago #69114 by ArcEye

The files I'm trying to access are on a Windows 7 system attached to my home network through a router. Using the Linux File Manager, I can get to the files without any sort of mount commands. The files/folders are designated "shared" on the Windows system.


Most file dialogs used in programs come from the SDK from that language and populate their file trees simply from detected files using similar to a ls command.

The more advanced file managers, especially those integrated into the system, do all sorts in the background.
They automatically mount your mobile phone through MTP using the /proc system, create a directory and mount inserted USB sticks onto it, automatically mount detected network shares etc etc

The killer for sharing from windoze to Linux, is very often the awful file names, full of spaces, multiple periods, asterisks, brackets or escaped sequences to try to overcome them if accessing in a browser.

In very many Linux programs a space precedes a new argument, a period precedes the extension as far as the parsers are concerned, so they cause problems
Anyone who has tried to download a video ripped by a windoze user, using wget on the commandline will know what I mean. :P

The safest word separation to use in a filename is an underscore _ . Even a dash - has dangers in some circumstances, where it is possible the name could be seen as an instruction to subtract one named variable from another.

As Todd pointed out you can automatically mount at boot if necessary, be aware of course that the networked drive MUST be available at EVERY boot, or you may hit other problems.

A slow boot is one possibility, already the newer kernels will wait for 1 1/2 minutes at boot up if they find an instruction in fstab to mount a drive by UUID which they cannot resolve.

(NB. Most common reason for this problem if you have it, is that the swap partition was reformatted when a new partition install was done and all the other partitions which mount that same swap, now have the wrong UUID in their fstab - bugged the hell out of me until I realised what was happening :laugh: )

regards
Last edit: 10 years 9 months ago by ArcEye.
The following user(s) said Thank You: HDVideo

Please Log in or Create an account to join the conversation.

More
10 years 9 months ago #69118 by HDVideo
Is //windows_share/ in the mount command the full path? for example: D:data/cad_cam/toolpaths/
If for example, the "data" folder and all sub-folders are shared on the Windows system, can I eliminate the sub-folders in the mount command?
Also, are the path and filenames case sensitive?

Thanks for all the help with this issue!

Please Log in or Create an account to join the conversation.

More
10 years 9 months ago #69123 by ArcEye

Is //windows_share/ in the mount command the full path? for example: D:data/cad_cam/toolpaths/
If for example, the "data" folder and all sub-folders are shared on the Windows system, can I eliminate the sub-folders in the mount command?


The path is //server-name/window_share_name.
I don't know what your server name comes up as, but it will be whatever the file manager can access it as
D: is meaningless outside of windoze, both as a designation and because it is local to another computer

If you have access to the root directory and all sub-directories are set to allow sharing, yes you should be able to just specify the root directory and then navigate to others as required, just as you would on a local file system.

Also, are the path and filenames case sensitive?


Always in Linux

I don't know a huge amount about file sharing with windoze on a practical level, because I negate the need for it, by not using windoze, or just transfer files on a USB stick if I cannot avoid it :P

Others may well have practical tips for the easiest methods of connection etc.

regards
The following user(s) said Thank You: HDVideo

Please Log in or Create an account to join the conversation.

Moderators: newbynobi, HansU
Time to create page: 0.095 seconds
Powered by Kunena Forum