Coping files to Efi Shell throu network












2














I have a question, Is it possible to copy file to efi using some sort of protocol?



Example I am having computer and virtual machine, virtual machine boots to efi and I need to copy file on it and then execute it in efi environment.



Is it possible?










share|improve this question


















  • 1




    In theory, yes. In practice, you'll need a complete TCP/IP stack, with everything from network card drivers up to a client or server for FTP, SSH, or some other protocol that can be used to transfer files. Most (maybe all) of the parts exist, but not necessarily for every system -- you might be thwarted by lack of a driver for your network hardware, for instance. Beyond that, you'll need to track down every piece, and I'm afraid I can't provide pointers to any of it, at least not in ready-to-use binary form. (TianoCore provides parts in source code form.)
    – Rod Smith
    Mar 7 '17 at 14:22
















2














I have a question, Is it possible to copy file to efi using some sort of protocol?



Example I am having computer and virtual machine, virtual machine boots to efi and I need to copy file on it and then execute it in efi environment.



Is it possible?










share|improve this question


















  • 1




    In theory, yes. In practice, you'll need a complete TCP/IP stack, with everything from network card drivers up to a client or server for FTP, SSH, or some other protocol that can be used to transfer files. Most (maybe all) of the parts exist, but not necessarily for every system -- you might be thwarted by lack of a driver for your network hardware, for instance. Beyond that, you'll need to track down every piece, and I'm afraid I can't provide pointers to any of it, at least not in ready-to-use binary form. (TianoCore provides parts in source code form.)
    – Rod Smith
    Mar 7 '17 at 14:22














2












2








2







I have a question, Is it possible to copy file to efi using some sort of protocol?



Example I am having computer and virtual machine, virtual machine boots to efi and I need to copy file on it and then execute it in efi environment.



Is it possible?










share|improve this question













I have a question, Is it possible to copy file to efi using some sort of protocol?



Example I am having computer and virtual machine, virtual machine boots to efi and I need to copy file on it and then execute it in efi environment.



Is it possible?







efi






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Feb 15 '17 at 13:40









Wojciech Szabowicz

1134




1134








  • 1




    In theory, yes. In practice, you'll need a complete TCP/IP stack, with everything from network card drivers up to a client or server for FTP, SSH, or some other protocol that can be used to transfer files. Most (maybe all) of the parts exist, but not necessarily for every system -- you might be thwarted by lack of a driver for your network hardware, for instance. Beyond that, you'll need to track down every piece, and I'm afraid I can't provide pointers to any of it, at least not in ready-to-use binary form. (TianoCore provides parts in source code form.)
    – Rod Smith
    Mar 7 '17 at 14:22














  • 1




    In theory, yes. In practice, you'll need a complete TCP/IP stack, with everything from network card drivers up to a client or server for FTP, SSH, or some other protocol that can be used to transfer files. Most (maybe all) of the parts exist, but not necessarily for every system -- you might be thwarted by lack of a driver for your network hardware, for instance. Beyond that, you'll need to track down every piece, and I'm afraid I can't provide pointers to any of it, at least not in ready-to-use binary form. (TianoCore provides parts in source code form.)
    – Rod Smith
    Mar 7 '17 at 14:22








1




1




In theory, yes. In practice, you'll need a complete TCP/IP stack, with everything from network card drivers up to a client or server for FTP, SSH, or some other protocol that can be used to transfer files. Most (maybe all) of the parts exist, but not necessarily for every system -- you might be thwarted by lack of a driver for your network hardware, for instance. Beyond that, you'll need to track down every piece, and I'm afraid I can't provide pointers to any of it, at least not in ready-to-use binary form. (TianoCore provides parts in source code form.)
– Rod Smith
Mar 7 '17 at 14:22




In theory, yes. In practice, you'll need a complete TCP/IP stack, with everything from network card drivers up to a client or server for FTP, SSH, or some other protocol that can be used to transfer files. Most (maybe all) of the parts exist, but not necessarily for every system -- you might be thwarted by lack of a driver for your network hardware, for instance. Beyond that, you'll need to track down every piece, and I'm afraid I can't provide pointers to any of it, at least not in ready-to-use binary form. (TianoCore provides parts in source code form.)
– Rod Smith
Mar 7 '17 at 14:22










2 Answers
2






active

oldest

votes


















0














If you just want to execute a remote EFI binary, look for the "rload" command if its available in your EFI shell.



This uses TFTP. And this assume your EFI has network drivers and all.



In my shell, haven't found a command to actually copy the remote file to the filesystem, which is kind of annoying.






share|improve this answer





























    0














    Well, when i started developing EFI applications, i found the same problem. How to send file on EFI environment? For now i know these ways:



    1. USB storage device.



    Probably the easiest way if you copy files not too often. Just put files on USB flash drive and connect it to virtual machine (VM).



    To access file from EFI environment you need EFI shell or something like that. VMware already has integrated shell, while on other VMs you may need to obtain it. To do this you can use wonderful rEFInd Boot Manager, which contains shell. Unzip it, insert iso image in VM's CD-ROM and boot from it. In the rEFInd menu choose "Start EFI Shell". You will see command prompt, where all storage devices mapped as FS0, FS1,... If you see only FS0 (rEFInd file system), then you probably forgot to connect USB drive to VM.



    Now to get your file just type commands like this:



    fs1:
    cd directory_with_file


    All shell commands can be found by help command.



    2. Transfer via TFTP.



    Longer to setup, faster to use. Nice if you send files often, while developing EFI applications for example. For this method you need TFTP server like tftpd-hpa working (it could be on your host machine), EFI Shell + TFTP client on your VM. There is plenty information about starting TFTP server, so you can find manual yourself. Also it is nice to have DHCP server (it is optional, but configuration will be much easier with DHCP).



    TFTP client can be built from Tianocore sources or downloaded as x64 precompiled binary from my cloud (i dont know why Tianocore maintainers do not provide it in binary). Put tftp.efi on your VM somewhere you can access it (USB drive or virtual HDD). Put your file in TFTP root directory (like /srv/tftp). Probably you should turn your VM's network adapter into bridge mode, so it has real ip, if you want to use DHCP. Start EFI shell VM as described above. When you see command prompt, type these commands.



    ifconfig -s eth0 dhcp
    fs1:
    cd destination_directory
    tftp 192.168.3.1 file_to_copy


    Where:





    • eth0 is your network adapter, you can find required one with ifconfig -l. Also you can use static ip instead of dhcp, see help ifconfig


    • fs1: is your file system with tftp.efi, it could be fs0: or other depends on your booting device


    • tftp is tftp.efi app, 192.168.3.1 is ip address of TFTP server (host machine or real server)


    Also you can write this commands in startup.nsh file in the root of your bootable file system to do it on VM loading. Or only last line in another *.nsh script file to download while EFI running.



    3. QEMU virtual machine



    It is very handy for simple testings, you do not need TFTP, DHCP, USB drive, etc. If it is ok to recreate VM each time you boot, there is wonderful article about creating and debugging EFI applications with QEMU on osdev.org.






    share|improve this answer





















      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "3"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1179084%2fcoping-files-to-efi-shell-throu-network%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      0














      If you just want to execute a remote EFI binary, look for the "rload" command if its available in your EFI shell.



      This uses TFTP. And this assume your EFI has network drivers and all.



      In my shell, haven't found a command to actually copy the remote file to the filesystem, which is kind of annoying.






      share|improve this answer


























        0














        If you just want to execute a remote EFI binary, look for the "rload" command if its available in your EFI shell.



        This uses TFTP. And this assume your EFI has network drivers and all.



        In my shell, haven't found a command to actually copy the remote file to the filesystem, which is kind of annoying.






        share|improve this answer
























          0












          0








          0






          If you just want to execute a remote EFI binary, look for the "rload" command if its available in your EFI shell.



          This uses TFTP. And this assume your EFI has network drivers and all.



          In my shell, haven't found a command to actually copy the remote file to the filesystem, which is kind of annoying.






          share|improve this answer












          If you just want to execute a remote EFI binary, look for the "rload" command if its available in your EFI shell.



          This uses TFTP. And this assume your EFI has network drivers and all.



          In my shell, haven't found a command to actually copy the remote file to the filesystem, which is kind of annoying.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Apr 20 '17 at 16:22









          user438311

          1011




          1011

























              0














              Well, when i started developing EFI applications, i found the same problem. How to send file on EFI environment? For now i know these ways:



              1. USB storage device.



              Probably the easiest way if you copy files not too often. Just put files on USB flash drive and connect it to virtual machine (VM).



              To access file from EFI environment you need EFI shell or something like that. VMware already has integrated shell, while on other VMs you may need to obtain it. To do this you can use wonderful rEFInd Boot Manager, which contains shell. Unzip it, insert iso image in VM's CD-ROM and boot from it. In the rEFInd menu choose "Start EFI Shell". You will see command prompt, where all storage devices mapped as FS0, FS1,... If you see only FS0 (rEFInd file system), then you probably forgot to connect USB drive to VM.



              Now to get your file just type commands like this:



              fs1:
              cd directory_with_file


              All shell commands can be found by help command.



              2. Transfer via TFTP.



              Longer to setup, faster to use. Nice if you send files often, while developing EFI applications for example. For this method you need TFTP server like tftpd-hpa working (it could be on your host machine), EFI Shell + TFTP client on your VM. There is plenty information about starting TFTP server, so you can find manual yourself. Also it is nice to have DHCP server (it is optional, but configuration will be much easier with DHCP).



              TFTP client can be built from Tianocore sources or downloaded as x64 precompiled binary from my cloud (i dont know why Tianocore maintainers do not provide it in binary). Put tftp.efi on your VM somewhere you can access it (USB drive or virtual HDD). Put your file in TFTP root directory (like /srv/tftp). Probably you should turn your VM's network adapter into bridge mode, so it has real ip, if you want to use DHCP. Start EFI shell VM as described above. When you see command prompt, type these commands.



              ifconfig -s eth0 dhcp
              fs1:
              cd destination_directory
              tftp 192.168.3.1 file_to_copy


              Where:





              • eth0 is your network adapter, you can find required one with ifconfig -l. Also you can use static ip instead of dhcp, see help ifconfig


              • fs1: is your file system with tftp.efi, it could be fs0: or other depends on your booting device


              • tftp is tftp.efi app, 192.168.3.1 is ip address of TFTP server (host machine or real server)


              Also you can write this commands in startup.nsh file in the root of your bootable file system to do it on VM loading. Or only last line in another *.nsh script file to download while EFI running.



              3. QEMU virtual machine



              It is very handy for simple testings, you do not need TFTP, DHCP, USB drive, etc. If it is ok to recreate VM each time you boot, there is wonderful article about creating and debugging EFI applications with QEMU on osdev.org.






              share|improve this answer


























                0














                Well, when i started developing EFI applications, i found the same problem. How to send file on EFI environment? For now i know these ways:



                1. USB storage device.



                Probably the easiest way if you copy files not too often. Just put files on USB flash drive and connect it to virtual machine (VM).



                To access file from EFI environment you need EFI shell or something like that. VMware already has integrated shell, while on other VMs you may need to obtain it. To do this you can use wonderful rEFInd Boot Manager, which contains shell. Unzip it, insert iso image in VM's CD-ROM and boot from it. In the rEFInd menu choose "Start EFI Shell". You will see command prompt, where all storage devices mapped as FS0, FS1,... If you see only FS0 (rEFInd file system), then you probably forgot to connect USB drive to VM.



                Now to get your file just type commands like this:



                fs1:
                cd directory_with_file


                All shell commands can be found by help command.



                2. Transfer via TFTP.



                Longer to setup, faster to use. Nice if you send files often, while developing EFI applications for example. For this method you need TFTP server like tftpd-hpa working (it could be on your host machine), EFI Shell + TFTP client on your VM. There is plenty information about starting TFTP server, so you can find manual yourself. Also it is nice to have DHCP server (it is optional, but configuration will be much easier with DHCP).



                TFTP client can be built from Tianocore sources or downloaded as x64 precompiled binary from my cloud (i dont know why Tianocore maintainers do not provide it in binary). Put tftp.efi on your VM somewhere you can access it (USB drive or virtual HDD). Put your file in TFTP root directory (like /srv/tftp). Probably you should turn your VM's network adapter into bridge mode, so it has real ip, if you want to use DHCP. Start EFI shell VM as described above. When you see command prompt, type these commands.



                ifconfig -s eth0 dhcp
                fs1:
                cd destination_directory
                tftp 192.168.3.1 file_to_copy


                Where:





                • eth0 is your network adapter, you can find required one with ifconfig -l. Also you can use static ip instead of dhcp, see help ifconfig


                • fs1: is your file system with tftp.efi, it could be fs0: or other depends on your booting device


                • tftp is tftp.efi app, 192.168.3.1 is ip address of TFTP server (host machine or real server)


                Also you can write this commands in startup.nsh file in the root of your bootable file system to do it on VM loading. Or only last line in another *.nsh script file to download while EFI running.



                3. QEMU virtual machine



                It is very handy for simple testings, you do not need TFTP, DHCP, USB drive, etc. If it is ok to recreate VM each time you boot, there is wonderful article about creating and debugging EFI applications with QEMU on osdev.org.






                share|improve this answer
























                  0












                  0








                  0






                  Well, when i started developing EFI applications, i found the same problem. How to send file on EFI environment? For now i know these ways:



                  1. USB storage device.



                  Probably the easiest way if you copy files not too often. Just put files on USB flash drive and connect it to virtual machine (VM).



                  To access file from EFI environment you need EFI shell or something like that. VMware already has integrated shell, while on other VMs you may need to obtain it. To do this you can use wonderful rEFInd Boot Manager, which contains shell. Unzip it, insert iso image in VM's CD-ROM and boot from it. In the rEFInd menu choose "Start EFI Shell". You will see command prompt, where all storage devices mapped as FS0, FS1,... If you see only FS0 (rEFInd file system), then you probably forgot to connect USB drive to VM.



                  Now to get your file just type commands like this:



                  fs1:
                  cd directory_with_file


                  All shell commands can be found by help command.



                  2. Transfer via TFTP.



                  Longer to setup, faster to use. Nice if you send files often, while developing EFI applications for example. For this method you need TFTP server like tftpd-hpa working (it could be on your host machine), EFI Shell + TFTP client on your VM. There is plenty information about starting TFTP server, so you can find manual yourself. Also it is nice to have DHCP server (it is optional, but configuration will be much easier with DHCP).



                  TFTP client can be built from Tianocore sources or downloaded as x64 precompiled binary from my cloud (i dont know why Tianocore maintainers do not provide it in binary). Put tftp.efi on your VM somewhere you can access it (USB drive or virtual HDD). Put your file in TFTP root directory (like /srv/tftp). Probably you should turn your VM's network adapter into bridge mode, so it has real ip, if you want to use DHCP. Start EFI shell VM as described above. When you see command prompt, type these commands.



                  ifconfig -s eth0 dhcp
                  fs1:
                  cd destination_directory
                  tftp 192.168.3.1 file_to_copy


                  Where:





                  • eth0 is your network adapter, you can find required one with ifconfig -l. Also you can use static ip instead of dhcp, see help ifconfig


                  • fs1: is your file system with tftp.efi, it could be fs0: or other depends on your booting device


                  • tftp is tftp.efi app, 192.168.3.1 is ip address of TFTP server (host machine or real server)


                  Also you can write this commands in startup.nsh file in the root of your bootable file system to do it on VM loading. Or only last line in another *.nsh script file to download while EFI running.



                  3. QEMU virtual machine



                  It is very handy for simple testings, you do not need TFTP, DHCP, USB drive, etc. If it is ok to recreate VM each time you boot, there is wonderful article about creating and debugging EFI applications with QEMU on osdev.org.






                  share|improve this answer












                  Well, when i started developing EFI applications, i found the same problem. How to send file on EFI environment? For now i know these ways:



                  1. USB storage device.



                  Probably the easiest way if you copy files not too often. Just put files on USB flash drive and connect it to virtual machine (VM).



                  To access file from EFI environment you need EFI shell or something like that. VMware already has integrated shell, while on other VMs you may need to obtain it. To do this you can use wonderful rEFInd Boot Manager, which contains shell. Unzip it, insert iso image in VM's CD-ROM and boot from it. In the rEFInd menu choose "Start EFI Shell". You will see command prompt, where all storage devices mapped as FS0, FS1,... If you see only FS0 (rEFInd file system), then you probably forgot to connect USB drive to VM.



                  Now to get your file just type commands like this:



                  fs1:
                  cd directory_with_file


                  All shell commands can be found by help command.



                  2. Transfer via TFTP.



                  Longer to setup, faster to use. Nice if you send files often, while developing EFI applications for example. For this method you need TFTP server like tftpd-hpa working (it could be on your host machine), EFI Shell + TFTP client on your VM. There is plenty information about starting TFTP server, so you can find manual yourself. Also it is nice to have DHCP server (it is optional, but configuration will be much easier with DHCP).



                  TFTP client can be built from Tianocore sources or downloaded as x64 precompiled binary from my cloud (i dont know why Tianocore maintainers do not provide it in binary). Put tftp.efi on your VM somewhere you can access it (USB drive or virtual HDD). Put your file in TFTP root directory (like /srv/tftp). Probably you should turn your VM's network adapter into bridge mode, so it has real ip, if you want to use DHCP. Start EFI shell VM as described above. When you see command prompt, type these commands.



                  ifconfig -s eth0 dhcp
                  fs1:
                  cd destination_directory
                  tftp 192.168.3.1 file_to_copy


                  Where:





                  • eth0 is your network adapter, you can find required one with ifconfig -l. Also you can use static ip instead of dhcp, see help ifconfig


                  • fs1: is your file system with tftp.efi, it could be fs0: or other depends on your booting device


                  • tftp is tftp.efi app, 192.168.3.1 is ip address of TFTP server (host machine or real server)


                  Also you can write this commands in startup.nsh file in the root of your bootable file system to do it on VM loading. Or only last line in another *.nsh script file to download while EFI running.



                  3. QEMU virtual machine



                  It is very handy for simple testings, you do not need TFTP, DHCP, USB drive, etc. If it is ok to recreate VM each time you boot, there is wonderful article about creating and debugging EFI applications with QEMU on osdev.org.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Dec 12 at 17:10









                  Dmitry

                  1




                  1






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Super User!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.





                      Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                      Please pay close attention to the following guidance:


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1179084%2fcoping-files-to-efi-shell-throu-network%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Probability when a professor distributes a quiz and homework assignment to a class of n students.

                      Aardman Animations

                      Are they similar matrix