map ubuntu shared folder in windows 7

3

I have a virtual machine running ubuntu and I am trying to host some files on ubuntu and map the drive in windows PC.

Following the steps here, I am able to see (from windows) the "work" folder after typing in \ubuntu_ip. But when trying to access or map it with "svc_acct" from windows, I get "0x80070043 error the network name cannot be found". I guess I am not accessing correctly from windows.

SAMBA config below (svc_acct is an account set up under linux). When accessing the folder from windows, I get prompted for username/password. Not sure what credential to type in exactly.

samba config:
[work]
path = /home/svc_acct/work
valid users = svc_acct
available = yes
read only = no
browsable = yes
public = yes
writable = yes
force user = svc_acct
create mask = 0777
directory mask = 0777

UPDATE:

All I did to resolve this is by changing samba config's path from path = /home/svc_acct/work to path = /home/svc_acct following this post (last sentence). Then no more prompt for password in windows when I try to click into the folder. Thanks to @sancho.s for suggesting the link.

windows-7
networking
ubuntu
samba
asked on Super User Dec 9, 2018 by iwbabn • edited Dec 22, 2018 by iwbabn

2 Answers

1

You have to match the smb.conf and the Windows share. One option is not limiting who can access the share in Windows with valid users, see e.g. this.

Another option I can think of is you are not setting up the Windows share correctly, as described e.g. in the link above. Note the possibly useful %S macro (official docs here).

You may need to restart the service (I guess you already did it).

You might describe with more detail exactly what you are doing. It is not clear under which conditions you get "0x80070043 error the network name cannot be found" or you get prompted for username/password. Screenshots may help as well.

Against the lack of further information, I am adding a few possible useful links.

The accepted solution in a related question (for VirtualBox, but most/all would apply here). The other answers may help.

how to access samba on a guest Linux behind the VirtualBox NAT?

Share VirtualBox folders in reverse? Guest-Host?

https://serverfault.com/questions/15858/accessing-shared-folders-from-ubuntu-guest-os-in-vmware-workstation-ace-editio

https://www.virtualbox.org/wiki/Sharing_files_on_OSE

0

Try to access the Samba share via the IP address of the Ubuntu VM. If this works, as it should work, you can use one of the following:

  • Give the VM a static IP address and add it to the hosts file (if that's not too low-tech as solution)

  • Enable Netbios in /etc/samba/smb.conf, by after the WORKGROUP line adding netbios name = Your-PC-name, then restart samba by sudo service smbd restart.

  • In the /etc/samba/smb.conf file, look for a name resolve order line:

    ;   name resolve order = lmhosts host wins bcast
    

    Uncomment the line and make sure that bcast is the first in the list, then restart Samba.

You might need in Windows to flush the DNS and reboot:

ipconfig /flushdns
ipconfig /registerdns
answered on Super User Dec 21, 2018 by harrymc

User contributions licensed under CC BY-SA 3.0