Headless install: How to pre-configure install command

Could anyone advice me how to configure/customize/edit usb install image to pre-fill install command and start installation on a headless system?

I am looking for something along the lines - booting from USB which will start installation with custom installation boot options such as - without local interaction:
install=XXX netdevice=XXX hostip=XXX netmask=XXX vnc=XXX VNCPassword=XXX

Then connecting to the machine remotely or even completing the installation using autoyast .

Thank you, Tomas

One way is to use isomaster.

AutoYAST directions are here for creating your autoinst.xml:
https://doc.opensuse.org/projects/autoyast/

You can then copy it to the root of the ISO, re-master it, and dd it to your USB.

Thanks - for the tip - that does not seems very opensuse way of doing things …

I have a few questions if I may:

  1. Do you have experience how to handle UEFI boot once I step out from opensuse signed stuff?
  2. Is the image from isomaster useful for PXE/tftp boot?

I would like to start walking before running - first start/boot remote install
When I figure out how to boot the installation media - I will think about how to best solve autoyast

  • Integrating autoyast tightly with the iso image is wrong way to do this as I would need special iso for every headless machine and it would significantly complicate things for PXE/tftp boot.

Thanks again for the suggestion

The standard tool is AutoYaST, you can skim the documentation and guide, there are also individual articles where people have blogged their own experiences

https://doc.opensuse.org/projects/autoyast/

A quick Internet search turned up the following which looks interesting, but I haven’t used or tested anything in it… Still, it looks like the Author is keeping it current and changes were uploaded a few months ago as of this writing… YMMV and if you do try any of his scripts it would be nice for you to report back…

https://github.com/alr46664/opensuse-auto

Myself personally,
I generally build “most” headless, and haven’t had a need to fully automate the install…
I hook up a Keyboard-Video-Mouse temporarily for the initial install, do the basic installation and then remove. After that, SSH for modifications and maintenance. If I need to cookie-cutter an installation, I’ve found that simply creating BASH scripts for anything beyond the default install fills my need effortlessly (after the script is built) an advantage of this approach is that I rarely have to make significant modifications from one openSUSE version to the next(scripting an entire install requires changes for every openSUSE version).

If you are working in a very big Enterprise network, you may want to instead use a tool like Puppet or Chef.

TSU

I wish I would have worded my question better - it is not about how to configure machine or automate the install process - I do that though Ansible and/or Puppet after an initial install anyway.

**My questions was/is - how to modify the install USB drive to pass through the initial boot menu to the actual installation with the following install boot parameters:
install=XXX netdevice=XXX hostip=XXX netmask=XXX vnc=XXX VNCPassword=XXX
**
The purpose is to access the installation program over LAN without attached keyboard, mouse, screen.
The machines are real HW (not VMs) without server class low level KVM access via AMT or LILO - and I cannot connect screen to them practically.
The computers are set to boot from USB or network if bootable media is present, but there is no good way to attach a screen I could observe.

I would really appreciate some inside into modifying the default install boot menu without breaking the UEFI default signatures.

There must be some relatively trivial way - unfortunately my google searches return pages and pages of not relevant/useful advice or not related to opensuse. I am positive that there is good info out there and I just do not know how to select/search for it.

Thanks again, Tomas

I am not sure I understand the line above. If you are saying that you have to have bootable media then disregard this answer.

If the server will PXE boot without media then you can do these steps:

  1. Build a server that contains a :tftp, and DHCP server.
  2. Build a generic AutoYast file that fits your needs.
  3. PXE boot and let it rock and roll.

Now on the IP. There are two options:

  1. Let the DHCP server assign the IP and just figure out which one it assigned. Then configure a real IP later.
  2. If you have the server’s MAC then reserve the IP address in the DHCP server before the PXE boot and the DHCP server will assign that IP address to the server. You can then make it static later.

Remember, bootp by default is not passed by a router. So, either configure a helper for the router/configure the router or place the PXE server on the same subnet… (I’d recommend the latter, and in an isolated network/lab environment.)

