public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Help] in Setting up EFI Shell in QEMU to allow for HTTP Requests
@ 2023-02-13  8:47 CrossedCarpet
  2023-02-17 18:34 ` [edk2-devel] " Brian J. Johnson
  0 siblings, 1 reply; 3+ messages in thread
From: CrossedCarpet @ 2023-02-13  8:47 UTC (permalink / raw)
  To: devel@edk2.groups.io

[-- Attachment #1: Type: text/plain, Size: 1319 bytes --]

Greetings,
I want to create an UEFI App with internet connection.

Before I start developing the code, I wanted to make sure my setup is working properly so that the app can make http requests.
To that end, I spent the last days trying to make the `http` command work in the EFI Shell launched inside QEMU.
I can get the ping command to work properly, but calling:
http httpbin.org/get
Always returns:
Unable to open http protocol on `eth0` - Unsupported
Unable to download the file `/get` on `eth0` - Unsupported

This is my startup.nsh script to configure the interface:
connect
ifconfig -r eth0
ifconfig -s eth0 dhcp
ifconfig -l eth0

These were my different attempts at invoking Qemu properly:
        -netdev user,id=mynet0,hostfwd=tcp::8080-:80 -device e1000,netdev=mynet0 \
        -netdev user,id=user.0 -device e1000,netdev=user.0 \
        -nic user,ipv6=off,model=e1000,mac=52:54:98:76:54:32 \

And following this guide<https://gist.github.com/extremecoders-re/e8fd8a67a515fee0c873dcafc81d811c> I tried to setup a tap, but no dice:
        -netdev tap,id=mynet0,ifname=tap0,script=no,downscript=no -device e1000,netdev=mynet0,mac=52:55:00:d1:55:01 \

Have you ever achieved this? What was your setup like?

Thank you for your time.

[-- Attachment #2: Type: text/html, Size: 5909 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [edk2-devel] [Help] in Setting up EFI Shell in QEMU to allow for HTTP Requests
  2023-02-13  8:47 [Help] in Setting up EFI Shell in QEMU to allow for HTTP Requests CrossedCarpet
@ 2023-02-17 18:34 ` Brian J. Johnson
  2023-02-18  8:32   ` CrossedCarpet
  0 siblings, 1 reply; 3+ messages in thread
From: Brian J. Johnson @ 2023-02-17 18:34 UTC (permalink / raw)
  To: devel, crossedcarpet

[-- Attachment #1: Type: text/plain, Size: 2093 bytes --]

Are you sure you have the HttpDxe driver in your OVMF build?  Looks like 
you'd need to build with either -D NETWORK_HTTP_ENABLE or -D 
NETWORK_HTTP_BOOT_ENABLE.

See https://github.com/tianocore/edk2/blob/master/OvmfPkg/README for 
details on HTTPS.

*Brian J. Johnson
*Hewlett Packard Enterprise

**

------------------------------------------------------------------------
*From:* CrossedCarpet [mailto:crossedcarpet@hotmail.com]
*Sent:* Monday, February 13, 2023 at 2:47 AM
*To:* devel@edk2.groups.io <devel@edk2.groups.io>
*Subject:* [edk2-devel] [Help] in Setting up EFI Shell in QEMU to allow 
for HTTP Requests

> Greetings,
> I want to create an UEFI App with internet connection.
>
> Before I start developing the code, I wanted to make sure my setup is 
> working properly so that the app can make http requests.
> To that end, I spent the last days trying to make the `http` command 
> work in the EFI Shell launched inside QEMU.
> I can get the ping command to work properly, but calling:
>
>     http httpbin.org/get
>
> Always returns:
>
>     Unable to open http protocol on `eth0` - Unsupported
>     Unable to download the file `/get` on `eth0` - Unsupported
>
>
> This is my startup.nsh script to configure the interface:
>
>     connect
>     ifconfig -r eth0
>     ifconfig -s eth0 dhcp
>     ifconfig -l eth0
>
>
> These were my different attempts at invoking Qemu properly:
>         -netdev user,id=mynet0,hostfwd=tcp::8080-:80 -device 
> e1000,netdev=mynet0 \
>         -netdev user,id=user.0 -device e1000,netdev=user.0 \
>         -nic user,ipv6=off,model=e1000,mac=52:54:98:76:54:32 \
>
> And following this guide 
> <https://gist.github.com/extremecoders-re/e8fd8a67a515fee0c873dcafc81d811c> I 
> tried to setup a tap, but no dice:
>         -netdev tap,id=mynet0,ifname=tap0,script=no,downscript=no 
> -device e1000,netdev=mynet0,mac=52:55:00:d1:55:01 \
>
> Have you ever achieved this? What was your setup like?
>
> Thank you for your time.
> 



[-- Attachment #2: Type: text/html, Size: 10034 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [edk2-devel] [Help] in Setting up EFI Shell in QEMU to allow for HTTP Requests
  2023-02-17 18:34 ` [edk2-devel] " Brian J. Johnson
@ 2023-02-18  8:32   ` CrossedCarpet
  0 siblings, 0 replies; 3+ messages in thread
From: CrossedCarpet @ 2023-02-18  8:32 UTC (permalink / raw)
  To: Brian J. Johnson, devel

[-- Attachment #1: Type: text/plain, Size: 306 bytes --]

Hello,

Yes that was exactly the problem, someone helped me solve it on StackOverflow: https://stackoverflow.com/questions/75452349/setting-up-the-efi-shell-in-qemu-to-allow-for-http-requests/75458138#75458138

I hadn't noticed those instructions in the readme though, thank you for that.

Cheers.

[-- Attachment #2: Type: text/html, Size: 334 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-02-18  8:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-13  8:47 [Help] in Setting up EFI Shell in QEMU to allow for HTTP Requests CrossedCarpet
2023-02-17 18:34 ` [edk2-devel] " Brian J. Johnson
2023-02-18  8:32   ` CrossedCarpet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox