You are not logged in.

#1 2009-03-27 16:55:57

Nazgulled
Member
Registered: 2009-03-08
Posts: 102

How to access Windows shares on Arch?

I would like to access my Windows Vista shares (on the same network) as any other folder in Arch. For instance, I have the "Public" folder shared on Windows and I was able to access this folder in Nautilus by navigating to smb://nazbtm/Public. This worked and pointed to the correct folder...

But I don't know how to navigate to that folder in a terminal (which I need).

How can I mount the "Public" shared folder to /home/nazgulled/public, for instance? And do it with every boot of course...

Offline

#2 2009-03-27 17:28:15

evr
Arch Linux f@h Team Member
Registered: 2009-01-23
Posts: 554

Re: How to access Windows shares on Arch?

Nazgulled wrote:

How can I mount the "Public" shared folder to /home/nazgulled/public, for instance? And do it with every boot of course...

have you checked out the "adding a share to fstab" section in the samba wiki http://wiki.archlinux.org/index.php/Sam … e_to_fstab?  It should explain to you what you need.

Offline

#3 2009-03-27 18:36:33

Nazgulled
Member
Registered: 2009-03-08
Posts: 102

Re: How to access Windows shares on Arch?

Well, I've read that wiki page but haven't tried to play with fstab yet... I mean, I tried the mount.cifs command as root and it didn't work and I supposed the fstab wouldn't work either... I'll have to try again.

One question though... Do I need to have Samba installed on Arch just to navigate shared folders on Windows? I don't have it installed as I believe Samba is only needed if I want to share files in Arch, which I don't, I just want to access other shared files.

Offline

#4 2009-03-27 19:33:50

Nazgulled
Member
Registered: 2009-03-08
Posts: 102

Re: How to access Windows shares on Arch?

Just tried it again and it doesn't work:

root ~ # mount.cifs //vmhost/public /home/nazgulled/test -o user=Nazgulled,password=*****
mount error(5): Input/output error

Another thing is that when I open "Network » Windows Shares" it doesn't show anything, but a few hours ago it was showing the computer in the network... hmm

Last edited by Nazgulled (2009-03-27 19:34:41)

Offline

#5 2009-03-27 20:25:59

quarkup
Member
From: Portugal
Registered: 2008-09-07
Posts: 497
Website

Re: How to access Windows shares on Arch?

have you installed samba ?


If people do not believe that mathematics is simple, it is only because they do not realize how complicated life is.
Simplicity is the ultimate sophistication.

Offline

#6 2009-03-27 21:04:47

Nazgulled
Member
Registered: 2009-03-08
Posts: 102

Re: How to access Windows shares on Arch?

No...

Nazgulled wrote:

One question though... Do I need to have Samba installed on Arch just to navigate shared folders on Windows? I don't have it installed as I believe Samba is only needed if I want to share files in Arch, which I don't, I just want to access other shared files.

Is it needed then?

Offline

#7 2009-03-28 10:16:46

quarkup
Member
From: Portugal
Registered: 2008-09-07
Posts: 497
Website

Re: How to access Windows shares on Arch?

