# why i cant dislay samba in Nautilus?

## figo

hi all:

i have emerge the samba and gnome-vfs using "samba" USE flag, and i can mount windows share directory by using:

```
mount -t smbfs -o username=nobody,passwd=  //192.168.0.48/d  /mnt/sd

```

but, when i using nautilus to smb://192.168.0.48,

it say:

```
 Nautilus canot display smb?
```

why ?

----------

## Kaste

Hmm Why do you need to access the share this way if you mount it already?

Do you want to access it without mounting or why don`t you just go to /mnt/sd

If you still need to fix it check if gvfs has the samba use flag set. That should do it.

----------

## figo

yes, i have add "samba" to USE flag and recompile the gnome-vfs, but the problem is still, so i donot know why?

should i recompile the GNOME?

----------

## figo

who know how to slove this problem? thank you!

----------

## zvn

recompile the gnome-base/gvfs with USE flag "samba"

----------

## kimmie

Compiling gvfs with USE=samba and USE=fuse fixed this for me

EDIT: actually, I tried recompiling again, WITHOUT USE=fuse, it still works. So it must just have been the recompile by itself.

----------

## szczerb

Also note that if you mount everything in /media instead of /mnt gnome will be aware of this and will show you a nice icon for each of this mountpoints. Just as if it automounted it.

----------

## tenorism

 *kimmie wrote:*   

> Compiling gvfs with USE=samba and USE=fuse fixed this for me
> 
> 

 

Works for me too. After recompiling, the panel icons for mount disks suddenly showed up. And now when opening Places->Network, immediately shows my samba server.

I forgot to mention that I enabled FUSE support as a module in the kernel (2.8.28-r2):

File systems--->

                       <M> FUSE (Filesystem in Userspace) support

----------

## rjtupas

I did as above and got Nautilus to display samba shares on other Windows computers. After a reboot, Nautilus no longer sees samba shares. The "Connect to Server" window no longer lists "window shares" as an option. Nautilus File Manager complains that it cannot open smb shares. What is more strange, smclient on a terminal works fine.

Just for clarity, my /etc/portage/package.use file:

```

## For samba support in Nautilus

gnome-base/gnome-vfs samba

gnome-base/gvfs samba

net-fs/samba -server

net-fs/samba-libs caps syslog

net-fs/samba-client caps syslog
```

and my /etc/portage/package.keyword file:

```

## To support Window network shares

## without merging all of samba

net-fs/samba

  net-fs/samba-libs

  net-fs/samba-client

    dev-libs/iniparser

    virtual/talloc

    virtual/tdb

```

UPDATE: I discovered that the latest update to samba, version 3.4.2, caused the problem. Downgrading to 3.3.8 and rebuilding gnome-vfs and gvfs fixed the problem.

TIA,

Randy

----------

## sunliu

 *zvn wrote:*   

> recompile the gnome-base/gvfs with USE flag "samba"

 

How to recompile gnome-base/gvfs with USE flag?

----------

## sunliu

 *sunliu wrote:*   

>  *zvn wrote:*   recompile the gnome-base/gvfs with USE flag "samba" 
> 
> How to recompile gnome-base/gvfs with USE flag?

 

Fixed finally by following :

USE="samba" emerge gnome-base/gvfs

----------

## alamahant

Hi

I think the correct nautilus invocation would be

```

smb://192.168.0.48/d

```

----------

## Tony0945

That's only a temporary fix. Applying USE flags on the command line is not permanent. You have to add a line in /etc/portage/package.use to ensure that the flag is permanent. Or /etc/portage/package.use/<any name> if package.use is a directory.

----------

## sunliu

 *Tony0945 wrote:*   

> That's only a temporary fix. Applying USE flags on the command line is not permanent. You have to add a line in /etc/portage/package.use to ensure that the flag is permanent. Or /etc/portage/package.use/<any name> if package.use is a directory.

 

If the following command on package.use directory correct?

echo "gnome-base/gvfs samba" >> /etc/portage/package.use/gvfs

----------

## Tony0945

 *sunliu wrote:*   

> If the following command on package.use directory correct?
> 
> echo "gnome-base/gvfs samba" >> /etc/portage/package.use/gvfs

 

If /etc/portage/package.use is a directory, yes. I prefer to use nano (others use vim). I have an unfortunate tendency to make typos and dropping one '>' will wipe out a file.  

if you have a file that contains  gnome-base/gvfs and it is higher in lexographic order than gvfs then your command would do nothing.

If I am forced to use directries instead of files, such as using crossdev, I use /etc/portage/package.use/package.use .

Lately I have been using a script "/usr/local/bin/edituse" to keep this straight. It also checks if the user is root and uses "sudo nano ..." if the user is not. I don't know how many times I've edited  a setup file then hone to save and found that I can't because I'm not root.

----------

## Hu

 *Tony0945 wrote:*   

> I have an unfortunate tendency to make typos and dropping one '>' will wipe out a file.  

 You may like the bash option noclobber:

```
   If the redirection operator is '>', and the 'noclobber' option to the

