Sunday, April 15, 2012

Filesharing between Windows 7 and Ubuntu (Networking)

To network an Ubuntu machine for filesharing, you need to install samba packages. You can do that by typing these commands in your Ubuntu Terminal(type terminal inside the dashboard).

sudo apt-get install samba system-config-samba python-glade2

Then you need to add your account to the samba server. You can do that by typing

sudo smbpasswd username -a

and provide your password.

Then in the windows machine, go to the command prompt( type cmd in the start menu) and execute the following command.

net config workstation

and get the workstation domain. (ex : WORKGROUP)
Then in the Ubuntu PC type samba in the dashboard and that will prompt a new window.
Go to preferences -> Server Settings and in the workgroup textfield insert the workstation domain and hit "OK".

In the Windows PC type "manage advanced sharing settings" and turn on file and printer sharing.

Restart both computers and in the network section of both machines, it should show the other computer as well as itself.

IF THAT DOESN'T SHOW, then you need to edit the ip of the Windows PC.
you can do that by
 In your Ubuntu PC find out the IP address by typing ifconfig in the terminal. You should see something like this.
(if you know how ip works, you can go ahead and set the ip of the windows machine to be in the same network as the Ubuntu PC and Skip the next part and it should work)

     write down the inet address and the Mask under the eth0 section.

In the windows PC,
  • "Start" and then go to "Control Panel"
  • Left click on "Network and Internet" and then choose "Network and Sharing Center"
  • On the left side choose "Change adapter settings"
  • Right click on your network card and from the drop-down choose "Properties"
  • Under the "Networking" tab
  • Choose "Internet Protocol Version 4 (TCP/IPv4)" or "Internet Protocol Version 6 (TCP/IPv6)" and then click on "Properties"
  • In next window you have option between "Obtain an IP Address Automatically" and "Use the following IP Address". Choose the latter and,
    here type in the written down ipaddress +1 in the ip field and the subnet mask should be the same as the Mask you wrote down

    ex : ubuntu_ip : (considering the above image, this is different on your PC)
    windows ip should be
    subnet mask = Mask =     
  • Finally click on "OK" and your IP address should be changed

    What this does is put the two PC's in the same network.Then you can use the ping command in the Ubuntu PC to see whether it works.
    ping windowsip
    ex : ping
Then share folders in the two machines and restart. Then It will work !!!!!

If the ethernet connection is really slow, you can follow this guide to update your ethernet drivers. This is written particularly towards Realtek drivers. But the abstract idea can be used to implement towards updating other drivers.


  1. hi..Im student from Informatics engineering, this article is very informative, thanks for sharing :)

  2. Thank you so much for posting these for global use!/You are making the world a better place
    Remote Data Backup | Enterprise Backup System