8

I'm runnung Ubuntu 12.04 in a VirtualBox VM. I've installed the tftpd-hpa package. I'm using this to boot an embedded Linux system, and I've noticed that on first boot of my VM, it wouldn't work, but restarting the tftpd-hpa service made it work every time, until next boot.

Today, I ran a shell script from Texas Instruments that may have mucked with my tftpd configuration, and now I cannot get it to work at all. I'm able to connect, but transfers timeout, even to localhost (I also tried 127.0.0.1):

steve@steve-VirtualBox:~$ tftp
tftp> connect localhost
tftp> status
Connected to localhost.
Mode: netascii Verbose: off Tracing: off
Rexmt-interval: 5 seconds, Max-timeout: 25 seconds
tftp> get zImage
Transfer timed out.

tftp> 

Note that /var/lib/tftpboot/zImage does exist, however I get the exact same behavior for a file that doesn't exist.

Here are the contents of /etc/default/tftpd-hpa:

# /etc/default/tftpd-hpa

TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/var/lib/tftpboot"
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="--secure"

Here is /etc/xinetd.d/tftp:

service tftp
{
protocol = udp
port = 69
socket_type = dgram
wait = yes
user = nobody
server = /usr/sbin/in.tftpd
server_args = /var/lib/tftpboot
disable = no
}

5 Answers 5

3

Seems you're starting tftpd-hpa from xinetd and as a standalone service at the same time. Please choose one and disable the other.

E.g. set disable = yes in /etc/xinetd.d/tftp and restart xinetd. Then restart the standalone service service tftpd-hpa restart and try the connection again.

2
  • It seems like this has resolved my new problem, but I still have to restart tftpd-hpa after a reboot before it will work (which wasn't what this question was about). Thank you!
    – Steve
    May 28, 2014 at 14:32
  • For the follow on question to hopefully resolve the other part, see serverfault.com/questions/599126/…
    – Steve
    May 28, 2014 at 14:40
1

Setting TFTP_ADDRESS="0.0.0.0:69" didn't work for me, at least for both interfaces. Setting TFTP_ADDRESS=":69" did the job

2
  • Can you clarify your OS and its version?
    – chicks
    Mar 31, 2017 at 14:43
  • It's Debian Jessie
    – meresgr
    Apr 5, 2017 at 19:13
0

1) uninstall/re-install tftpd-hpa

2) add to /etc/default/tftpd-hpa

RUN_DAEMON="yes"
0

You may need to poke a hole in the firewall. From step 4 of http://www.thelinuxdaily.com/2010/02/guide-on-tftp-server-setup-in-fedora/:

Insert the following line before the “COMMIT” line of /etc/sysconfig/iptables and then restart the service with ‘service iptables restart':

-A INPUT -m state --state NEW -m udp -p udp --dport 69 -j ACCEPT

0

See this answer.

I had to edit /etc/default/tftpd-hpa and set the IP address in the TFTP_ADDRESS= variable.

That was on Debian Jessie, but it may be the same on Ubuntu.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .