# Getting a server to run headless [SOLVED]

## audiodef

I've been trying to set up a Gentoo box to run WITHOUT a monitor, keyboard and mouse, and administer it via ssh. When keyboard, monitor and mouse are attached, everything works great, both directly on the machine and via ssh. Unplug keyboard, monitor and mouse and it invariably crashes. I expect this from Windows but not from Linux. 

What do I need to do to get this working? 

Kind of a reverse kernel and hardware question. Rather than "how do I get N to work with my kernel", I'm asking "how do I get my kernel to run without N?"

----------

## depontius

I run several systems headless.

I have 2 servers, but they run through a kvm into one display and keyboard.  It's not a very sophisticated kvm, so I doubt it presents any sort of "pseudo-hardware" to the system which doesn't have the real keyboard and display.  I have no no-console problems on either of these systems.

I also have a machine I'm grooming to be a dedicated myth frontend - to be normally run with only a remote control as UI.  I've had no no-console problems here, either.

If you're going to boot without a console, you may need to first boot with the console and set the BIOS options to allow it to boot without a keyboard.  Otherwise, say you had a display connected, but no keyboard, you'd see it waiting for "F1 to continue".  I'm not sure what happens when you disconnect the console, but I would expect it to look like what happens when the kvm switches the console to another system - should be no problem.  Maybe there are some extraneous glitches as you remove the keyboard, throwing odd "keypresses" into the system.

I would suggest setting up remote logging.  Then boot up with the console attached, and monitor the logs on your other system while you disconnect the console.  The last thing as it crashes should tell you something.  I was first going to suggest using ssh to get in and root-tail /var/log/messages, but that would miss anything that hadn't been committed to disk.  The remote logging will capture events the disk might miss.

----------

## audiodef

I'm going to try leaving both a keyboard and mouse plugged into the serial ports, no monitor, and if there are still problems, I'll try setting up remote logging to try to track the problem down. This machine's BIOS is pretty simple and I've already set it to bypass the keyboard check. It still crashes.

EDIT: Crashed with keyboard and mouse attached, will try remote logging. 

Should certain things be left out of the kernel, such as video drivers? I keep wondering if that's causing problems.

----------

## saellaven

What type of crash are you getting? Is there any information in /var/log/messages? If it isn't leaving anything there, try setting up netconsole* to capture the crash. I've been running a headless system for years without any problems and I'm sure I'm not the only one.

* /usr/src/linux/Documentation/networking/netconsole.txt

----------

## depontius

This is starting to sound more like flakey hardware than any sort of headless configuration problem.  Other than the BIOS setting, I've never done anything special to run a machine headless.  I always configure machines to accept USB or PS2 keyboard/mouse, and that may have some influence, but for me that's standard, headless or conventional.

I once had problems with a machine "spontaneously powering down", and ended up setting up remote logging so I could see the very last things that happened.  There was nothing there - I ended up blaming the power supply, bought a new one, and that solved the problem.  The very last events will generally not make it into the local logs and committed to disk before a crash.

----------

## audiodef

I've solved it, and it's flakey software, not hardware. Modesetting on Intel by default has to be turned off. I'm guessing this driver is trying to figure out what the hell to set without a monitor and instead of quitting, crashes the whole machine.

----------

## audiodef

Bug: https://bugs.gentoo.org/show_bug.cgi?id=307503

----------

