- We're stuck with a machine you want to reinstall remotely.
- Our Intel AMT won't "remote desktop", for whatever reason (Eg. perhaps you have no monitor attached, and haven't got around to buying a dummy display adapter)
- We've previously configured Intel AMT serial-over-lan in MEB to work with grub early boot
- We have a way to access this serial console remotely (Eg. https://github.com/Ylianst/MeshCentral -
npm install meshcentral; node node_modules/meshcentral
and whatever networking shenanigans it takes to make that work) - Our system previously already had GRUB configured to work over serial:
- For me that meant
/etc/default/grub
withGRUB_TERMINAL_INPUT
,GRUB_TERMINAL_OUTPUT
,GRUB_SERIAL_COMMAND
set correctly - See https://www.gnu.org/software/grub/manual/grub/html_node/Simple-configuration.html
- For me
GRUB_SERIAL_COMMAND
wasserial --unit=4 --speed=115200 --word=8 --parity=no --stop=1 --port=pci,00:16.3
- Why
--port=pci,00:16.3
? That's the (shortened) PCI bus address thatlshw
reports my Intel AMT serial port. Apparently UEFI grub will only "see" serial devices presented by UEFI, and it seems some vendors are shipping UEFI that ignores it. - See also: https://community.intel.com/t5/Intel-vPro-Platform/No-AMT-serial-port-in-Linux-grub2/m-p/1195624/highlight/true#M7911
- See also: https://www.gnu.org/software/grub/manual/grub/html_node/serial.html
- For me that meant
- The SOL serial port presents itself as ttyS4 to linux, and we are using 115200 bps
- We have an existing grub menu we can pivot from
- There's a locally accessible disk partition containing the Fedora installation iso, here it will be
(hd0,gpt1)
(GRUB-speak for/dev/sda1
)
- Interrupt grub boot menu with "c"
- In a nearby terminal, mount the fedora install iso locally, and inspect the grub.cfg for commands it wants to boot with
- For me, the relevant grub commands looked like:
insmod gzio
insmod part_gpt
insmod ext2
search --no-floppy --set=root -l 'Fedora-S-dvd-x86_64-42'
linuxefi /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=Fedora-S-dvd-x86_64-42 quiet
initrdefi /images/pxeboot/initrd.img
- I re-wrote these to suite my situation:
insmod gzio
insmod part_gpt
insmod ext2
search --no-floppy --set=root -l 'Fedora-S-dvd-x86_64-42'
linuxefi /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=Fedora-S-dvd-x86_64-42 inst.text console=ttyS4,115200 ip=dhcp inst.sshd
# linuxefi /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=Fedora-S-dvd-x86_64-42 console=ttyS4,115200 ip=dhcp inst.sshd inst.vnc inst.vncconnect=0.0.0.0:5900 inst.resolution=1280x1024 inst.vncpassword=<PASSWORD> inst.rdp inst.rdp.username=<USERNAME> inst.rdp.password=<PASSWORD>
initrdefi /images/pxeboot/initrd.img
- Use the Meshcentral "paste" button to paste all this into the grub console
boot
to boot- disconnect/reconnect AMT SOL console connection. For whatever reason, couldn't interact with anaconda installer serial prompt from here.without doing this. I guess I don't have all my bit rates/parities/stop-bits/whatevers all lined up.
- NB: In fact, this doesn't always work. Occasionally I will ask for AMT Reset, SOL terminal disconnects, when I re-connect the SOL terminal I get the anaconda installer menu... so it would appear the first AMT Reset doesn't always work when in this state
- Proceed through anaconda text installer.
For whatever reason, I can't get a good text install of fc42 with lvm /home /var
it barfs apparently trying to launch gtk stuff according to anaconda logs
upon reboot it nearly works but systemd-remount-fs is failed; AVC denials trying to access /etc/fstab, and the filesystems on those lvms are not mounted
it comes up ok