Not able to share folders

I’m running Opensuse Tumbelweed on a host and 12.1 (XFCE) on a virtualbox. I’m trying to get into networking more so I can learn what’s going on. Right now I have both machines visible and they can see each other on the network. I can also see each user/home folder for the user, but when I try to login to either it asks for a username or password. No matter what I enter it won’t let me access the home folder for the host or the guest. I’ve already gone through yast’s samba tool and setup folder sharing and made sure guest login was enabled. What else am I missing?

Also, just a quick question. What’s the command to restart the samba service from the command line?

Restart with (as root):

service nmb restart; service smb restart

To access the shares, add the username to the samba user database see here: Samba LAN Primer
Also, enabling guest access in Yast (IIRC) is only the start of the process.

If you have further issues after reading the reference, post here the contents of the file smb.conf (in /etc/samba/) plus the response you get from this command:

su -c "ls -l /var/lib/samba/usershares"

I’m a little bit further now, but at a road block. The result of

su -c "ls -l /var/lib/samba/usershares"

on both the client and the host say “Total 0.”

It’s to the point now where I can see and browse for the files on the host computer, but when the host tries to even open the virtual machine it can’t seem to find it on the network. For troubleshooting I have both firewalls turned off.

Here is the smb.conf for the host:


dave@linux-g6ar:~> cat /etc/samba/smb.conf
# smb.conf is the main Samba configuration file. You find a full commented
# version at /usr/share/doc/packages/samba/examples/smb.conf.SUSE if the
# samba-doc package is installed.
# Date: 2011-11-02
[global]
        workgroup = WORKGROUP
#       name resolve order = bcast host lmhosts wins
        passdb backend = tdbsam
        printing = cups
        printcap name = cups
        printcap cache time = 750
        cups options = raw
        map to guest = Bad User
        include = /etc/samba/dhcp.conf
        logon path = \\%L\profiles\.msprofile
        logon home = \\%L\%U\.9xprofile
        logon drive = P:
        usershare allow guests = Yes
        add machine script = /usr/sbin/useradd  -c Machine -d /var/lib/nobody -s /bin/false %m$
        domain logons = No
        domain master = No
        security = user
        usershare max shares = 100
        wins support = No
        wins server = 
[homes]
        comment = Home Directories
        valid users = %S, %D%w%S
        browseable = No
        read only = No
        inherit acls = Yes
[profiles]
        comment = Network Profiles Service
        path = %H
        read only = No
        store dos attributes = Yes
        create mask = 0600                                                                                                
        directory mask = 0700                                                                                             
[users]                                                                                                                   
        comment = All users                                                                                               
        path = /home                                                                                                      
        read only = No                                                                                                    
        inherit acls = Yes                                                                                                
        veto files = /aquota.user/groups/shares/
[groups]
        comment = All groups
        path = /home/groups
        read only = No
        inherit acls = Yes
[printers]
        comment = All Printers
        path = /var/tmp
        printable = Yes
        create mask = 0600
        browseable = No
[print$]
        comment = Printer Drivers
        path = /var/lib/samba/drivers
        write list = @ntadmin root
        force group = ntadmin
        create mask = 0664
        directory mask = 0775

## Share disabled by YaST
# [netlogon]

[Dave Home]
        comment = 
        inherit acls = Yes
        path = /home/dave
        read only = No
dave@linux-g6ar:~> 

and here it is for the virtuabox client


dave@linux-xng5:~> cat /etc/samba/smb.conf 
# smb.conf is the main Samba configuration file. You find a full commented
# version at /usr/share/doc/packages/samba/examples/smb.conf.SUSE if the
# samba-doc package is installed.
# Date: 2011-11-02
[global]
	workgroup = WORKGROUP
	passdb backend = tdbsam
	printing = cups
	printcap name = cups
	printcap cache time = 750
	cups options = raw
	map to guest = Bad User
	include = /etc/samba/dhcp.conf
	logon path = \\%L\profiles\.msprofile
	logon home = \\%L\%U\.9xprofile
	logon drive = P:
	usershare allow guests = Yes
	add machine script = /usr/sbin/useradd  -c Machine -d /var/lib/nobody -s /bin/false %m$
	domain logons = No
	domain master = No
	security = user
	usershare max shares = 100
	wins support = No
