Quantcast
Channel: iPXE discussion forum - All Forums
Viewing all 1484 articles
Browse latest View live

Option ROM with support for 2 device ids

$
0
0
I am trying to build an Option ROM for a system with dual, different, network cards.
Is this possible out of the box or does it involve some Makefile magic?

/Ulf

using ipxe.lkrn and script in grub.conf crashes

$
0
0
Hi, all,

I plan to use ipxe to kickstart upgrade the OS on about 100 servers in different buildings with static IP settings.

In my testing VM using VirtualBox, I tried to use ipxe.lkrn and my custom script for this, I first boot using existing grub.efi and load grub.conf, I set the default to the ipxe.lkrn boot options. My grub.conf has the following, note (hd0,1) corresponds to /boot, (hd0,0) corresponds to /boot/efi

# tail grub.conf
title ipxeboot
root (hd0,1)
kernel (hd0,1)/ipxe.lkrn initrd=myscript.ipxe
initrd (hd0,1)/myscript.ipxe

the myscript.ipxe has: (I have two interfaces net0 is dhcp, net1 is host-only static interface used to download from ftp/http server)
#!ipxe
echo "Setting up the network interfaces"
ifopen
dhcp
set net1/ip 192.168.56.155
set net1/netmask 255.255.255.0
ifstat
chain http://192.168.56.150/ftp/ipxe/bootscript.ipxe

However, when I boot with these settings, the vm instantly crashes. It seems that it crashes after allocating pages for the kernel. This documentation http://ipxe.org/embed says it will work. Could anyone help?


Note: I was able to chainload grub.efi to ipxe.efi with embedded script to upgrade the OS. However, I have to build the ipxe.efi binary for each server to update with a specific IP it will use.
For example,

In grub.conf I have
title use ipxe
root (hd0,0)
chainloader /EFI/redhat/ipxe.efi

My ipxe.efi builds in with the following script
#!ipxe
echo "Setting up the network interfaces"
ifopen
dhcp
set net1/ip 192.168.56.155
set net1/netmask 255.255.255.0
ifstat
chain http://192.168.56.150/ftp/ipxe/bootscript.ipxe

My bootscript.ipxe has

#!ipxe
echo "Setting up the network interfaces"
ifopen
dhcp
set net1/ip 192.168.56.155
set net1/netmask 255.255.255.0

kernel http://192.168.56.150/ftp/tree/isolinux/vmlinuz initrd=initrd.img ks=http://192.168.56.150/ftp/tmp/test-ks.cfg ro root=live:http://192.168.56.150/ftp/tree/LiveOS/squashfs.img inst.repo=http://192.168.56.150/ftp/tree other kernel arguments ...
initrd http://192.168.56.150/ftp/tree/isolinux/initrd.img
boot

Since I have > 100 machines, I have to set the ip differently in the myscript.ipxe and bootscript.ipxe for each machine, which means I have to compile/embed the ipxe.efi with the scripts differently for each machine. This is not elegant as using the ipxe.lkrn, where I only need to distribute the myscript.ipxe with correct IP, no need to build the ipxe.efi.

Thanks

chainload EFI from alternate TFTP server

$
0
0
We use PXE boot to bring up a custom grub menu (pxelinux.cfg/default) when installing a new system. From this menu we can choose the OS which will then get installed over the network.

