Treating a RaspberryPi as just another Windows machine

This guide has been superceded by the AutoInstall version http://cymplecy.wordpress.com/2012/08/09/auto-install-a-simple-samba-setup/ but it still shows the process needed to go through :)

To access the files on your RPi over your network and to stop worrying about finding its IP address, you need to install and configure something called Samba – but don’t worry-  I’ve made this easy peasy

1st off -need to run LXTerminal and then type

sudo apt-get install samba

(Answer any question it asks with OK or Y)

Once its installed – we need another thing installing – so do this

sudo apt-get install samba-common-bin

And then run this command

sudo smbpasswd -a pi

You will be asked to enter the pi password twice – use raspberry as the password.

Finally use

sudo nano /etc/samba/smb.conf

And copy and paste the following to replace the existing file contents


#======================= Global Settings =======================
[global]
workgroup = WORKGROUP
server string = mypi server
netbios name = mypi

dns proxy = no

#### Debugging/Accounting ####
log file = /var/log/samba/log.%m
max log size = 1000
syslog = 0
panic action = /usr/share/samba/panic-action %d

####### Authentication #######
security = user
map to guest = pi

#======================= Share Definitions =======================
[homes]

comment = Home Directories
browseable = yes
guest ok = yes
read only = no
create mask = 0775
directory mask = 0775
writeable = yes
guest account = pi

[public]
path = /
guest ok = yes
guest account = ftp
browseable = yes
read only = no
create mask = 0777
directory mask = 0777
writeable = yes
admin users = everyone

Save the file in nano (Ctrl-O, answer Y and then Ctrl-X) and finally issue the following command

sudo /etc/init.d/samba restart

Your RPi should now be set to be reffered to as \\mypi from any windows machine on the same network.

You will be asked to logon the 1st time you use it after every computer restart – just use username pi password raspberry

If you wish to change the name of your RPi to say darkstar then just replace mypi with darkstar in the server name and netbios name lines

About these ads

10 thoughts on “Treating a RaspberryPi as just another Windows machine

  1. Well, I’ve done plenty with samba and windows networking (I use a Debian file server to windows clients at home), and this should work, just by looking at your config. The other available option is to just use security = share. That works best if you have multiple shares with different permissions. One thing to note is that if you have different NetBIOS and DNS names, your server won’t be accessible by “mypi” if the client you’re connecting from doesn’t have NetBIOS support (i.e, most out of the box linux installs). Of course, in that instance, you could just use the DNS name (raspbian).

    • “The other available option is to just use security = share”

      I couldn’t read/write the pi folder when I did that – please send me an smb.conf that works with that and I’ll be very happy :)

      One thing to note is that if you have different NetBIOS and DNS names, your server won’t be accessible by “mypi” if the client you’re connecting from doesn’t have NetBIOS support (i.e, most out of the box linux installs). Of course, in that instance, you could just use the DNS name (raspbian).”

      Good point :) Where is the DNS name held and I’ll change that as well :)

      • In order to make the pi directory writable if “security = share”, you need to add “admin users = pi” (without quotes) under the options where you’re defining the share.

        To change the dns hostname of the raspberry pi, follow the instructions in this video:

  2. Thanks so much, went through about 3 tutorials which went off on one and didn’t work for me, but this works great

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s