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?
3 Answers
TFTP Server Install and Setup
Install the following packages.
sudo apt-get install xinetd tftpd tftpCreate
/etc/xinetd.d/tftpand 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 }Create a folder
/tftpbootthis should match whatever you gave inserver_args. mostly it will be tftpboot.sudo mkdir /tftpboot sudo chmod -R 777 /tftpboot sudo chown -R nobody /tftpbootRestart the
xinetdservice.newer systems:
sudo service xinetd restartolder systems:
sudo /etc/init.d/xinetd restart
Now our TFTP server is up and running.
Testing our TFTP server
Create a file named test with some content in
/tftpbootpath of the TFTP serverObtain the IP address of the TFTP server using
ifconfigcommandNow in some other system follow the following steps.
tftp 192.168.1.2 tftp> get test Sent 159 bytes in 0.0 secondstftp> quit
cat test
Source: https://mohammadthalif.wordpress.com/2010/03/05/installing-and-testing-tftpd-in-ubuntudebian/
- 205
- 2,193
- 4
- 16
- 15
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.
- 20,916
-
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
-
-
Try renaming
vxworkstopxelinux.0, just to see whether my answer will work for future users. – nanofarad Oct 18 '12 at 20:40 -
-
@BЈовић This is somewhat of an old answer and I honestly do not know the procedure for 13.04. – nanofarad Sep 04 '13 at 11:02
-
You can install tftpd-hpa and change the configurations . Steps for installing tftpd-hpa is explained in this blog post.
- 159
-
2Whilst 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 06 '13 at 07:02
-
1upvoted you only because tftpd-hpa is a stupid simple tftp server to use and doesn't actually require any of the config needed in that post just drop your files in /var/lib/tftpboot and you are set (on ubuntu 16.04 not sure about other OS). – michael.schuett Jan 03 '17 at 04:25
%Error opening tftp://10.1.11.14/c2950-i6q4l2-mz.121-22.EA1b.bin (Permission denied) #copy flash:c2950-i6q4l2-mz.121-22.EA1b.bin tftp: Address or name of remote host []? 10.1.11.14 Destination filename [c2950-i6q4l2-mz.121-22.EA1b.bin]? TFTP: error code 2 received - Access violation
– Mohammad Rafiee Apr 08 '14 at 06:30sudo chmod -R 777 /tftpbootbetween 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/tftpbootin/etc/xinetd.d/tftpdid not seem to matter. Instead, the client looks in the directory/srv/tftpas 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/tftpinstead. – Gauthier Aug 28 '14 at 12:28toucha file with the filename I was about to put. Check this page as well: https://ubuntuforums.org/showthread.php?t=841766 – Kyr Aug 23 '16 at 14:30/etc/inetd.confand commented outtftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd --tftpd-timeout 300 --retry-timeout 5 --mcast-port 1758 --mcast-addr 239.239.239.0-255 --mcast-$using a #
– lithiumhead Sep 04 '17 at 11:09xinetd - which runs the service - has elevated access.
BTW it was working exactly as it was written Ubuntu 17.10 – V-Mark Jan 08 '18 at 19:21
error code 2 (access violation). To fix it puttftpboot -sinserver_args(no leading slash,-sat the end. Source: https://icesquare.com/wordpress/solvedtftp-error-code-2-access-violation/ – CharlesB Aug 31 '18 at 13:13