# Custum kernel in a headless server.

## dE_logics

I'm trying to do a Gentoo install on a headless server for educational purposes. The headless server is a normal desktop system in my case, but I'm assuming it has no graphic chip, just a few USB ports.

What I've planned - 

1) Make a generic Gentoo install (using the Debian kernel binary and -mtune=generic) with all server packages (including ssh).

2) Put it all in a pendrive, including a squashfs image of the Gentoo install

3) Boot from the pendrive on a Desktop/laptop PC to check if everything is ok

4) Boot using a pendrive on the headless server.

5) ssh into the headless server and unsquash Gentoo onto the hard drive of the server all over SSH.

6) Finalize installation (bootloader, fstab and all).

When it comes to custom kernels, I ensure that the first attempts WILL fail and result in a kernel panic. With no screens and no logs, how can I diagnose and fix the problem?

----------

## Aquous

The serial port.

----------

## ivanoff

The serial port still exists?

I think you should consider using a temporary graphic card to check if everything's alright

----------

## dE_logics

serial port?

They do exist in modern blade servers?

But we can't attach graphics cards to blade servers right?

----------

## Hu

It is common for even modern motherboards to have a serial port onboard.  However, not all systems ship with the necessary header to let you attach a serial cable to it.  Also, many modern systems have at least a primitive graphics processor built-in, which would let you run a text console without needing a separate graphics card.

----------

## NeddySeagoon

dE_logics,

Console over network ?

I've never done it but I've see theoption in moderen kernels.

Console over serial should work with a USB to serial converter too. You will need the USB stuff built into the kernel.

----------

## dE_logics

Ok, thank you for the advices. I'll grab a few cable as per my needs and see.

@NeddySeagoon

By console over network I meant via SSH.

----------

## dE_logics

Speaking of RS-232 serial cables, can we do the same through USB <-> USB?

----------

## NeddySeagoon

dE_logics,

Yes but ...

You need a special cable with some electronics in the middle. You can't just connect the USB ports from two PCs together.

These things are not low cost and the kernel does have drivers for some of them. Amazon has one. Thats not a reccomendation, just a price warning.

----------

## dE_logics

I was wondering about one of those DB-9 to USB converters.

----------

## NeddySeagoon

dE_logics,

Maybe. It will be ok once the kernel USB driveres are running, before that, e.g. your grup output, it dependes if your BIOS can redirect the console to USB.

----------

## dE_logics

I thought was grub's and the kernel's job to stream the output to the serial device. What if I specify console as /dev/ttyUSB* in a similar way as stated here - 

http://www.howtoforge.com/setting_up_a_serial_console

But the usbserial modules have to be modprobed with custom arguments to do that.

----------

## salahx

While it may not be well known, USB 2.0/EHCI  has a special "debug port" functionality to replace the now-disappearing serial port. (You'll need a USB debug "cable" too, like this: http://www.ajaystech.com/net20dc.htm). Its an optional feature, but many USB controllers support it. You can use lspci -v to see if yours does or not. Documentation/x86/earlyprintk.txt for some details on how to use this.

Note that you can't debug through a hub, and those USB debug cables don't come cheap, either. You can do a similar trick with Firewire/IEEE1394 (see Documentation/debugging-via-ohci1394.txt). 2 inexpensive Firewire adapters and a cable is still cheaper than the USB debug cable.

----------

## dE_logics

Ok, thanks for the overview of the newer technologies.

By USB debugging you means - 

Capabilities: [e4] Debug port: BAR=1 offset=00e0

I'll check out the docs about firewire and USB debugging.

----------

## cach0rr0

 *dE_logics wrote:*   

> 
> 
> But we can't attach graphics cards to blade servers right?

 

shouldnt need to

http://h18004.www1.hp.com/products/blades/bladesystem/img/main-promo.jpg

(not being sarcastic, either - ive never seen a blade setup without them; otherwise it would make anything but an unattended install impossible)

----------

## dE_logics

So in modern times, there's nothing called a headless server?

----------

## cach0rr0

 *dE_logics wrote:*   

> So in modern times, there's nothing called a headless server?

 

there's a difference between having a machine where its entire operational life cycle is headless, as opposed to doing a headless install. 

most systems will have *some* kind of backstop where a monitor can be hooked up, either for doing the installation, or for e.g. rebuilding a RAID array, things of that sort.

now yeah, there are some more complex setups that allow you to e.g. tftp boot, then run an unattended installation from e.g. a kickstart template. But since there are a few data recovery type scenarios and/or other administrative tasks that are going to be far easier if they dont depend on a functional network or serial port, it's rare to find setups where there's *zero* visual interface to the machine whatsoever

----------

## dE_logics

So first they're going to do the setup, and then remove the keyboard and monitor.

Ok, so no use of that serial cable I bought... I decided to quit headless setups.

----------

## cach0rr0

 *dE_logics wrote:*   

> So first they're going to do the setup, and then remove the keyboard and monitor.
> 
> Ok, so no use of that serial cable I bought... I decided to quit headless setups.

 

you *can* do this via the serial cable. But I'd be surprised if in most setups it's something that's absolutely necessary.

----------

## dE_logics

I was just doing it for educational purposes, but I'll still try it out (regardless of the fact that there's no use nowadays).

Thanks for the clarification.

----------

## Genone

Some enterprise chipsets also support sonsole redirection via VNC or RDP over the on board NIC. But even in the embedded world it's often recommended to setup systems with a monitor and keyboard attached on first startup (only talking about development boards here of course).

----------

