1

I'm looking for a Linux live system which allows me to investigate boot failure via SSH for my server which is placed under my desk and doesn't have a graphic card for energy saving reasons. I sometime make configuration/administration errors which lead to boot failures before the SSH server starts.

In this case I'd like to be able to plug-in a USB stick the live system and reboot into it (UEFI is configured to boot USB before SSD). The system should then start a DHCP and a SSH server without interaction so that I can figure out the IP address from ifconfig on the client (through an educated guess) and connect to the SSH server.

Currently, I have to shutdown the server, plugin a graphic card, connect my keyboard to it instead of the above. That's fine, but not ideal.

I tried Ubuntu 17.04 desktop and server. They both wait forever for input before they start an DHCP or SSH server. The search is difficult in general because OS don't advertise the required feature (only that they have DHCP and SSH included, but not when they're started).

  • How about a RS232 cable/console? – Rui F Ribeiro Jul 25 '17 at 22:01
  • As far as I understand that would require extra hardware - since I don't have such a connector on my mainboard (ASRock X99 Extreme). A free software solution is much preferred. Good tip, though, thank you. – Karl Richter Jul 25 '17 at 22:09
  • usb to serial cable , pl2303 for instance – Rui F Ribeiro Jul 25 '17 at 22:22
1

As @RuiFRibeiro said in his comments, this is what serial consoles are for. USB to RS-232 serial adaptors are cheap ($5-$10), and so are null-modem cables.

BTW, according to the ASRock X99 Extreme specs page, your motherboard has a COM port header on it. Most motherboards do. All you need is the cable kit to extend it from the motherboard header to a DB-9 (or DB-25) serial connector on one of the back-panel slots. These typically only cost a few dollars, about the same as a USB to RS-232 adaptor.

Setting this up will be less work than getting a live system to do what you want - AND will give you console access at the exact point that the boot failed (usually with the initrd's root login prompt), and grub can be configured to use the serial console.

If you insist on using a live system instead of a serial console, though, you're going to have to build or customise your own. None of them will do exactly what you want....fortunately, most of them (especially those oriented towards rescue and recovery) will be very close and will require only minimal changes. And since your server doesn't have a graphics card at all, you should choose one that doesn't try to start up a graphical console.

You seem a little confused about the difference between a dhcp client and a dhcp server. A dhcp server gives out IP addresses etc to other machines (not itself) on already-configured network interface(s). For this task, you'll need your boot system to either be a DHCP client (and have a DHCP server elsewhere on the network) or be configured to have a static IP address.

If the server you're talking about is your LAN's DHCP server, it's a good idea to have some other machine on the network configured to be a secondary DHCP server. dhcpd doesn't have to be running all the time on it, it just has to have the software installed and ready to start manually when needed. It also needs an up-to-date copy of the primary DHCP server's configuration files....or, at the very least, a minimal configuration that allocates a known IP address to your main server based on its MAC address. e.g. in ISC dhcpd's dhcpd.conf:

host server { hardware ethernet xx:xx:xx:xx:xx:xx; fixed-address 192.168.1.1; }

Most Live system USBs/CDs/etc (including rescue-type systems like gparted and clonezilla) already have dhcp client support built in and can be configured (or modified) to have a static IP on your LAN. Similarly most will have sshd installed and configured to start up as soon as there's a working network interface.

I'd recommend the Clonezilla USB image as a good base for building your own live rescue system. Unlike most, it's oriented towards text/console use already rather than graphical and because it's focused on backup & restore it already has all the tools you might need for mounting and working with almost any filesystem known to linux.

When you customise your Live system, remember to change the default password(s) (usually empty, or something trivial and well-known) and install copies of your SSH public keys.

  • If you are willing to wait the time, I have bought (several) usb->serial cables for my arm devices from aliexpress for as much as 1.5 USD each. – Rui F Ribeiro Jul 26 '17 at 7:00
  • COM port header -> jtag? – Rui F Ribeiro Jul 26 '17 at 7:52
  • 1
    jumper block, similar to an internal USB jumper block. superuser.com/questions/627922/… – cas Jul 26 '17 at 8:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.