Setting Up TFTP, NFS, and SSH Services on Ubuntu for Embedded Development

Development Environment

Reference system used:

  • Ubuntu 14.04.1 Desktop i386
  • VMware Workstation 10.0.2

Useful commands for environment verification:

lsb_release -a    # Check Ubuntu version
cat /etc/issue     # View Ubuntu version
ctrl+alt+a         # Open terminal
du -sh [file/folder]  # Check file or folder size
su root            # Switch to root account
ln -s /mnt/hgfs/shareDir/ /root/shareDir  # Create symbolic link

TFTP Setup

Installing the TFTP Client

On the client machine, install the TFTP client package:

sudo apt-get install tftp-hpa

Troubleshooting Package Installation Issues:

If you encounter errors about unable to fetch archives, try the following solutions:

sudo vim /etc/resolv.conf
# Add: nameserver 8.8.8.8

Also update the apt sources list to use a mirror:

sudo vim /etc/apt/sources.list
# Replace: http://us.archive.ubuntu.com/ubuntu/
# With: http://mirrors.aliyun.com/ubuntu

After updating sources, run:

sudo apt-get update

Then install the TFTP client again:

sudo apt-get install tftp-hpa

Using the TFTP Client

Connect to a TFTP server by specifying its IP address:

tftp serverIP

Type ? to view available TFTP commands. Use get folloewd by a filename to download files from the server.

Configuring the TFTP Server

On the server machine, install the TFTP server package:

sudo apt-get install tftpd-hpa

Create the tftpboot directory and set permissions:

mkdir /tftpboot
chmod 777 /tftpboot

Configure the TFTP server:

sudo vim /etc/default/tftpd-hpa

Add the following configuration:

# /etc/default/tftpd-hpa
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/tftpboot"
TFTP_ADDRESS="[::]:69"
TFTP_OPTIONS="-l -c -s"

Restart the service to apply chenges:

sudo service tftpd-hpa restart

Testing TFTP

From the client machine, connect to the server:

tftp serverIP

Use get to download files from the server.

NFS Server Setup

sudo apt-get install nfs-kernel-server
sudo apt-get install nfs-common

Configure the NFS exports file:

sudo vi /etc/exports
# Add the following line:
/root/rootfs *(rw,sync,no_root_squash,no_subtree_check)

Set appropriate permissions:

chmod 777 -R /root/rootfs

Troubleshooting Portmapper Issues on Ubuntu 14.04 LTS 64-bit:

If you encounter "Not starting: portmapper is not running", try thece steps:

sudo apt-get purge rpcbind
sudo apt-get install nfs-kernel-server
# Edit /etc/exports again if needed
sudo service rpcbind start
sudo /etc/init.d/nfs-kernel-server restart

Test the NFS mount:

mount -t nfs -o nolock localhost:/root/rootfs /mnt/

If you get "access denied by server" error, check permissions:

chmod 777 /root

SSH Setup

sudo apt-get install ssh

If you encounter dependency errors, install the required packages:

sudo apt-get install openssh-client=1:6.6p1-2ubuntu1
sudo apt-get install openssh-server

Start the SSH service:

sudo /etc/init.d/ssh start

Verify SSH is running:

ps -ef|grep ssh

Configuring Static IP Address

sudo vi /etc/network/interfaces

Add the following configuration:

auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.1

Restart the network interface:

sudo ifconfig eth0 down
sudo ifconfig eth0 up

Setting Up Cross-Compilation Toolchain

Copy the cross-compilation toolchain archive to the shared directory with your host machine, then copy it to /usr/local and extract it:

cp /mnt/hgfs/shareDir/arm-toolchain.tar.gz /usr/local/
cd /usr/local
tar -xzf arm-toolchain.tar.gz

Configure the environment variables in your shell profile:

vi ~/.bashrc
# Add at the end:
export PATH=/usr/local/arm-2009q3/bin:$PATH

Apply the changes immediately:

source ~/.bashrc

Tags: tftp NFS ssh Ubuntu embedded-linux

Posted on Sun, 13 Sep 2026 16:22:07 +0000 by Jade