Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have installed Ubuntu on two of my desktops PC's. I have not installed any addon packages or anything related to network as yet. Please guide my on how to set up a LAN between these two machines.

Is there any GUI program to do this instead of Terminal? I have the ethernet cable connected to a router which in turn is connected to my DSL modem to provide internet access to both my PC's.

share|improve this question
Ok, first things first: is internet working for both? Can both browse webpages, etc? Is your only issue on how to share folders and/or printers with each other? – MestreLion May 29 '11 at 10:38
What exactly do you want to use the LAN for? What you described already places the computers in a LAN. – Oxwivi May 29 '11 at 11:48
Your router may also be set up to not let the machines talk to each other. Usually that's only with wireless, but make sure the machines are able to ping each other. You can do that from the System -> Administration -> Network Tools menu. – Broam Jun 14 '11 at 20:27
up vote 6 down vote accepted

If both are directly connected to the router and can access internet, then they already are in LAN. Maybe you want to share files and folders, right?

If so, its easy: right-click any folder you want to share, go to "Sharing Options", check the "Share this folder" box, choose a share name, and youre basically done.

If Samba support is not already installed by default, Ubuntu will offer you to install it on-the-fly. Just accept it. Oh, by the way: "Samba" is what enables Ubuntu (and other Linux distros) to share folders and files in a LAN, using the same protocol used by Windows. Meaning any folders you share will also be accessible by Windows machines in your LAN (if there is any)

share|improve this answer
Thank you for the help. Does both the computers need to have samba installed? like comp1 shares file to comp2, i do your suggestion in comp1, do i have to perform the same on comp2 just to access comp1's files? Note: comp2 need not share files to comp1. – newforubuntulinux Jun 21 '11 at 11:55
@newforubuntulinux: Youre welcome. If comp2 will only access comp1's shared files, then no, no further setup is necessary. In File Manager (Nautilus is the proper name) just click Network in the left panel and browse till comp1's files. – MestreLion Jun 22 '11 at 15:05

I'm a little unsure how far you want the guide to go. But if you simply want Internet connection / local file sharing:

With the computer you are connecting to your router:

Click on your network indicator (top right of your screen...) and select 'Edit Connections'. In the wired tab hit the button 'Add'. Give the connection a helpful name, and under the 'IPv4 Settings' tab choose "Shared to other computers" in the drop down 'Method' box. Save the chances and close the connection editor. Connected this computer to the Internet.

Connected up the second machine. On the first 'internet'ed' machine just make sure (using the network indicator) that the Wired Connection you've just created is chosen.

This GUI method should be able to cope with most more-complex setups too.

share|improve this answer
As I have understood, both computers are directly connected to the router. So no need to share the wired connection, as they are probaly already "internet'ed" by the router. I think this is only a matter of SaMBa-sharing folders. – MestreLion May 29 '11 at 10:42
indeed - i think a little bit of confirmation is needed @newforubuntulinux please... – thomas michael wallace May 29 '11 at 10:50
Yes both Computers are able to browse internet web pages. I want to share folders between the 2 machines. Thanks everyone for the effort to answer my question. – newforubuntulinux May 30 '11 at 7:52
@newforubuntulinux: if any of the answers solved your issue, please choose one as the accepted answer. If not, feel free to edit your question and add more information on why they didnt work, and we well be pleased to help you further. – MestreLion Jun 2 '11 at 7:06

Test this: Open a terminal


sudo su 
apt-get update
apt-get install samba samba-common samba-common-bin smbclient system-config-samba
apt-get clean

System-config-samba is a graphical user interface for creating, modifying, and deleting samba shares and users.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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