Here is a link that will give you a start (and it may have already have been provided in an earlier post):

(I had to break this link into 2 parts because of the emoji issue. Remove the space between the : and P.)

en.opensuse.org/SDB: PXE_boot_installation

The way to interpret “bootable media” is that the machines can boot though USB and some via PXE (that is lower priority)

My problem is not how to set up PXE - it is how to make the install to actually start installing with custom install boot parameters directing it to start the installation desired way.

When I boot from USB as well as PXE - the installation process stops at boot menu and then boots from disk after a time out. Without screen and keyboard - this is no good. That is the problem I am trying to overcome.
I am trying to find a way how to use the installation media (via USB and low priority PXE) to not to boot from hard drive and proceed with installation using given boot parameters.

I tried all sorts of tricks before asking here - including modifying the iso9660 image - adding info file, changing the boot menu and few other things - in all cases it had no effect on the boot process or I broke the installation media. I admit that I have no idea how the installation media and its boot menu is created. There are tones of vastly outdated and confusing pieces of info around. I could not find any consistent, recent, detailed and explained description/guide.

I wish that this BIOS/UEFI contraption would be controllable from keyboard, network or serial port and/or one could just pass-in boot parameters from the running system to start reinstall or boot from different disk, partition, media, etc. - Sun machines used to do that in 90’s …

+1 PXE.

PXE (Pre-boot eXecution Environment) is the fairly standard way of provisioning LAN installations, sometimes all you need is a PXE-capable NIC. When your NICs aren’t PXE capable, then you start your isntall with a PXE client which is tiny and can be written to any kind of bootable media. It’s so tiny, it used to be deployed on floppies, today you’d typically use a USB stick or CD.

Looks like there is a SDB on openSUSE and FXE, and it’s fairly current (updated last year). I haven’t reviewed it, if you use it and run into any issues, post again…

https://en.opensuse.org/SDB:PXE_boot_installation

TSU

If you set up correctly (Closely inspect and compare what is in the SDB),
Your problem clearly is that the image or installation media isn’t being found.
You can possibly verify by inspecting your tftp (or whatever you’re using) logs, and possibly do a promiscuous packet capture.
You’ll have to determine what that’s the case… ie. network problem, configuration problem, etc.

TSU

How do you know it stops at boot menu (or that it even attempts to boot from USB or LAN) without screen?

Anyway, if you are sure it boots from PXE, then just add necessary kernel parameters to loader configuration. How exactly to do it depends on what loader you are using. it is easier than remastering isofs with updated grub.cfg.

Don’t know if the @OP is testing or exactly what he’s doing,
But you can test the PXE client in a virtual machine before deploying to real hardware.

That way, you can easily see what your headless machine is doing…

TSU

Please, I beg you, stop discussing me with PXE on this USB install question thread - I need help with how to to boot headless machine through USB stick to remote VNC install.

I really appreciate people volunteer, willing to help stranger and without a reward - I just cannot use PXE where BIOS does not support it and or I do not control DHCP/tftp.

Please, just accept the request I made.

I know for sure that it does not USB boot to remote installation for many obvious reasons:

  1. It boots from Hdd - I can observe that reliably by being able to login to the original install
  2. I cannot access the remote installation on the network
  3. I can easily verify and observe the USB installation progress on another trial machine with screen
    This way - I can observe/experiment and make it work before deployment.

Since it came up before, I am not sure why it matters, this is personal project involving hosts at multiple locations - not enterprise related work
I cannot physically access the hosts even if I wanted to show up with screen and keyboard in my pocket.

Ideally, I would like to resolve it by middle of June.

On Sun 13 May 2018 12:26:03 AM CDT, tkuchta wrote:

