How to share drives and folder between linux and windows?

i want share the home folder on my laptop i’m using arch linux, to my windows pc and a drive back to linux. basically on my windows machine i have set up one of my drive to share on network for backup other windows machines can see that drive, but my laptop can’t. i want to share that drive to my laptop also and, i want my linux home folder to be shown on my windows pc also. i tried setting up samba i can the shared home folder on my laptop but can’t see it on windows machine.

my smb.conf(hosts allow = my local wifi ip)

my laptop(showing shared home folder)

my windows machine(doesn’t show any shared folder)

From memory, Windows used to have to be in a Workgroup for smb shares to work.

from experience, after disabling smb1 (due to severe security issues) SMB on windows is broken. it works great until SMBv1 is disabled , which MS disabled by default with recent versions of win10. i had to setup a ftp server to be able to share files reliably at work. windows explorer can map a drive to a ftp server.
the problem i ran into was that you could see a computer, connect to it and list files. you might even be able to transfer a file or 2, then the share would simply disappear. alot of complaints on the internet about that.

This is incorrect.

@apoorv569 Make sure you are restarting samba after making changes to the conf file. Also, on both sides try mapping the shares manually by ip adresses.

1 Like

Can you manually map the share?

no luck it says windows cannot access that ip. btw can u tell me exactly what should i type in the folder location?

this is the error i ran into. windows would let me map the drive by ip, then when i try to connect , it would sometimes connect, sometimes not. sometimes when it did connect, it could list files but when you try to transfer one, it would disappear.
thus i resorted to a ftp server/client setup; i used filezilla products.
you might try filezilla, or perhaps a NFS server.

enabling SMBv1 solved all the issues, but comes with the associated (not worth it) risks.

can u tell or give me a link where i can find how to setup ftp or nfs.

If windows cannot reach the ip, try pinging it. Open cmd.exe, type ping then the IP, then hit enter.

To manually map via ip, use \\\sharename

do win + R and try to browse the IP

EX: \\

also what is the output of testparm on the linux machine?

its pinging fine in windows. but cant map ip. i tried connecting to windows ip through my linux machine it connected showed the shared drive but i could not open it

I tried mapping manually didn’t help can’t browse either.

testparm output

Lets get rid of hosts allow for now. Also lets remove valid users because you’re specifying guest is ok but then telling it no only allow logins from this user.

then lets browse to the IP of the linux machine from windows again, no manual mapping just \\192.168.ip.add dont try to use DNS, just so we’re on the same page here.

I have an ubuntu server that I know my config works on.

My known working config
        dns proxy = No
        log file = /var/log/samba/log.%m
        map to guest = Bad User
        max log size = 1000
        obey pam restrictions = Yes
        pam password change = Yes
        panic action = /usr/share/samba/panic-action %d
        passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
        passwd program = /usr/bin/passwd %u
        server role = standalone server
        server string = %h server (Samba, Ubuntu)
        syslog = 0
        unix password sync = Yes
        usershare allow guests = Yes
        idmap config * : backend = tdb

        comment = shit
        guest ok = Yes
        path = /home/adubs/music/
        read only = No

        comment = fuck
        guest ok = Yes
        path = /home/adubs/
        read only = No

theres an error in your smb.conf
under home-share the path should have a trailing /

path = /home/apporv/

will this stop the linux machine from connecting to a windows machine? no. but it will stop the windows machine from connection to the linux machine.
my spacing is being “corrected” by the board…

i just noticed the output that testparm gives is not what is in my smb.conf you can check the first screenshot on the post for my real smb.conf

testparm isnt to show your config, its to test it.

ok but according to my config i did not allow guests neither wanted to.

then you need to be explicit with guests ok = no?

lets focus on getting access first and then we can be more restrictive.

1 Like

but how i can change something that is not there ? :thinking::sweat:

What I told you to remove is there. If you don’t want my help then just say so. I’ll leave you to it.