I now need to add the Solaris 11 to this menu, but it resides on a different TFTP server.
All I want this entry to say is: load this boot image ( grub2netx64.efi ) from that TFTP server.
I thought I could get away with something like:
kernel chain.c32 (or pxechain.com or pxechn.c32)
append <tftp_server_ip>::grub2netx64.efi (or tftp://<server_ip>/grub2netx64.efi)

But it seems I can't chainload (is that even the right term?) an efi image.
I looked into switching to grub2, but I have been thoroughly unable to find how to rewrite my menu items in grub.cfg so I gave that up. I couldn't even get the simple "localboot 0" to work.

Can iPXE be of help to me?
Thanks for your help.
D

Apple Thunderbolt Ethernet LINK DOWN

$
0
0
Hello @ll,

I'm trying to boot Macbooks via IPXE into a Linux System. I created a NBI which delivers the ipxe.efi to the Macbook. This part works fine.
IPXE also recognizes the Thunderbolt adapter as 14e4-1682 and tells me
[link status: Down (http://ipxe.org/38086193)]
Waiting for link up on net0................. Down (http://ipxe.org/38086193)

The Link never goes up.
On the switch I see the Linkstatus going down and up everytime ipxe tries but there seems to be a problem with the driver.

Has anybody had a similar problem or knows how to fix it. I know for sure there was one version of IPXe maybe 2-3 years ago where this worked. But I never noted the release and after recompiling a new start script via rom-o-matic it stopped working :-(
I also found THIS thread about a similar problem but there was no solution mentioned.

Thank you for helping out!

G.

How to boot live windows 10

$
0
0
Dear all

How can I use iPXE boot to live windows ?

I am trying to put a live windows ISO in web server, end user can boot to this windows via iPXE.

I tried to capture a live windows image into a WIM file, and use wimboot to boot it, but as the file size of this WIM file is greater than 4G....I got an error when I tried to do so

Is there any suggestions?

Thanks in advance

Yuhua

iPXE with Serva?

$
0
0
I am new to PXE booting, and unfortunately the duty falls to me to set up this mess, so I decided to use Serva . Which has worked beautifully. Until now, we are going to be opening a new service, PXE booting via Embedded USB, but before we start that I need to be able to use iPXE to boot from Serva, I have ABSOLUTELY not idea how to do that, so I've decided to post here, maybe you can help, I can provide any info you guys need, (Except IP's for Security reasons.)

Thanks so much

iPXE Block IO stub breaks grubnet

$
0
0
I am having the exact problem described here: https://lists.gnu.org/archive/html/help-...00082.html

However, I am using grub2netx64.efi from Solaris and it's going to be a lot harder to get Oracle to work on a fix for this iPXE particularity.

Below is a description, from the Ubuntu patch, of what causes the problem:

Subject: [PATCH] disk/efi: skip iPXE dummy block devices
iPXE adds Simple File System Protocol to loaded image handle, as side
effect it also adds Block IO protocol (according to comments, to work
around some bugs in EDK2). GRUB assumes that every device with Block IO
is disk and skips network initialization entirely. But iPXE Block IO
implementation is just a stub which always fails for every operation
so cannot be used. Attempt to detect and skip such devices.

And a comment on the nature of the fix:
We are using media ID which iPXE sets to "iPXE" and block IO size in
hope that no real device would announce 1B block ...

The fix is:
--- a/grub-core/disk/efi/efidisk.c
+++ b/grub-core/disk/efi/efidisk.c
@@ -80,6 +80,14 @@ make_devices (void)
/* This should not happen... Why? */
continue;

+ /* iPXE adds stub Block IO protocol to loaded image device handle. It is
+ completely non-functional and simply returns an error for every method.
+ So attempt to detect and skip it. Magic number is literal "iPXE" and
+ check block size as well */
+ if (bio->media && bio->media->media_id == 0x69505845U &&
+ bio->media->block_size == 1)
+ continue;
+
d = grub_malloc (sizeof (*d));
if (! d)
{


Since I have little to no hope of seeing a similar fix from Oracle any time soon, can anyone suggest a workaround I can use?

Thanks.
Darie

Sanhook takes a long time

$
0
0
Hello,
This is my boot script

#!ipxe
dhcp
echo "Adding SCSI"
set username behrooz
set password behpass
set keep-san 1
set initiator-iqn iqn.1993-08.org.debian:01:a87a0bc571c
sanhook iscsi:10.10.0.111::::iqn.2003-01.org.linux-iscsi.vdi.x8664Confusedn.e5d7a4882dbf
echo "here"

the issue is, sanhook takes a long to hook so reaching the echo "here" takes a long time (60-80 seconds), any ideas?

Sanhook And Iso HTTP boot

$
0
0
Hello And thanks for IPXE

this is my script, goal is to attach SAN device and boot windows iso images.
(using wimpe is not possible due to architectural limitations of the project)

#!ipxe
dhcp
echo "Adding SCSI"
set username behrooz
set password behpass
set keep-san 1
set initiator-iqn iqn.1993-08.org.debian:01:a87a0bc571c
sanhook iscsi:10.10.0.111::::iqn.2003-01.org.linux-iscsi.vdi.x8664Confusedn.e5d7a4882dbf
sanboot --drive 0x81 --no-describe http://192.168.65.3/Images/ISOs/win7.iso

now problem is, windows boot manager starts and returns error 0xc0000225 (https://neosmart.net/wiki/0xc0000225/)

any ideas?

iPXE as PXE servers discover tool

$
0
0
Hi all

I have discovered iPXE today, so I'm quite new here.. :-)

Very often I have a need to discover PXE servers within the LAN.
I mean I need to know :
* is pxe server coming via DHCP options 60, 66-67 and what these options are
* is pxe server coming via local network (pxe and client are on the same network)
* is pxe server coming via ipHelpers

So, in short, I need a way to simulate a PXE request and analyze the answer.
So far I have discovered, that booting a computer from ipxi.iso and performing:
dhcp
config => proxyDHCP
gives me that information (at least in case, that DHCP, PXE Server and client are within the same subnet).

However this doesn't work on UEFI computer.

May I ask how can I accomplish that? Probably a properly deployed/configured Virtualbox VM with iPXE on it will do the tricks, that I need.

So that I could a have simple , small , solution, that will do the diagnostic for UEFI and BIOS machines.

Thank you in advanced and best regards

Can't boot Windows/Ubuntu installer on new ThinkPad 13

$
0
0
Hello,

I have successfully booted the Windows 10 and Ubuntu 16.04 installer on different model of PC. Newer laptops often lack of network adapter built-in but I found that USB adapter were working great.

I received two Lenovo ThinkPad 13 G2 laptop. I can't boot the Windows or Ubuntu installer on theses laptops with IPXE and USB network adapter.

IPXE boot and display the boot menu. I select the item I want to boot. I see that the boot image is being downloader and then nothing. The windows installer stay stalled on the Windows logo and the Ubuntu installer just do nothing.

I built IPXE from source and I use this binary on my TFTP server: ./src/bin-x86_64-efi/ipxe.efi. The computer is configured to boot with EFI and Secure boot is disabled.

This is an extract of my menu.ipxe configuration:
Code:
...

:windows_10_pro_volume
kernel ${boot-url}/windows_10_pro_volume/wimboot
initrd ${boot-url}/windows_10_pro_volume/boot/bcd         BCD
initrd ${boot-url}/windows_10_pro_volume/boot/boot.sdi    boot.sdi
initrd ${boot-url}/windows_10_pro_volume/sources/boot.wim boot.wim
boot

:ubuntu_1604_netboot_developpeurs
kernel ${boot-url}/ubuntu/16.04_netboot/linux initrd=initrd.gz auto=true priority=high vga=788 locale=fr_CA.UTF-8 kdb-chooser/method=cf url=http://webdav:ghl514@nasqc.som.ca:8080/ipxe$
initrd http://webdav:ghl514@nasqc.som.ca:8080/ipxe/images/ubuntu/16.04_netboot/initrd.gz
boot || goto failed
goto start

...

I'm running the latest version available of IPXE on the git repository (commit b5e0b5). I had a previous version before and was not working too.

Any idea what's wrong?

Thanks!

Do you have a trial version of iPXE?

$
0
0
Hello everyone. I want to experience a iPEX but Do you have a trial version of iPXE? Thanks very much.

wimboot using grub2 on EFI

$
0
0
Hi,
I'm an happy user of wimboot from grub2 on my usb stick, I can start windows 10 setup, dart even with files withing an iso file.
Unfortunately I'm unable to make it work in efi:
  • load16 does not work (looks like it does not execute any code at all)
  • chainloading snponly.efi stops when I call boot with "no such device" (in efi_image.c)
  • chainloading wimboot will map each file at the root of the usb stick, the same result of chainloading bootmgr.efi, so I have no advantages over it
  • loadefi says wimboot has invalid signature

Right now I'm using qemu with OVMF

If you need additional info just let me known

Various iPXE servers on net

$
0
0
Is it possible to make a program that first discover all servers and then let us choose to boot one?

Thanks for your time,

486er hangs on boot with iPXE floppy

$
0
0
Dear community,

I have restored my 486 DX2-66 MHz machine utilising 24 MB of RAM to work perfectly fine again, like back then.

Now I've came to the idea, why not use it's capabilities to forensically restore floppy disks, specifically reading from 5,25" and 3,5" drives saving stuff to a NAS.
Also for creating images of internal drives it would be nice to have something similar to dd or partimage.

Very nice, you may think.. boot off a 32bit CD and be a happy man. - Unfortunately the BIOS does only offer the boot options "A, C" and "C, A", which kind of limits my options to booting off a floppy disk.

I've tried SuSE 6.0, as I had this flying around still, and it works.. but not as good as it could. It is also a security risk to have such a thing running on the network, as there are no updates anymore.
For any newer version the kernel was too big to fit on a 1,445 MB floppy, and therefore I needed to dig deeper: Slackware Linux has the same problem... reasonable version numbers have a wayyy too big kernel to boot from a 3,5" floppy.. but the Slackware guys had a nice idea.. why not use PXE? - Just go ahead and write a floppy, boot from a network stored image, and magic surrounds the whole thing.

In theory this should have worked, BUT.. for starters the 486er boots quite nicely from the floppy disk showing:

Quote:Loading ROM image...................................

... but then freezes and never goes any further. - What might that be?
I have tried this floppy on all the other machines here and at work that have 3,5" floppy disk support.. and it works on all the other machines, even on VirtualBox, but not on the target machine..

Any ideas?

Advanced menu and advanced string parsing in iso image?

$
0
0
Hello. I'm wondering if it's possible to do any advanced menus putting a menu.pxe into the iso image prior to starting the chain load to my web server.

Here is what I'm interested in:

===== Install Menu =====

IP Address: <enter>
Hostname: <enter>
Netmask: <enter>
Gateway: <enter>

[ Build ] [ Shutdown ] [ Reboot ]

Be able to tab between all the options until the person is satisfied before pressing build?

Also I'd like to be able to rip apart the IP address and replace the last octet with a ".1" and use this as my default gateway. Easy/Hard/Impossible? I'm sure I could hack my way thru changing code but if it's possible to do it an easier way it would be nice to know.

Thanks!

Glen

python & ipxe - syntax errors

$
0
0
I am setting up a new infrastructure. Previous one used mod_python with the following script to handle some python work and then pass it to ipxe. On the new setup I am using mod_wsgi and I can not seem to get it to work.

Code:
<%
import requests, json, cgi

req.headers_out['Content-Type'] = 'text/plain'
req.content_type = req.headers_out['Content-Type']

ip = ""
default = ""
build = False

mac = cgi.parse_qs(req.args)["mac"][0]

r = requests.get('http://puppetnext.lab.beer.town/api/v2/hosts?search=has_mac=' + mac, auth=('user', 'password'), verify=False)
resultjson = r.json()["results"]
if len(resultjson) > 0:
        hostid = resultjson[0]["id"]

        hostr = requests.get('http://puppetnext.lab.beer.town/api/v2/hosts/' + str(hostid), auth=('user', 'password'), verify=False)
        ip = hostr.json()["ip"]
        build = hostr.json()["build"]

if ip:
        if build:
                default = "build"
        else:
                default = "local"
else:
        default = "discovery"

%>#!ipxe

menu Boot options for <% req.write(mac)%>
item --key l local              Continue with local boot
item --key d discovery          Boot foreman discovery image
item --key b build              Build local host <% req.write(ip)%>
choose --default <% req.write(default)%> --timeout 5000 target && goto ${target}

#Local
:local
exit

#Discovery
:discovery
# WORKING!!!!!!!!!!!
kernel boot/fdi-image/vmlinuz0
initrd boot/fdi-image/initrd0.img
imgargs vmlinuz0 rootflags=loop root=live:/fdi.iso rootfstype=auto ro rd.live.image acpi=force rd.luks=0 rd.md=0 rd.dm=0 rd.lvm=0 rd.bootif=0 rd.neednet=0 rd.debug=1 nomodeset BOOTIF=01-${net0/mac:hexhyp} proxy.url=http://<% req.write(req.hostname)%> proxy.type=foreman
#echo Information
#imgstat
#read void
echo Now Booting..
boot || goto failed
#iappend 2 for pxelinux is BOOTIF=01-${net0/mac:hexhyp} for iPXE

#WORKING CONFIG BUT DOES NOT AUTOMATICALLY DISCOVER WITH DHCP
#kernel http://<% req.write(req.hostname)%>:81/boot/fdi-image/vmlinuz0 rootflags=loop root=live:/fdi.iso rootfstype=auto ro rd.live.image acpi=force rd.luks=0 rd.md=0 rd.dm=0 rd.lvm=0 rd.bootif=0 rd.neednet=0 nomodeset proxy.url=https://<% req.write(req.hostname)%> proxy.type=foreman
#initrd http://<% req.write(req.hostname)%>:81/boot/fdi-image/initrd0.img
#boot

#Build
:build
chain http://<% req.write(req.hostname)%>/unattended/iPXE?mac=<% req.write(mac) %>

Before, this would execute the python script and then set the correct settings for the following ipxe script. Now I just seem to get python syntax errors.

Any idea whats going on here?
If I access it via boot.py:
Code:
[Thu Jan 04 08:40:31.583620 2018] [:error] [pid 11518] [client 100.91.160.19:55387] mod_wsgi (pid=11518): Exception occurred processing WSGI script '/usr/foremanipxe/boot.py'., referer: http://puppetnext.lab.beer.town:81/
[Thu Jan 04 08:40:31.583661 2018] [:error] [pid 11518] [client 100.91.160.19:55387]   File "/usr/foremanipxe/boot.py", line 1, referer: http://puppetnext.lab.beer.town:81/
[Thu Jan 04 08:40:31.583671 2018] [:error] [pid 11518] [client 100.91.160.19:55387]     <%, referer: http://puppetnext.lab.beer.town:81/
[Thu Jan 04 08:40:31.583674 2018] [:error] [pid 11518] [client 100.91.160.19:55387]     ^, referer: http://puppetnext.lab.beer.town:81/
[Thu Jan 04 08:40:31.583677 2018] [:error] [pid 11518] [client 100.91.160.19:55387] SyntaxError: invalid syntax, referer: http://puppetnext.lab.beer.town:81/

If I access it via just boot:
Code:
[Thu Jan 04 08:46:24.773479 2018] [authz_core:debug] [pid 11522] mod_authz_core.c(835): [client 100.91.160.19:55457] AH01628: authorization result: granted (no directives)
[Thu Jan 04 08:46:24.780514 2018] [:info] [pid 11522] [client 100.91.160.19:55457] mod_wsgi (pid=11522, process='', application='puppet.lab.beer.town:81|/boot'): Loading WSGI script '/usr/foremanipxe/boot.py'.
[Thu Jan 04 08:46:24.780771 2018] [:error] [pid 11522] [client 100.91.160.19:55457] mod_wsgi (pid=11522, process='', application='puppet.lab.beer.town:81|/boot'): Failed to parse WSGI script file '/usr/foremanipxe/boot.py'.
[Thu Jan 04 08:46:24.780789 2018] [:error] [pid 11522] [client 100.91.160.19:55457] mod_wsgi (pid=11522): Exception occurred processing WSGI script '/usr/foremanipxe/boot.py'.
[Thu Jan 04 08:46:24.780830 2018] [:error] [pid 11522] [client 100.91.160.19:55457]   File "/usr/foremanipxe/boot.py", line 1
[Thu Jan 04 08:46:24.780840 2018] [:error] [pid 11522] [client 100.91.160.19:55457]     <%
[Thu Jan 04 08:46:24.780843 2018] [:error] [pid 11522] [client 100.91.160.19:55457]     ^
[Thu Jan 04 08:46:24.780846 2018] [:error] [pid 11522] [client 100.91.160.19:55457] SyntaxError: invalid syntax





Conf
Code:
WSGIScriptAlias /boot /usr/foremanipxe/boot.py
<VirtualHost *:81>
  ServerAdmin non@none.com
  ServerName  puppet.lab.beer.town
  ServerAlias puppet
  DocumentRoot /usr/foremanipxe
  DirectoryIndex
  LogLevel Debug
  ErrorLog /var/log/httpd/ipxe_error.log
  CustomLog /var/log/httpd/ipxe_access.log  Combined
  <Directory /usr/foremanipxe >
     Options Indexes FollowSymLinks MultiViews ExecCGI
     AllowOverride None
     Order allow,deny
     allow from all
  </Directory>
</VirtualHost>

Network boot from UEFI Windows boot manager menu?

$
0
0
Hi all.
I's setting up an environment where an unattended machine managed remotely is running Windows, and can (on demand from the remote management) reboot into Clonezilla (stored on a server) to make or restore image of the windows disk, and boot back into Windows.
I have some experience using pxelinux with menu to boot clonezilla on BIOS-enabled machines, and would prefer to have a similar setup with UEFI. My first thought was to just interact with the UEFI boot manager from each OS, but AFAICT, there's no equivalent of efibootmgr for Windows - the options in Windows boot manager's menu are not normally synced with the UEFI boot manager's options, so it has no option to boot from the network.

So for my current attempt, I'm looking for a way to add a "network boot" option to WBM's menu (managed by bcdedit.exe) - the intention is to setup iPXE or something to boot clonezilla with appropriate options - either configured right there in BCD, or provided by a server by chainloading (WBM's boot entry boots a PXE boot manager with options pulled from the managing server).

Can iPXE be used in this scenario? If so, how to add it's entry into BCD?

French keyboard in UEFI mode

$
0
0
Hello,

French Keyboard is not working in the UEFI mode.
After booting on ipxe.efi binary, keyboard is always US even if I put the following config in console.sh

#define KEYBOARD_MAP fr

Any idea ?

Thanks in advance !

Request Method get/post?

$
0
0
Hello everyone. I'm converting my environment to use the params command rather than build my own url. I'm finding that the request to the webserver (launching the boot.php) is not receiving the post when I start the build of my server.

I dumped all the php variables and I'm finding the request being received by my webserver is a "get" and not a "post". In turn is not getting any of the variables I'm defining to be passed to the linux server build.

What dictates from the ipxe side the get/post function?

I basically do...

params --name test
param --params test ip ${ip}
param --params test hostname ${hostname}

and so on. On the server itself being created I dumped when is being seen by the webserver and these are not appearing. Maybe I'm not understanding how to decode this on the server side. I do see the boot.php script but it looks to me like an encoded number.

/ks/html/boot.php?=PHPE98744F37-D428-11D2-A769

Any ideas?

Thanks
Viewing all 1484 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>