arvidjaar;2865201 Wrote:
> How do you know it stops at boot menu (or that it even attempts to
> boot from USB or LAN) without screen?
>
> Anyway, if you are sure it boots from PXE, then just add necessary
> kernel parameters to loader configuration. How exactly to do it
> depends on what loader you are using. it is easier than remastering
> isofs with updated grub.cfg.

I know for sure that it does not USB boot to remote installation for
many obvious reasons:

  • It boots from Hdd - I can observe that reliably by being able to
    login to the original install
  • I cannot access the remote installation on the network
  • I can easily verify and observe the USB installation progress on
    another trial machine with screen
    This way - I can observe/experiment and make it work before
    deployment.

Since it came up before, I am not sure why it matters, this is personal
project involving hosts at multiple locations - not enterprise related
work
I cannot physically access the hosts even if I wanted to show up with
screen and keyboard in my pocket.

Ideally, I would like to resolve it by middle of June.

Hi
I would suggest using STUDIO Express along with kiwi for creating the
pre-built image. Same process is used for openSUSE ARM images, zcat the
image onto a USB device, boot the USB device and it lays down the image
creates/expands the partitions etc and leaves you at the login prompt
after about 4 minutes…

https://studioexpress.opensuse.org/


Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
SLES 15 RC4 | GNOME Shell 3.26.2 | 4.12.14-18-default
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!

What you are looking for is this:
https://en.opensuse.org/SDB:Linuxrc

In particular, you are interested in the information around this paragraph:

The VNC parameter enables the installation process via VNC, making the installation more convenient on hosts that have no or no really usable local console. If enabled, a VNC server is activated on the installation host. See also VNCPassword.

You can add a file to the USB or the machine and call it, if need be.

Read through the documentation to understand how you can use it.

These commands on this SDB can be added to the command line when booting the installer, as well (which is not what you are asking, as you would need keyboard and monitor to do that, but I am adding for anyone else interested, or if you run into that need at any time in the future).

https://github.com/openSUSE/mksusecd

3. Add some boot options

If you need to repeatedly enter the same boot options, create an iso that already has them:

mksusecd --create foo.iso --boot "sshd=1 password=*****" openSUSE-13.2-DVD-x86_64.iso

This would start an ssh daemon you can login to during installation.

Thanks - that would have been elegant solution.

According to my experiments - That seems to add linuxrc options to default boot options - which is hdd.
Reading mksusecd help seems to confirm that.

So this cannot be used without interacting with a screen.

I was able to modify boot menu of the installation image to boot into the remote installation without any interaction with screen.

Now I have different, possibly harder problem - How do I make it boot from disk after reboot?

I can interactively cancel the install, but that takes me to interactive ncurses menu which is local again and only leads to shutdown or reboot, so back to the boot/install menu again.

At least for myself, I don’t understand the misgivings or perceived issues.

The preamble and the content of the SDB says that linuxrc normally runs unattended, but does support an interactive session (you have to specify manual=1). Seems to me that you should be able to install as little as you want (ie only a pre-boot with networking configured and working) or a full installation (with full AutoYaST configured) and anything in between.

You load all the parameters you need including your VNC and/or SSH credentials into the /linuxrc.config file.

The github page for linuxrc (https://github.com/openSUSE/linuxrc) describes using mksusecd to create an image, if that is even necessary.

You may want to specify a static address so you know how to access your target, but I imagine in a private DHCP network you can also inspect your DHCP leases to determine the IP address (else you may need to scan your network using something like nmap).

If you don’t want to manually intervene before or during the installation, I imagine linuxrc may not even be necessary, you may be able to simply configure a full AutoYaST install, and if everything runs without a problem you should be able to login when the install has completed.

TSU

The following might be helpful for setting up the auto install process.
Although it’s a SUSE documentation, there’s nothing in it I can see that’s specific to SUSE.
Whenever you see a SUSE reference, you should be able to substitute an openSUSE reference easily (like the name of the DVD).

https://www.suse.com/documentation/sles-12/book_autoyast/data/invoking_autoinst.html

TSU