3

I have a Rpi3 which has been set up from 32gb NOOBS, and has VNC and XRDP installed so I run it headless via Windows Desktop Client on a Vista laptop.

On the laptop I have an explicit share of the C: drive called c. (Of course, there is an implicit equivalent called c$ built into Windows - they work the same except mine shows up under Networks in Windows Explorer on the other networked Windows computers)

I want to access my Windows C:/ drive share on the Rpi3.

The IP address of my DEV laptop is 192.168.5.213 and the share name is c

Question: What is the easiest way to access Windows shares from Rpi3?

3

Utilize Microsoft's Common Interface File System (cifs) - the core of Microsoft's LAN Manager.

(You can safely skip this tech info and proceed with the steps listed below)

https://technet.microsoft.com/en-us/library/cc939973.aspx

The Common Internet File System (CIFS) is the standard way that computer
users share files across corporate intranets and the Internet. An enhanced
version of the Microsoft open, cross-platform Server Message Block (SMB)
protocol, CIFS is a native file-sharing protocol.

Some of the platforms that CIFS supports are:
    Microsoft Windows 2000, Microsoft® Windows NT®, 
    Microsoft® Windows® 98, Microsoft® Windows® 95
    Microsoft® OS/2 LAN Manager
    Microsoft® Windows® for Workgroups
    UNIX

PROCEDURE:

Install cifs-utils

sudo apt-get install cifs-utils

Create a generic mount point under your login.

Add a directory for this particular share.

Perform the link

mkdir ~/LANPC
mkdir ~/LANPC/DEV
sudo mount //192.168.5.213/c /home/pi/LANPC/DEV -o username=Myname,password=Mypassword

Verify that it worked:

ls ~/LANPC/DEV

To make a local copy of, for instance, your Arduino sketches and libraries, you can do something like this:

mkdir ~/Arduino     
cp -r ~/LANPC/DEV/Users/SDsolar/Documents/Arduino ~/Arduino  

This creates a a temporary link. It will be lost when you reboot.

For persistent shares, append a line to the /etc/fstab file in this format:

sudo leafpad /etc/fstab

//192.168.5.213/c /home/pi/LANPC/DEV cifs username=Myname,password=Mypassword,iocharset-utf8,sec=ntlm 0 0

You can add as many as you like, but be sure to create a mount point directory for each beforehand.


It you reboot the Rpi3 and find the share directories empty, issue this command:

sudo mount -a;

This will mount all the Windows shares you have appended to /etc/fstab


--EDIT for new information on persistent share connections.

In this question, My Windows share will not mount during boot, @Cary posted an answer that deserves mention:

In Raspbian,

Click "Menu" button 
Select Preferences
Select Raspberry Pi Configuration 
In the System tab there is an option called "Network at Boot"
Check the "Wait for network" box
Click "OK"

This will allow for any slow-connecting networks such as WiFi.


--EDIT for new information on how to show shares on the desktop:

Right-click on the desktop
Select Preferences
Select Desktop Icons
Check the box that says "Show connected volumes on the desktop" 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.