Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion

Installing Open/Net/FreeBSD onto a KVM via PXE w/o DHCP service or TFTP required (HTTP/FTP).
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Installing Open/Net/FreeBSD onto a KVM via PXE w/o DHCP service or TFTP required (HTTP/FTP).

WSSWSS Member
edited December 2016 in Tutorials

One of the things I've found that I've had to do recently was to install an OS a couple days into waiting for a vendor to mount an ISO. That may be a tale all of it's own, but it's pretty boring, if not a bit annoying- kind of like me.

Without wasting too much space, it's quite possible to do, and isn't the most difficult, assuming you have gPXE, or better yet, iPXE available with your KVM build.

This host had an older 0.9.x version of gPXE, which is outdated, and pretty much EoL. Thankfully, it was new enough to support chaining, which I did with iPXE, which I used for my network-based installation.

I built my most recent master of iPXE, using rom-o-matic. You'll want the UNDI only build. Save it somewhere in an HTTP accessible place.

Boot your KVM with PXE enabled, and initialize the device (you may have to press Ctrl-B). First off, get your network settings. If they're DHCP, it's really simple:

gPXE>dhcp net0

if not, manually assign the static address:

gPXE>set net0/ip {ip4}
gPXE>set net0/netmask {netmask}
gPXE>set net0/gateway {gw}
gPXE>set net0/dns 8.8.8.8 {or your DNS}

Now, let's go online (not strictly necessary for some builds, but better safe):

gPXE>ifopen net0

Check your link state with ifstat, as necessary, and make any changes,

Now, if we want (need in my case) to roll into iPXE:

gPXE>chain http://myplace.com/undionly.pxe

Press Ctrl-B, and break into iPXE.

We're going to need to go through the network configuration all over again..

iPXE>dhcp net0

if not, manually assign the static address:

iPXE>set net0/ip {ip4}
iPXE>set net0/netmask {netmask}
iPXE>set net0/gateway {gw}
iPXE>set net0/dns 8.8.8.8 {or your DNS}

iPXE>ifopen net0

Now, we want to load our OS. We can chain to almost any ISO- but we want one designed to either bootstrap directly, or run from RAM. Thankfully enough, cdXX.iso does just that.

iPXE>sanboot http://your.local.copy/local/OpenBSD/X.Y/amd64/cdXY.iso

This will take awhile to load. Don't worry- grab a cup of coffee.

Important Information: As it loads, you'll note it chains to /bsd.rd, and loads the very basic system. Proceed to install as normal.

You can use the above methodology to install FreeBSD, using the 'bootonly' ISO, or NetBSD's 'boot.iso'. It also works with MirBSD's CURRENT branch (which is pretty close to OpenBSD as it is).

Comments

Sign In or Register to comment.