[homes]
	comment = Home Directories
	valid users = %S, %D%w%S
	browseable = Yes
	read only = No
	inherit acls = Yes
[profiles]
	comment = Network Profiles Service
	path = %H
	read only = No
	store dos attributes = Yes
	create mask = 0600
	directory mask = 0700
[users]
	comment = All users
	path = /home
	read only = No
	inherit acls = Yes
	veto files = /aquota.user/groups/shares/
[groups]
	comment = All groups
	path = /home/groups
	read only = No
	inherit acls = Yes
[printers]
	comment = All Printers
	path = /var/tmp
	printable = Yes
	create mask = 0600
	browseable = No
[print$]
	comment = Printer Drivers
	path = /var/lib/samba/drivers
	write list = @ntadmin root
	force group = ntadmin
	create mask = 0664
	directory mask = 0775

## Share disabled by YaST
# [netlogon]

[XFCE Home]
	comment = 
	inherit acls = Yes
	path = /home/dave
	read only = No
dave@linux-xng5:~> 

I tried adding “name resolve order = bcast host lmhosts wins” to both configs, but when I did that and restarted samba none of the machines were visible to each other. So I commented that line out.

By the way, thanks for that link. It’s helping me understand this all a bit better.

I have set my virtual machines to have bridged networking so I can run them as a full member of the LAN, with the same subnet (like 192.168.1.2, 192.168.1.3,4,5… etc). Do you use that method too?

PS what do you get from command /sbin/ifconfig on both?

ifconfig on the host is:


dave@linux-g6ar:~> /sbin/ifconfig
eth0      Link encap:Ethernet  HWaddr F0:BF:97:E0:54:78  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
          Interrupt:51 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:136 errors:0 dropped:0 overruns:0 frame:0
          TX packets:136 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:10816 (10.5 Kb)  TX bytes:10816 (10.5 Kb)

wlan0     Link encap:Ethernet  HWaddr 74:E5:0B:64:CF:30  
          inet addr:192.168.182.104  Bcast:192.168.183.255  Mask:255.255.254.0
          inet6 addr: fe80::76e5:bff:fe64:cf30/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:846 errors:0 dropped:0 overruns:0 frame:0
          TX packets:698 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:347425 (339.2 Kb)  TX bytes:144978 (141.5 Kb)

dave@linux-g6ar:~> 

ifconfig on the virtual machine is:


dave@linux-xng5:~> /sbin/ifconfig
eth0      Link encap:Ethernet  HWaddr 08:00:27:28:59:82  
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe28:5982/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:81 errors:0 dropped:0 overruns:0 frame:0
          TX packets:115 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:32953 (32.1 Kb)  TX bytes:14393 (14.0 Kb)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:46 errors:0 dropped:0 overruns:0 frame:0
          TX packets:46 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:5543 (5.4 Kb)  TX bytes:5543 (5.4 Kb)

dave@linux-xng5:~> 

I don’t have them bridged because I’m on a public college/dorm network, so I don’t have full access to any of the settings or hardware.

On the host (KDE opensuse tumbleweed) I tried using the smb://IP-of-virtualbox and I couldn’t get anywhere. With the reverse, using the virtual machine and trying to connect to the host I was successful. I don’t know if this provides any clues.

If you bridge the eth0 of the guest vbox, won’t it line up ok with an address like the address of the wlan on the host, and then samba will work (maybe)? Internet should work too because it will see the college router.
Or you can give the guest a fixed IP address like 192.168.182.250 or 192.168.182.13 (well away from the gift of the DHCP server in the router).

Or you can maybe use the private option called “internal network” (never tried that myself).

It can’t cross subnets