How do I install and run a TFTP server?

I have an embedded VxWorks target that needs to boot its kernel from my Ubuntu computer. How do I install and run a TFTP server?

Here is Solutions:

We have many solutions to this problem, But we recommend you to use the first solution because it is tested & true solution that will 100% work for you.

Solution 1

TFTP Server Install and Setup

  1. Install following packages.

    sudo apt-get install xinetd tftpd tftp
    
  2. Create /etc/xinetd.d/tftp and put this entry

    service tftp
    {
    protocol        = udp
    port            = 69
    socket_type     = dgram
    wait            = yes
    user            = nobody
    server          = /usr/sbin/in.tftpd
    server_args     = /tftpboot
    disable         = no
    }
    
  3. Create a folder /tftpboot this should match whatever you gave in server_args. mostly it will be tftpboot

    sudo mkdir /tftpboot
    sudo chmod -R 777 /tftpboot
    sudo chown -R nobody /tftpboot
    
  4. Restart the xinetd service.

    newer systems:

    sudo service xinetd restart
    

    older systems:

    sudo /etc/init.d/xinetd restart
    

Now our tftp server is up and running.

Testing our tftp server

  1. Create a file named test with some content in /tftpboot path of the tftp server

    Obtain the ip address of the tftp server using ifconfig command

  2. Now in some other system follow the following steps.

    tftp 192.168.1.2
    tftp> get test
    Sent 159 bytes in 0.0 seconds
    
    tftp> quit
    
    cat test
    

Source:
http://mohammadthalif.wordpress.com/2010/03/05/installing-and-testing-tftpd-in-ubuntudebian/

Solution 2

You can install tftpd-hpa and change the configurations . Steps for installing tftpd-hpa is explained in this blog post.

Solution 3

You can install atftpd and it will create a directory called /tftpboot in which you may place your files. Put especially the pxelinux.0 file there. Any future configuration will be addressed if it is necessary.

When you install the package with

sudo apt-get install atftpd

it will use Debconf to prompt you for some choices. You can set many choices(server timeout may be useful), especially the basepath. You can also adjust the multicast range.

Note: Use and implement solution 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply