Sharing files with Linux and Vista

File Business


If you want to share files your own way, Vista might need some help.

By Jürgen Donauer and Thomas Leichtenstern

Windows computers use the SMB protocol for sharing files, and Linux has learned to adapt. But what if you don't want to use SMB? Will Vista adapt to Linux? The answer is yes, but you might have to spend some extra money or bring in extra tools.

Despite Microsoft's promise to improve compatibility with standards other than its own, Windows Vista [1] still falls short. Redmond continues to ignore common protocols such as NFS, SSH, and SFTP, and even SMB-based communications between Linux and Vista are fraught with complications. In this article, we explore some of the options for sharing files in Linux and Vista by focusing on three popular protocols: SMB, NFS, and SSH. You'll learn what Vista can do out of the box, and we'll show you how to fill in the gaps.

SMB

Server Message Block (SMB) is the native Windows file and printer sharing protocol. SMB was originally developed by IBM, and it has been extended many times by Microsoft and others. Microsoft's Common Internet File System (CIFS) is a variant of SMB. The current version of the SMB protocol is referred to as SMB version 2 (SMB2).

As most Linux admins know, Samba [2] is a popular open source tool for providing SMB file and print services in Linux. In the February 2007 issue of Linux Magazine [3], we outlined some of the early problems associated with the use of Samba with Windows Vista.

Research reveals that Vista does have a communication issue with Samba versions before 3.0.10. According to Samba developer Volker Lendecke, this issue is a bug in Vista [4] that ignores Netprot replies from the Samba server. After updating to Samba version 3.0.22, Windows Vista access to Samba shares worked fine.

Linux has various methods of accessing SMB shares, all of which rely on you having an SMB client. The most popular graphical front-ends for SMB include Smb4K, Linneighborhood, and Konqueror. In the latter case, you can simply type smb:/ to view the workgroups, computers, and shares on the network. We were unable to mount Vista shares using Konqueror and Linneighborhood on Ubuntu 6.10. However, we had no trouble manually mounting a share using the command:

mount -t smbfs -o username=Windows_user password=user_password //IP address/share /mountpoint

NFS

Although the venerable Network File System (NFS) is getting old, many Linux and Unix networks still use NFS for file sharing. Most Linux distributions still have both an NFS client and an NFS server on the installation disks.

If you have tried to configure NFS in previous versions of Windows, you might be familiar with the Microsoft Windows Services for UNIX extension [5], which provides an NFS client for Windows. In Vista, Microsoft renames this collection Subsystem for UNIX-based Applications.

If you want native NFS support in Vista, you'll have to pay extra. Only the Vista Enterprise and Ultimate variants come with these Unix-based extensions - users with other versions will need third-party tools to access NFS shares. One potential candidate is the free JFtp [6]. The Java-based JFtp not only runs on Vista, but on any operating system with Java support. Of course, you need to add Java support to Vista before you can use JFtp.

To do so, you need to download and install the current Java Runtime Environment (JRE) from Sun [7]. By entering java -jar jftp.jar at the command line or by right-clicking the file and selecting Open with..., you can then launch JFtp. The only entry in the list is Java (TM) Platform SE Binary.

Click OK to launch JFtp (Figure 1). Because Vista stores this selection permanently, you can just double-click the Jar file to launch the program in the future. JFtp also supports the FTP, SFTP, SMB, and HTTP protocols. Because remote data sources are opened in tabs, you can keep multiple connections open at the same time.

Figure 1: The Java-based JFtp client program gives Vista the ability to access NFS servers, along with SMB, FTP, or SFTP services.

If you would rather work with commercial software, nfsAxe [8] by LabF is a good choice for accessing NFS from Windows, and it is not too expensive at US$ 40. The software includes both a client and an NFS server for Windows. The Omni-Lite client [9] is another commercial option, but it will cost you US$ 89.

The use of Vista as an NFS server is easy if you happen to own the Enterprise and Ultimate Vista Editions because the Subsystem for UNIX-based Applications includes an NFS server. If you don't want to spend the money for these expensive Vista versions, a number of third-party programs will help you set up Vista as an NFS server.