'set' builtin has been enabled, the redirection will fail if the file

whose name results from the expansion of WORD exists and is a regular

file.  If the redirection operator is '>|', or the redirection operator

is '>' and the 'noclobber' option is not enabled, the redirection is

attempted even if the file named by WORD exists.
```

This allows you to use > when it will not destroy a file, but requires use of >| when you intend to truncate and replace a file.

----------

## Ant P.

Or more succinctly: put "set -C" in a file in /etc/bash/bashrc.d/. I do that myself and it's saved me a few times.

----------

## sunliu

 *Tony0945 wrote:*   

>  *sunliu wrote:*   If the following command on package.use directory correct?
> 
> echo "gnome-base/gvfs samba" >> /etc/portage/package.use/gvfs 
> 
> If /etc/portage/package.use is a directory, yes. I prefer to use nano (others use vim). I have an unfortunate tendency to make typos and dropping one '>' will wipe out a file.  
> ...

 

Thanks for sharing, interesting on using /etc/portage/package.use/package.use

I'm studying how it works.

----------

## Tony0945

```
 ~ # cat /usr/local/bin/edituse

#! /bin/bash

FNAME="/etc/portage/package.use"

if [ "${USER}" = "tony" ]

 then sudo nano "${FNAME}"

else nano "${FNAME}"

fi

```

Quick and dirty. I'm in the sudoers file as allowed to sudo without password. If I'm already root, just do it.

If I rearrange to use directories, I'll just edit the one line.

similarly for "editmask", "editunmask", and "editkeyw"

The shorter command makes fever typos. I usually mangle "package" like "pacakge"

That's another reason to not use > or >> They will create a new mis-spelled  name.

EDIT:

Hu & Ant p. Thanks for those tips. I'm sure they will save me much grief.

----------

## Hu

I rarely misspell package because I rarely type it.  Tab completion helps tremendously for both speed and accuracy.  

```
vim /et^I

vim /etc/

vim /etc/po^I

vim /etc/portage/

vim /etc/portage/pac^I

vim /etc/portage/package.

vim /etc/portage/package.a^I

vim /etc/portage/package.accept_keywords
```

Or, written another way:

```
vim /et^Ipo^Ipac^Ia^I^M
```

----------

## sunliu

 *Tony0945 wrote:*   

> 
> 
> ```
>  ~ # cat /usr/local/bin/edituse
> 
> ...

 

Thanks for guiding me in the correct way!

----------

## sunliu

 *Hu wrote:*   

> I rarely misspell package because I rarely type it.  Tab completion helps tremendously for both speed and accuracy.  
> 
> ```
> vim /et^I
> 
> ...

 

Yes, that is always a good feature.

----------

## Tony0945

 *sunliu wrote:*   

> Thanks for guiding me in the correct way!

 

I'm very ignorant about shell programming but I found that the Gentoo tree has ebuilds for "shellcheck" and "shellcheck-bin". I think shellcheck needs ruby to build and a lot of other dependencies so I emerge shellcheck-bin. It hardly needs speed optimization. 

Shellcheck checks your syntax and points out errors and makes suggestions "did you mean ..." It gives error codes and there is a webpage that amplifies the meaning of the error code often with examples. It's a godsend.

I just discovered this program last year.

EDIT:

I used to use vi on Unix. Thirty years back now. I've been using nano so long that I have quite forgotten how to use vi.

----------