looking on AUR for samba (and the pacmans repo's)

~$ yaourt -Ss samba
extra/gnome-vfs 2.24.0-2             
     The GNOME Virtual File System   
extra/samba 3.3.1-1 [installed]
     Tools to access a server's filespace and printers via SMB
extra/smb4k 0.10.2-1 [installed]                             
     A KDE program that browses samba shares.                 
extra/xsmbrowser 3.4.0-2
     xSMBrowser is a Gui over the Samba utilities that allows users to easily
     browse Microsoft networks.
community/g2sc 0.2-2
     Samba gtk2 client

So I guess it is needed. It is the package which offers the share protocols for samba.

Last edited by quarkup (2009-03-28 10:18:42)


If people do not believe that mathematics is simple, it is only because they do not realize how complicated life is.
Simplicity is the ultimate sophistication.

Offline

#8 2009-03-28 13:53:06

Nazgulled
Member
Registered: 2009-03-08
Posts: 102

Re: How to access Windows shares on Arch?

Installed Samba but it still doesn't work... when I run the mount.cifs command, it doesn't output the error as above but it doesn't output anything at all, it doesn't even finish executing the command because I have to press Ctrl+C to get back to the command line...

Just tried with fstab too and when I execute the command to mount the entries on fstab, it happens the same as above, it doesn't finish the command and I have to press Ctrl+C.

Last edited by Nazgulled (2009-03-28 13:57:48)

Offline

#9 2009-03-28 13:58:04

Zeist
Arch Linux f@h Team Member
Registered: 2008-07-04
Posts: 532

Re: How to access Windows shares on Arch?

does smbclient -L (hostname) or smbclient -L (IP) say anything interesting?


I haven't lost my mind; I have a tape back-up somewhere.
Twitter

Offline

#10 2009-03-28 14:55:24

Hrod beraht
Member
Registered: 2008-09-30
Posts: 186

Re: How to access Windows shares on Arch?

You don't need samba to access a Windows share, you just need smbclient (pacman -S smbclient)

Then, to mount, as root, specify the type of mount (-t) and the address of what you're mounting, and to where:

mount -t cifs //nazbtm/Public /home/nazgulled/public

Note: this above assumes that the IP address of nazbtm is specified in your /etc/hosts file. If not, use the actual IP, as in:

mount -t cifs //192.168.1.xxx/Public /home/nazgulled/public

Two other options you may need. If you need to log on to //nazbtm/Public as a specific user, say joe, then you need to pass this option (-o for options). And, if you want the mounted folder to be owned by a particular user ID, say nazgulled, you can pass this option as well.

mount -t cifs //nazbtm/Public /home/nazgulled/public -o user=joe,uid=nazgulled

Bob

Offline

#11 2009-03-28 21:55:26

Nazgulled
Member
Registered: 2009-03-08
Posts: 102

Re: How to access Windows shares on Arch?

I was able to mount it like that using the IP address, but not a hostname and I have the appropriate (I think) entry in the fstab file:
192.168.1.100 VMHOST.localdomain VMHOST

This works:
mount -t cifs //192.168.1.100/Public /home/nazgulled/public

This doesn't:
mount -t cifs //vmhost/Public /home/nazgulled/public

I get this error again: mount error(5): Input/output error

Any reason why?

Offline

#12 2009-03-28 22:32:08

Hrod beraht
Member
Registered: 2008-09-30
Posts: 186

Re: How to access Windows shares on Arch?

Nazgulled wrote:

This works:
mount -t cifs //192.168.1.100/Public /home/nazgulled/public

This doesn't:
mount -t cifs //vmhost/Public /home/nazgulled/public

To use the vmhost name instead of the IP address, make sure your /etc/hosts file contains the following line: (assuming the IP address is static. if it changes at every boot with DHCP, then this obviously ain't gonna work too well tongue )

192.168.1.100 vmhost

And you mentioned that you would like to have this mounted at every boot, so instead of having to manually do a mount -t cifs //blah, blah blah every time, simply throw this in your fstab.

//192.168.1.100/Public /home/nazgulled/public cifs user=whatever,password=whatever,uid=whatever,users 0 0

And if you don't want to put your user and password in the fstab where others on the same computer can see them, use a reference to a credentials file:

//192.168.1.100/Public /home/nazgulled/public cifs credentials=/home/nazgulled/.smbcredentials,uid=whatever,users 0 0

Then, in the /home/nazgulled/.smbcredentials file have:

user=whatever
password=whatever

And if your home directory is mod 700, other people using the same computer won't be able to read your password file, but fstab during boot will.

And, a third option, and the way I do it since I don't necessarily want everything mounted at every boot is to mount only when you want, but without needing to type a long mount command, change the fstab line to:

//192.168.1.100/Public /home/nazgulled/public cifs credentials=/home/nazgulled/.smbcredentials,uid=whatever,user,noauto 0 0

Note the user (without the s) and the noauto, which means it won't automatically mount at boot, but has the information ready so that later, if you execute the command mount /home/nazgulled/public it will mount (without needing to be root). (Make sure you chown and chgrp that directory to you).

Hope that helps smile

Bob

Last edited by Hrod beraht (2009-03-28 22:34:07)

Offline

#13 2009-03-28 22:54:59

Nazgulled
Member
Registered: 2009-03-08
Posts: 102

Re: How to access Windows shares on Arch?

Nazgulled wrote:

I was able to mount it like that using the IP address, but not a hostname and I have the appropriate (I think) entry in the fstab file:
192.168.1.100 VMHOST.localdomain VMHOST

Why doesn't this work?

Isn't the same thing as you suggested?

Offline

#14 2009-03-30 12:21:19

stryder
Member
Registered: 2009-02-28
Posts: 500

Re: How to access Windows shares on Arch?

It's got to be in /etc/hosts, not /etc/fstab

Offline

#15 2009-03-30 15:56:34

Nazgulled
Member
Registered: 2009-03-08
Posts: 102

Re: How to access Windows shares on Arch?

I know that lol, it's in /etc/hosts, I'm sure of that.

I mistyped... tongue

Offline

#16 2009-04-01 19:07:32

Nazgulled
Member
Registered: 2009-03-08
Posts: 102

Re: How to access Windows shares on Arch?

I'm having a few problems with this and I'm going to enumerate them:

1) Still, why can't I use "vmhost" if I have it specified in the /etc/hosts file (check above)?

2) I have created my final command to mount the directory I want and it's working with the "mount" command but not with fstab.

mount command (works):

mount -t cifs //192.168.1.100/C$/Users/Nazgulled/Documents/University/\[Documents\]\Repository /media/repository -o credentials=/home/nazgulled/.smbcredentials,uid=1000,gid=1000,dir_mode=0755,file_mode=0655

fstab entry (does not work)

//192.168.1.100/C$/Users/Nazgulled/Documents/University/\[Documents\]\Repository /media/repository cifs credentials=/home/nazgulled/.smbcredentials,uid=1000,gid=1000,dir_mode=0755,file_mode=0655,defaults 0 0

Why it doesn't work? Well, when I "ls -l /media" I get the following:

drwxr-xr-x 2 root      root      4096 2009-01-11 14:32 cd
drwxrwxrwx 1 nazgulled nazgulled 4096 2009-04-01 20:03 public
d????????? ? ?         ?            ?                ? repository
dr-xr-xr-x 1 nazgulled nazgulled 4096 2009-04-01 19:35 university

Why? How do I fix this?

3) As you can see above, my file_mode is 0655, this allows me to have exectuable files in the shared folder. However, like this, ALL OF THEM are exectuable at mount and I don't want that. I want, by default, all files to have 0644 and only some to have the +x permission. If I set 0644 instead of 0655, for instance, when I use gcc to compile C code, it creates an a.out file, which should have the +x permission but it doesn't, because of the 0644 permissions, but if I change it to 0655, all of them will have +x.

Is there anyway to avoid this?

Offline

Board footer

Powered by FluxBB