The Allegro NFS server [10] is released under the Lisp Lesser GNU Public License (LLGPL); however, only the source code is free. If you want a ready-to-run binary package [11], it will set you back US$ 65. The Omni-NFS server [12] is a commercial solution that costs US$ 99. The cheapest closed source variant is nfsAxe [8] for US$ 40.

The boundless options that Cygwin [13] brings to Vista give you another alternative for NFS. If you take a close look at Cygwin, you will notice that it includes an NFS server.

Note that the integrated Windows firewall with Vista will probably try to block access to the server. For both TCP and UDP, you need to allow ports 2049 for NFSD and 111 for SUNRPC. For more tips and instructions on configuring the NFS server on Cygwin, you can refer to the "Cygwin NFS Server HOWTO" by Hugh Sparks [14].

SSH and SCP

Linux users are accustomed to OpenSSH for secure remote shell access. SCP is a tool for file transfer by the SSH protocol. Vista does not have native support for SSH server connections, although you will find a number of free tools to support SSH in Vista.

The most popular candidate for data exchanges via SSH is WinSCP [15]. WinSCP supports both SCP and SFTP. The user interface, which is reminiscent of Norton Commander, also supports drag and drop file copies between hosts (see Figure 2).

Figure 2: WinSCP supports connections to SSH servers from Vista, giving Vista users a secure data transfer option.

FileZilla [16] is another well-known member of this program group. Besides SSL connections, the client supports SFTP, and thus file transfers to and from SSH servers.

The free Cygwin [13] Linux environment for Windows is another alternative. Cygwin contains command-line tools such as sftp.exe, scp.exe, and ssh.exe.

The freeSSHd [17] project has a free SSH server for Windows with a range of features similar to the Linux SSH server. Besides the neat graphical interface (Figure 3), the software lets you either launch the server manually or install SSH as a Windows service.

Figure 3: freeSSHd, the Windows counterpart to OpenSSH, offers the same technical feature set, but with a convenient GUI for configuration tasks.

At the end of the installation, you need to specify whether you want to run the SSH server as a service. By clicking on the desktop icon for FreeSSHd, the SSH server launches and you can access the server's settings by clicking on the new icon in your system tray.

Authorized users can be Windows users on the system (NT authentication), as well as special users that you can create in the Users menu. Once you have the OpenSSH server running on Windows, you can easily access the server from a Linux machine. To do so, you can use either a normal command-line utility, such as ssh, or you can use a tool like the fish:// KIO slave in Konqueror.

Conclusions

Vista does not claim to be a server system, but one would expect a modern operating system to at least support common protocols such as NFS and SSH without requiring the user to invest extra money in a premium product (US$ 500 for Vista Ultimate).

Third-party programs like WinSCP, JFtp, or freeSSHd help Windows Vista talk to Linux systems. However, the new Microsoft standard protocol, SMB2, has some obstacles that prevent Windows Vista from talking to less-than-recent Samba servers.

INFO
[1] Windows Vista: http://www.microsoft.com/windows/products/windowsvista/default.mspx
[2] Samba: http://www.samba.org/samba/
[3] "Living with Vista" by Thomas Leichtenstern, Linux Magazine, February 2007, pg. 84
[4] Vista fails to open Samba shares: http://lists.samba.org/archive/samba-technical/2006-October/049893.html
[5] Microsoft Windows Services for UNIX: http://www.microsoft.com/technet/interopmigration/unix/sfu/default.mspx
[6] JFtp: http://freshmeat.net/projects/jftp/
[7] Sun Java: http://java.sun.com
[8] nfsAxe: http://labf.com/nfsaxe/index.html
[9] Omni-Lite NFS client: http://www.xlink.com/nfs_products/Omni-NFS_Lite2000/Omni-NFS_Lite2000.htm
[10] Allegro NFS server: http://opensource.franz.com/nfs/
[11] Allegro NFS binaries: http://www.nfsforwindows.com
[12] Omni-NFS server: http://www.xlink.com/nfs_products/NFS_Server/NFS_Server.htm
[13] Cygwin: http://cygwin.com
[14] NFS server on Cygwin: http://www.csparks.com/CygwinNFS/index.xml
[15] WinSCP: http://winscp.net/eng/docs/start
[16] FileZilla: http://filezilla.sourceforge.net
[17] freeSSHd: http://www.freesshd.com