File sharing with QNX

author-image
PCQ Bureau
New Update

Now that you’ve installed the QNX RTP (real time platform) on your machine,
let’s see how to make it communicate with Windows machines over a network. We
take you through the process step by step, so that you can easily send and
receive files over your network using the new operating system (OS).

Windows employs the SMB (Server Message Block) protocol to share directories
over a Windows network. A freely available implementation of SMB is Samba. We’ve
given the source of Samba on the CD, which must be compiled on QNX to use it on
this platform.

Compiling Samba in QNX

Login as root. Use the Photon File Manager to copy the file
samba-2.0.7-nto.tgz, found in qnx>utils directory on this month’s PCQ CD,
to your home directory, /root. Start the Terminal and change to the /root
directory by typing ‘cd’. Next, untar the Samba source archive as:

tar —zxvf samba-2.0.7-nto.tgz

This will create a directory named samba-2.0.7. Change to the subdirectory
called source under this (cd samba-2.0.7/source) and issue the following
commands:

./configure

make

make install

Sharing directories on Windows machines

To connect to a Windows share (a shared directory on a Windows machine), you
can use the ‘smbclient’ command. Suppose the IP address of the Windows
machine whose share you want to access is 192.168.1.10 and the share name is ‘shekhar’.
To connect to this share, type the following command in the Photon Terminal:

/usr/local/samba/bin/smbclient //192.168.1.10/shekhar —U pcq

With ‘—U’ you specify the login name (pcq in our case) with which you
want to access the share. You’ll then be asked for a password. Simply press
Enter if you have share-level access. However, you must supply the correct
password if the Windows machine has user-level access control. You’ll now see
an smb:\> prompt where you can use ‘ls’ to see the files in the Windows
share. Use ‘get ’ to copy a file from the share and ‘put
’ to copy a file from your machine to the share.

Sharing directories on QNX machines

You can also share files on your QNX machine with other Windows machines.
Suppose you want to share a directory named ‘share’ in Root directory.
Ensure that this directory exists or create it using the mkdir /share command.
Copy the files that you want to share into this directory.

To configure Samba, copy the file smb.conf found in qnx>utils on the PCQ
CD to /usr/local/samba/lib. Open this file in the Photon Editor or in vi. Change
the workgroup, which is MYGROUP by default, to your workgroup. Add the following
line below it:

netbios name = QNX

This specifies the name of your QNX machine (in our case, QNX) on the
network. Next look for the line that says:

security = user

and change it to :

security = share

This will give share level access (without a username and password)
properties to a shared folder. Now append the following lines at the end of the
file.

comment = QNX share

path = /share

public = yes

readonly = no

Save the file and then start the Samba server by typing

/usr/local/samba/bin/smbd

in the Photon Terminal window.

Now, Windows users on your network will be able to see your QNX machine under
the workgroup you’d specified in smb.conf. Go to the Network Neighborhood or
do a search for the QNX machine to access the /share directory.

Here, we’ve simply compiled Samba, which is popularly used in Linux, on QNX.
Samba on QNX is no different from Samba on Linux. So, you can use the articles
on Samba in our past Linux issues for more advanced implementations.

Shekhar Govindarajan

Stay connected with us through our social media channels for the latest updates and news!

Follow us: