7

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
}
Steve
  • 173
  • 1
  • 1
  • 5

5 Answers5

2

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.

Beli
  • 258
  • 1
  • 2
  • 5
  • 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 '14 at 14:32
  • For the follow on question to hopefully resolve the other part, see http://serverfault.com/questions/599126/tftpd-hpa-service-must-be-restarted-before-working-after-fresh-boot – Steve May 28 '14 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

meresgr
  • 21
  • 1
  • 5
0

1) uninstall/re-install tftpd-hpa

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

RUN_DAEMON="yes"
Pat
  • 3,339
  • 2
  • 16
  • 17
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

Daryl Spitzer
  • 2,946
  • 9
  • 33
  • 40
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.

mivk
  • 3,457
  • 1
  • 34
  • 29