Header Shadow Image


Networking: Sharing folders between Windows and Linux using Samba

Pages: 1 2 3

In this section, we will do the opposite to the previous section.  We will share a folder (in this case an entire mounted drive on Linux and connect to it through Windows.  There is reason to this madness: I'm in the process of converting M2TS movies to AVI format so need access to Linux ffmpeg and other free open source utilities to do this with. 

Yet I want to view and play the videos through my Windows workstations without having to copy files all over the place.  So let's begin:

WINDOWS : Mounting Linux shared folders on a remote Windows System

STEP DESCRIPTION COMMAND
1  Verify installation and commands exist.

Visit the LINUX : Mounting Windows shared folders on Linux and refer to Step 1.

 

2 Create a folder and/or determine one to share.

Use something similar to:

# mkdir /mnt/LinuxHomeVideos
#

to create a folder if you do not already have one in mind to share.  In this case I connected and formatted a new hard drive using the EXT filesystem.  Here's how I went about doing that: LINUX / UNIX: Adding a new SATA harddrive using parted instead of fdisk.

 

3 Specify the above folder you created in the SAMBA configuration file.

The SAMBA configuration file resides in /etc/samba/smb.conf.  An entry such as below can now be added to allow for sharing:

/etc/samba/smb.conf
.
.
.
[LinuxHomeVideos]
        comment = Sony HDR-SR7 Camcorder Home Movies and Images.
        path = /mnt/LinuxHomeVideos
        valid users = root
        public = no
        writable = yes
        browseable = yes
        guest ok = no
        printable = no

NOTE the parameters used.  For example, if the folder should not be writable from Windows, use writable = no.  This should be analogous to the Windows check box option Allow network users to change my files.

 

 4  Set the SAMBA password.

Set the password for the SAMBA root user account:

# smbpasswd -a <USERN>
New SMB password:
Retype new SMB password:
Added user <USERN>.
#

This is how we will authenticate from Windows.

 

 5 Test the configuration file to ensure no syntax errors.

Run the SAMBA configuration test command:

# testparm
Load smb config files from /etc/samba/smb.conf
Processing section "[homes]"
Processing section "[printers]"
WARNING: [printers] service MUST be printable!
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions
.
.
.
#

There is a WARNING above.  See below Q&A for a resolution.  A successful message will resemble this:
 

# testparm
Load smb config files from /etc/samba/smb.conf
Processing section "[homes]"
Processing section "[printers]"
Processing section "[HomeVideos]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions
.
.
.
#

 

6 Restart the SMB service.

Use:

# service smb restart

OR

# /etc/init.d/smb restart

 

6 Verify that you can see the share.

Run below command.  If the SAMBA server is on 192.168.1.1 the you can run this command on 192.168.1.1:

# smbclient -L 192.168.1.1
Enter root's password:
Domain=[LHS] OS=[Unix] Server=[Samba 3.3.2-0.33.fc11]

        Sharename       Type      Comment
        ———       —-      ——-
        HomeVideos      Disk      Sony HRD-SR7 Camcorder Home Movies and Images.
.
.
.
#

 

7 On Windows PC map the Linux shared folder.

 On the Windows PC, follow these steps:

  • Right click on Start and choose Explore or Explore all Users.  Windows Explorer window should appear.
  • Click on Tools -> Map Network Drive.  A dialog box will appear:
  • As in above image, select the Drive: letter you want to associate with the share.
  • Select the Folder: (ie In this case \\192.168.1.16\homevideos ) to mapp to the above Drive: letter.
  • Check Reconnect at logon if you want the remote path to be connected to when you start your PC.
  • Click Connect using a different user name .  Fill in the username and password you used in step 4:
    Map Network Drive - Connect As
  • Windows will retain above login username and password for the network share.
  • Click Finish.

In Windows Explorer, you should now see a mapping similar to this:

 

8 Verify your configuration.

In Windows, create a file on the shared drive then on Linux remove that same file.  This would constitute a basic Read/Write test.

 

9 Help! I've run into problems and I can't get past them. Check the Q&A section below or simply use your browser's search feature to search this page for the error, warning or issue you see.

 

 

Click below for next page…

Pages: 1 2 3

10 Responses to “Networking: Sharing folders between Windows and Linux using Samba”

  1. [...] Tom Kacperski wrote an interesting post today onNetworking: Sharing folders between Windows and Linux using SambaHere’s a quick excerpt [...]

  2. [...] Networking: Sharing folders between Windows and Linux using Samba [...]

  3. [...] Networking: Sharing folders between Windows and Linux using Samba [...]

  4. [...] NT_STATUS_UNSUCCESSFUL Setting up rules in the firewall between server/client for ports 445,139 etc might do it for your [...]

  5. [...] it's all said and done then shared with the rest of the network , including a new Nexus 7 running Android through AndSMB, and tweaked for quick data transfers it [...]

  6. [...] Networking: Sharing folders between Windows and Linux using Samba Fedora Update: undefined symbol: DRIOpenDRMMaster [...]

  7. [...] Windows and Linux: Samba / CIFS Network Sharing [...]

  8. [...] follow us on our Samba / CIFS Connectivity page for the resolution to the issue.  Hope this helps [...]

  9. [...] tips on this Samba / CIFS Connectivity page may [...]

  10. [...] Windows and Linux: Samba / CIFS Network Sharing [...]

Leave a Reply

You must be logged in to post a comment.


     
  Copyright © 2003 - 2013 Tom Kacperski (microdevsys.com). All rights reserved.

Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 Unported License