Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

In Windows, I am able to create a bookmark in any browser to a file on a network share, like so:

file://network/path/to/file/example.htm

This works well in Windows because it avoids needing a complicated content server to serve up basic pages. The bigger reason is that it's a corporate network and we can't have a web server.

Is there a way this can be done similarly in Linux and OS X? Samba is installed, but how could the URL be formatted to point to the file on the Windows share?

share|improve this question

2 Answers 2

up vote 1 down vote accepted
+100

Windows shares use the SMB protocol for file sharing.

To use such shares in Linux, you must have installed the package sambe-client. To expose such shares from your computer, you need sambe-server.

The syntax for a shared file is smb://computer/sharename/....

Not all browsers allow the SMB protocol in their initial configuration.

For example, the last answer in the thread Firefox smb woes says :

this solution is specific to firefox 3.5 and higher under GNOME.

Step 1: Firefox about:config

network.protocol-handler.expose.smb : false
network.protocol-handler.external.smb : true

Step 2: At the command line:

gconftool-2 -s /desktop/gnome/url-handlers/smb/command '/usr/bin/nautilus %s' --type String
gconftool-2 -s /desktop/gnome/url-handlers/smb/enabled --type Boolean true

Step 3: Run firefox and enter your smb URL into the address bar, eg:

smb://myserver/myfolder

a menu will pop up asking you which application to use. select nautilus, click the "always use" checkbox.

share|improve this answer
    
For OS X, you should be able to ommit step 2 as smb:// is already bound to Finder. –  Jens Erat Oct 25 '11 at 18:03

On OS X, a connected SMB share will be mounted as /Volumes/<share name> (with spaces in the share name being replaced by %20 – see this Apple Support article on SMB share connection). The URL to your file would thus be:

file:///Volumes/share/path/to/file.html

As to Ubuntu, I am no expert, but this Ubuntu Documentation article indicates how to permanently connect to a SMB share, and once you have done that, the file URL should be constructed in a way analogous to the OS X one, starting with the mount point chosen in fstab.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.