Difference between revisions of "Windows Network Share"

From ArchWiki
Jump to: navigation, search
Line 2: Line 2:
 
[[Category:HOWTOs (English)]]
 
[[Category:HOWTOs (English)]]
  
{{stub}}
+
{{merge|Search and explore local network shares|Talk:Access a windows share}}
  
 
== Preparation ==
 
== Preparation ==
Line 61: Line 61:
  
 
   # chown YOURUSER:YOURGROUP /mnt/shares/limette
 
   # chown YOURUSER:YOURGROUP /mnt/shares/limette
 +
 +
== Mounting shares automatically ==
 +
=== Using smbnetfs ===
 +
1. Install smbnetfs
 +
# pacman -S smbnetfs
 +
 +
2. Add the following line to /etc/fuse.conf
 +
user_allow_other
 +
 +
3. Load the FUSE kernel module
 +
# modprobe fuse
 +
 +
4. Start <tt>smbnetfs</tt>
 +
# /etc/rc.d/smbnetfs start
 +
 +
5. All shares in the network are now automatically mounted under /mnt/smbnet
 +
 +
6. To be able to keep using the shares after a reboot, add the following to /etc/rc.conf
 +
MODULES=(... '''fuse''' ...)
 +
DAEMONS=(... '''smbnetfs''' ...)
 +
 +
=== Using AutoFS ===
 +
Alternatively this can be done using [[AutoFS HowTo | AutoFS]]. It seems however to be less stable while mounting SMB shares.
  
 
== Browsing shares with KDE ==
 
== Browsing shares with KDE ==
 +
=== KIO Slave ===
 
You should be able to browse shares with Konqueror using the <tt>remote://</tt> KIO slave.
 
You should be able to browse shares with Konqueror using the <tt>remote://</tt> KIO slave.
  

Revision as of 19:11, 3 April 2008


Merge-arrows-2.pngThis article or section is a candidate for merging with Search and explore local network shares.Merge-arrows-2.png

Notes: Talk:Access a windows share (Discuss in Talk:Windows Network Share#)

Preparation

First of all, you need to have smbclient installed on the Linux machine. Not to forget, there should also be a working TCP/IP network connection between the Linux and the Windows computers.

# pacman -S smbclient

Mounting a share manually

For my example,

  • the Windows machine's name is limette, the share is named 2Share
  • the Linux one is called orange
  • both should be part of the workgroup zitrusgarden.


1. Find or create the mount point, where the share could be mounted to.

# mkdir -p /mnt/shares/limette

2. Mount the share using the smbmount command.

Syntax:

smbmount //server/sharename mountpoint -o workgroup=workgroup username=username ip=serverip
server is the name of the Windows computer.
sharename is the name of the share.
mountpoint is the directory that you are mounting the share to.
-o Options to smbmount.
  workgroup= used to specify the workgroup. As default the workgroup is "WORKGROUP".
  username= used if you need to specify a username to mount the share as, commonly used for Windows NT shares.
  ip= used if the Linux computer can't find the Windows computer by name (dns, wins, hosts entry), serverip is the IP address of the server.

NOTE: in latest samba, you can also use cifsmount which is preferred cause some win2k and win2k3 won't work with smbmount. Also, if you have problems like unreliable samba shares ("too many open files"), cifs is known to solve problems.

# smbmount //limette/Folder2Share /mnt/shares/limette -o workgroup=zitrusgarden username=pink_chick ip=192.168.23.132

NOTE: //limette/Folder2Share/ WILL NOT WORK! (so don't type the trailing / )

3. Use smbumount to quit the share:

# smbumount mountpoint

Adding the share to /etc/fstab for easy mounting

Add the following to /etc/fstab:

 //limette/2Share    /mnt/shares/limette    cifs    noauto,user,noatime,username=guest,password=,workgroup=YOURWORKGROUP 0 0

Now you should be able to mount and unmount your Samba shares with

 # mount /mnt/shares/limette
 # smbumount /mnt/shares/limette

Allowing users to mount Samba shares

For users to be allowed to mount and unmount the Samba share, the following two files have to be set UID like this:

 # chmod u+s /usr/bin/smbmnt
 # chmod u+s /usr/bin/smbumount

If you still get a "permission denied" problem, you might have to change the owner of the mount point to the user that wants to mount the share. I don't know, whether it is the best solution for this problem, but it works for me.

 # chown YOURUSER:YOURGROUP /mnt/shares/limette

Mounting shares automatically

Using smbnetfs

1. Install smbnetfs

# pacman -S smbnetfs

2. Add the following line to /etc/fuse.conf

user_allow_other

3. Load the FUSE kernel module

# modprobe fuse

4. Start smbnetfs

# /etc/rc.d/smbnetfs start

5. All shares in the network are now automatically mounted under /mnt/smbnet

6. To be able to keep using the shares after a reboot, add the following to /etc/rc.conf

MODULES=(... fuse ...)
DAEMONS=(... smbnetfs ...)

Using AutoFS

Alternatively this can be done using AutoFS. It seems however to be less stable while mounting SMB shares.

Browsing shares with KDE

KIO Slave

You should be able to browse shares with Konqueror using the remote:// KIO slave.

RC Script for LISA (KDE LAN Browsing Daemon)

If the above method doesn't work, you can try using the LISA daemon. It comes with the kdenetwork package. To start it on every boot add lisa to the DAEMONS array in /etc/rc.conf.

Topic: http://bbs.archlinux.org/viewtopic.php?t=3231