Home
Home Blogs k4tz's blog
    • Blog
    • Clinic
    • Contact
    • Download
    • Video
    • Login

Poll

Favourite console text editor in Ubuntu:

LXer -- Linux and Open Source News

  • Pink Floyd Turns Tables, Screws the Record Company
  • Cool: Or Hot? Linux really making your coffee, live a linux coffee machine
  • Humanity Icon Theme Updated To Match The New Ubuntu Branding
  • Wolvix linux - A linux distro based on Slackware with a graphic installation mode
  • HP Deskjet D2680 Review
more

Linux Today

  • Turn Firefox into an Ebook Reader with EPUBReader
  • The Microsoft Elephant in the Open Source Room
  • How To Harden PHP5 With Suhosin On CentOS 5.4
  • Seven Firefox Plug-ins That Improve Online Privacy
  • Bash History: Display Date And Time For Each Command
more

Linux Insider

  • North Korea's 'Red Star' Linux, and Is FOSS an Enemy of the State?
  • Android Has Enough Class for Opera
more

Map Windows Shares Permanently on Ubuntu with GVFS

Submitted by k4tz on Mon, 06/29/2009 - 14:10
  • Blog
  • Ubuntu
  • Windows

Source: http://ubuntuforums.org/showthread.php?t=1186877

Concept

The file manager in MS Windows has a nice feature called "Map Network Drive". This allows you to permanently assign Samba shares to a drive letter which any program can access. It can be made persistent across reboots. This feature is tremendous when you have a Samba server on your network that has files you need to continuously access.

Applicable Systems

This guide will explain how to do the same using an up-to-date Ubuntu Intrepid or Jaunty. This guide will not work on Hardy unless this bugfix is backported to Hardy.

Comparison to Other Methods

There is an ages-old method which produces a similar result and involves editing /etc/fstab. I don't like this method for a number of reasons, such as the fact that it's difficult, it involves storing your Samba password in plain text, and it exposes a nasty bug that can cause your system to hang on shutdown.

Procedure

1. Select the "Network" option from the "Places" menu.

2. Select the "Windows Network" icon.

3. Select the workgroup that your share resides in.

4. Select the PC on your network that contains the share you want to access. You will now see an authentication prompt. Enter the correct username and password. IMPORTANT: Make sure to select the radio button that is labled "Remember forever". This will permanently save your password in the GNOME keyring.

6. Select the "Connect" option. You will now see a folder for each share that is available on the selected PC.

8. Select the folder you want to access. You will now see a prompt regarding the keyring. Select the "Always Allow" option. The share is now temporarily mounted (will not survive a reboot) and your password is permanently saved and accessible in the GNOME keyring.

9. The share should be visible in the "Places" menu on the left of the Nautilus file manager. Select the eject icon to the right of the share to unmount it.

10. Now we will test out a command which will go into a script. Open the Terminal from the "Accessories" submenu in the "Applications" menu.

11. Run this command in the Terminal while filling in the appropriate information within the <> symbols.

Code:
gvfs-mount smb://<pcname>/<sharename>

Example:

Code:
gvfs-mount smb://desktop/sharedfolder

The share should now be mounted again and will appear in the "Places" menu on the left side of the Nautilus file manager. Select the eject icon to the right of the share to unmount it.

12. Now we will put that command in a script to be executed during startup. In the Terminal, run this command to create the script:

Code:
gedit ~/sharemount.sh

If you'd like to change the path or the filename of the script, feel free to do so.

13. Paste this into the GEdit window while filling in the appropriate information into the <> symbols.

Code:
#!/bin/sh
gvfs-mount smb://<pcname>/<sharename>

Example:

Code:
#!/bin/sh
gvfs-mount smb://desktop/sharedfolder

14. Make the script executable by running this command in the Terminal:

Code:
chmod +x ~/sharemount.sh

15. Now let's add the script to GNOME startup. Choose the "Startup Applications" option from the "Preferences" submenu located in the "System" menu.

16. Select the "Add" option. Type a name of your choice in the "Name" field, browse to the path of the script in the "Command" field, and optionally add a comment to the "Comment" field. Press the "Add" button to save your settings.

17. Now log out and log back in or restart your PC. Check the "Places" menu and the shares should be automatically mounted.

Usage Notes

The shares are mounted using GVFS. From the GNOME GUI, shares are accessible via the "Places" menu in Nautilus and the smb:// path in the address bar. Command-line programs can access these shares via the ~/.gvfs path.

Uninstallation

If you'd like to remove these changes, follow the these two simple steps:

1. Choose the "Startup Applications" option from the "Preferences" submenu located in the "System" menu. Select the sharemount.sh script and press the "Remove" button.

2. Delete the script with the Terminal:

Code:
rm ~/sharemount.sh
  • k4tz's blog
  • Add new comment

Recent blog posts

  • Configure ThinkPad laptop trackpoint on Ubuntu
  • How to make WPA connection in Ubuntu on demand
  • Review: Sabily 9.10 - Linux Ubuntu for Muslims
  • How to Install 64bit flash on Ubuntu
  • How to get Wireless LAN (Broadcom) on Acer Aspire 4720Z working with Ubuntu 9.10
  • Quick loot at Ubuntu 10.04 Lucid Lynx Alpha 3
  • System testing and benchmarking under Ubuntu 9.10
  • How to PXE booting Ubuntu Installer
  • How to Install Debian onto your Nexus One using Ubuntu
  • (Re) Install a Linux Kernel
more

Linux World

  • Microsoft's Internet Driving Licence: stupid, unworkable and unenforceable
  • Making a videoloop with Kino and Audacity
  • So is ChromeOS a desktop winner? I think not
  • Firefogg: Transcoding videos to open web standards with Mozilla Firefox
  • The Morevna Project: Anime with Synfig and Blender
Archive Syndicate content

Recent comments

  • Re
    10 weeks 3 hours ago
  • Re
    10 weeks 5 hours ago
  • Re
    10 weeks 6 days ago
  • Re
    11 weeks 3 days ago
  • Re
    12 weeks 1 day ago
  • Re
    12 weeks 1 day ago
  • Re
    12 weeks 2 days ago
  • iwl3945
    13 weeks 6 days ago
  • HomeBank
    26 weeks 1 day ago
  • KMyMoney and direct connect to banks
    30 weeks 2 days ago
All contents copyright © 2008, Dhuha Net. All rights reserved
Ubuntudoctor® is a member of the Dhuha Network. Privacy Policy
RoopleTheme