Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question

4 Answers 4

up vote 20 down vote accepted

I got TFTP service working great by using:

sudo apt-get install xinetd tftpd tftp

Here is where the solution came from: http://mohammadthalif.wordpress.com/2010/03/05/installing-and-testing-tftpd-in-ubuntudebian/

And here is what's there:

  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.

    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> get test
    Sent 159 bytes in 0.0 seconds
    tftp> quit
    cat test
share|improve this answer
this doesnt work for 13.04. I just tried –  BЈовић Sep 3 '13 at 9:07
only step 4 needs to be changed, since xinetd is spawned by upstart. you need to restart it with 'service xinetd restart' –  BЈовић Sep 4 '13 at 12:14
I followed this instruction and faced permission denied! Destination filename [c2950-i6q4l2-mz.121-22.EA1b.bin]? TFTP: error code 2 received - Access violation %Error opening tftp:// (Permission denied) #copy flash:c2950-i6q4l2-mz.121-22.EA1b.bin tftp: Address or name of remote host []? Destination filename [c2950-i6q4l2-mz.121-22.EA1b.bin]? TFTP: error code 2 received - Access violation –  Mohammad Rafiee Apr 8 '14 at 6:30
@Mohammad Rafiee: the blog post linked to here added some info: run sudo chmod -R 777 /tftpboot between step 1 and 2 of "Testing our tftp server". Not that it helped me, but it looks like it helped others. –  Gauthier Aug 28 '14 at 11:43
On 14.04, this did not work for me. The info about /tftpboot in /etc/xinetd.d/tftp did not seem to matter. Instead, the client looks in the directory /srv/tftp as specified in /etc/inetd.conf. I don't if the way things are setup changed since the article, or if I screwed up somehow. If the answer above does not work for you, try putting your test file in /srv/tftp instead. –  Gauthier Aug 28 '14 at 12:28

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.

share|improve this answer
What is pxelinux.0 for? I'm booting a VxWorks target, so I thought that I only need the file vxworks in /tftpboot. –  user1689961 Oct 15 '12 at 21:11
Sorry - that did not work for me. –  user1689961 Oct 18 '12 at 16:59
Try renaming vxworks to pxelinux.0, just to see whether my answer will work for future users. –  hexafraction Oct 18 '12 at 20:40
this doesnt work for 13.04. I just tried –  BЈовић Sep 3 '13 at 8:55
@BЈовић This is somewhat of an old answer and I honestly do not know the procedure for 13.04. –  hexafraction Sep 4 '13 at 11:02

it didn't work out for me after i did all the steps listed above. But after i modified:

vi /etc/inetd.conf

which changed the srv/tftp to <my dir path>

and restarted everything that i can restart:

/etc/init.d/openbsd-inetd restart
/etc/init.d/xinetd restart 
service tftpd-hpa restart

then it finally works!!

share|improve this answer
BTW im using UBUNTU 14.04 LTS –  Rick Wang Nov 11 '14 at 1:52
How did you get both openbsd-inetd and xinetd installed at the same time? They are conflicting packages. –  muru Nov 11 '14 at 1:56
@RickWang: Please edit your answer, if you have something to add. It's much more difficult to find relevant information in the comments, which should therefore be used mainly for discussion. –  David Foerster Nov 12 '14 at 15:59

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

share|improve this answer
Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. –  guntbert Sep 6 '13 at 7:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.