Sharing Ubuntu 11.04 Files and Folders with Windows Systems

From Techotopia
Jump to: navigation, search
PreviousTable of ContentsNext
Sharing Ubuntu 11.04 Folders with Remote Linux and UNIX SystemsConfiguring an Ubuntu 11.04 Mail Client (Evolution)


Purchase and download the full version of this eBook in PDF & ePub formats for only $12.99
PDF/ePub version contains 39 chapters and 255 pages.

Buy eBook


Although Linux in general, and Ubuntu in particular, is increasingly making inroads into the desktop market, its origins are very much server based. It is not surprising therefore that Linux has the ability to act as a file server. It is also extremely common for Linux and Windows systems to co-exist both in home and enterprise environments. It is a common requirement therefore that files on an Ubuntu system be accessible to Linux, UNIX and Windows based systems over network connections. Similarly, shared folders residing on Windows systems must also be accessible from Ubuntu systems.

The Microsoft Windows family of operating systems share resources such as file systems and printers using a protocol called Server Message Block (SMB). In order for an Ubuntu system to serve such resources over a network to a Windows system and vice versa it must, therefore, support SMB. This is achieved using Linux based technology called Samba. In addition to providing integration between Linux and Windows systems, Samba may also be used to provide folder sharing between Linux systems (as an alternative to NFS which was covered in the previous chapter).

In this chapter we will look at the steps necessary to share file system resources and printers on an Ubuntu 11.04 system with remote Windows and Linux systems.




Samba and Samba Client

Samba allows both Ubuntu resources to be shared with Windows systems and Windows resources to be shared with Ubuntu systems. Ubuntu accesses Windows resources using a samba client. Ubuntu resources, on the other hand, are shared with Windows systems using a samba server. Typically, the samba client is installed and configured by default allowing you to browse available Windows resources without any additional work (this is covered later in the chapter). In order to allow an Ubuntu system to share resources with Windows systems, however, some more work is required.

Installing Samba Server on an Ubuntu System

The default settings used during the Ubuntu installation process do not install the Samba server. Unless you specifically requested that Samba be installed it is unlikely that you have Samba installed on your system. If the Samba server environment is not installed on your system it can be installed using the apt-get command-line tool within a Terminal window session (Ctrl-Alt-T):

sudo apt-get install samba

The above command will install both the samba package and the samba-common dependency package if it is not already installed and start the Samba smbd and nmbd services running in the background. In addition, the installation will configure the ufw Firewall interface to allow incoming and outgoing SMB traffic to pass unhindered.


Sharing Ubuntu Folders

Once the Samba File sharing is installed and running, the next step is to configure the filesystem directories (also known as folders) to be shared with the Windows systems.

The easiest way to achieve this is to use the Samba Server Configuration tool. As with the Samba server packages, it is likely that this tool was not installed by default on your Ubuntu system.

If the tool is not installed it may be installed as follows:

sudo apt-get install system-config-samba

Once installed, the Samba Server Configuration may be launched from the command-line in a terminal window:

sudo system-config-samba

When loaded, the Samba Server Configuration tool will appear as follows:

The system-config-samba tool running on Ubuntu 11.04


Select Preferences -> Server Settings... from the menu, enter the name of the Windows Workgroup to which you wish this server to belong and click OK.

Select Preferences -> Samba Users... and select a user from the list which will be used to share folders with the Windows system. After selecting the user, click the Edit button and enter the corresponding Windows user name which will be mapped to the Linux user you just specified and provide an optional password to be used for share access (leaving the password fields blank will allow access without the need to enter a password). Click on OK.

Click on the Add button in the toolbar to add a new folder to share. The following dialog will subsequently appear:


Creating a new Ubuntu 11.04 Samba share


Type or browse to the path you wish to share and enter a share name if you do not like the one provided by the tool. Set the Writable and Visible toggles to your desired settings and click OK. Select the Access tab and either select a user added in the previous step, or allow access to all users.

Click on OK when you have configured the information in this dialog. The main dialog should appear with the new share listed:


A new Samba share added to Ubuntu 11/04 using system-config-samba


Once completed, the folder you specified will be visible from any Windows systems on the same network (and workgroup specified in the Server Settings page) as your Ubuntu system. You should now have remote access to your Linux folder from the Windows system:


Accessing an Ubuntu 11.04 share from a windows system

Making Ubuntu based Printers Available to Windows Systems

By default, the Samba server environment is configured to allow Windows systems to access printers configured on an Ubuntu system. This can be verified within the system-config-samba tool by checking for the /var/lib/samba/printers directory share. When configured, any Ubuntu based printers may be added as resources to a Windows system simply by adding the device as a network printer in the Windows Printers and Devices control panel where any Ubuntu printers should be automatically detected and listed as being available.

To disable the network sharing of a printer open the Printing panel (click on the power button in the top right hand corner of the screen, select System Settings and choose Printing from the resulting Control Center window). Right click on the icon for the printer to be configured and uncheck the Shared option:


Disabling the sharing of an Ubuntu 11.04 printer


Accessing Windows Shares from Ubuntu 11.04

As previously mentioned, Samba is a two way street, allowing not only Windows systems to access files and printers hosted on an Ubuntu system, but also allowing the Ubuntu system to access shared resources on Windows systems. To access any shared resources on a Windows system, click on the Home Folder item in the Unity desktop launcher panel. Within the resulting File Manager window, select Network from the Places panel. This will display systems and devices detected on the network including an icon for the Windows Network as well as any other systems (including Windows systems) detected on the network. Double clicking on the Windows Network icon will display a list of Windows workgroups detected on the network (note that it may take Ubuntu some time to scan the network for available workgroups):


A list of windows workgroups available to Ubuntu 11.04 via Samba


Double clicking on a Windows workgroup will, in turn, display a list of Windows systems present on that group (keep in mind that any Ubuntu systems configured to act as a Samba server on a Windows workgroup will also fit into this category):


Windows systems accessible to Ubuntu 11 via Samba


Finally, double clicking on a computer icon will list the shared resources on that system available for access from the Ubuntu client:


An Ubuntu 11 system accessing Windows shares using Samba


Summary

In this chapter we have covered the basics of using Samba on Ubuntu 11.04 to both access Windows resources from Ubuntu and also to configure an Ubuntu system to act as a file and printer server accessible to Windows systems.


Purchase and download the full version of this eBook in PDF & ePub formats for only $12.99
PDF/ePub version contains 39 chapters and 255 pages.

Buy eBook



PreviousTable of ContentsNext
Sharing Ubuntu 11.04 Folders with Remote Linux and UNIX SystemsConfiguring an Ubuntu 11.04 Mail Client (Evolution)