Running Old Desktops Headless?
CajunArson writes "I recently dug up an old P4 that is in fine working order and did what any self-respecting Slashdotter would do: I slapped Linux on it to experiment with making an NFSv4 server. One other thing I did was to remove the old AGP video card to save on power, since this is a headless machine. Now, I removed the video card after the installation, and I'm doing just fine as long as the machine will boot to a state where networking works and I can SSH to it. My question: Is there a good solution to allow me to log into this box if it cannot get on the network? I'm looking for solutions other than slapping a video card back in. In my case, I will have physical access to the machine. A few caveats to make it interesting: This question is for plain old desktop/laptop systems, not network servers designed to run headless. Also, I am aware of the serial console, but even 'old' machines may only have USB, and I have not seen any good documentation on how and whether USB works as a substitute. Finally, if there is any way to access the BIOS settings without needing a video card, that would be an extra bonus, but I'm satisfied with just local OS access starting from the GRUB prompt."
The question about bios settings is a good one though, and I don't know.
Most of the Dell and IBM servers I've used will let you get to the BIOS/GRUB over a serial console with some configuration, but I've never seen a desktop motherboard that would do it. If you really care about power consumption the easiest route is probably to buy a cheap, low-power itx board that has VGA built in and skip the console altogether. Plus, that way you don't need a laptop to talk to the box, just an old monitor.
Anyone know some tricks to get serial console to work with grub on a desktop mobo?
This game will waste your life. Don't clicky!
If that box and another both have serial connections, then use the serial console: Get a null-modem cable. Connect that to another box. Make sure the you add console=ttyS0,19200n8 or some variation to the append line in your grub entries. On the client side use cu aka tip, minicom or PuTTY to make the serial connection, making sure that bps, parity and stop bits match.
Beta is broken and the link to classic doesn't work. Stop wasting our time or there won't be anybody left here.
As many others have mentioned, the serial console is the way to go. Even if there's no DB9/DB25 serial port out the back, there's likely at least one serial port header on the motherboard. The header/pinout is generally standard, so go digging in that 'really old parts' box that we all have and see if you can dig up a DB9 port mounted on a plate to mount where a card would normally go. It will have a ribbon cable to attach it to the motherboard...
Very good point. The cables are easy to find, too: e.g. http://www.pccables.com/07120.htm (That's a random cable picture and not an endorsement of the company. YMMV, Caveat Emptor, etc.)
Beta is broken and the link to classic doesn't work. Stop wasting our time or there won't be anybody left here.
It's tempting to use an old P4, but I don't think it's worth it in the long run based on the extra power consumption from the CPU. My old P4 used around 80 watts, that's almost $6 a month (assuming 10 cents a kwh). I decided to get an MSI wind PC which uses an Atom core ($135 from newegg). This still uses around 30 watts of power, most of it in the chipset. I'm hoping at some that they will sell equivalent devices that use under 10 watts. Once that happens it will be a no brainer to use these devices as fileservers, the power savings alone will make it worth it.
The Rage Pro 8MB is the ultimate low power card, and comes in PCI format. Less than 1W power use at idle, and supported by Linux and Windows with built-in drivers. Until 2007 many Intel servers had them on the motherboard, before ATI introduced a new line and Intel moved to their own chips.
const int one = 65536; (Silvermoon, Texture.cs)
SJW, n: "Someone I don't like, and by the way I'm a fuckwit" - AC
GRUB:
Define the serial port and configure GRUB to use the serial port, as shown in Figure 4-6. Figure 4-6. GRUB configuration for serial console
--unit is the number of the serial port, counting from zero, unit 0 being COM1. Note that the values of --parity are spelt out in full: no, even and odd. The common abbreviations n, e and o are not accepted. If there is mysteriously no output on the serial port then suspect a syntax error in the serial or terminal commands. If you also want to use and attached monitor and keyboard as well as the serial port to control the GRUB boot loader then use the alternative configuration in Figure 4-7.
Kernel:
The Linux kernel is configured to select the console by passing it the console parameter. The console parameter can be given repeatedly, but the parameter can only be given once for each console technology. So console=tty0 console=lp0 console=ttyS0 is acceptable but console=ttyS0 console=ttyS1 will not work. When multiple consoles are listed output is sent to all consoles and input is taken from the last listed console. The last console is the one Linux uses as the /dev/console device.
The syntax of the console parameter is given in Figure 5-1.
Figure 5-1. Kernel console syntax, in EBNF
Quite a bit more info at tdlp.org..
Save yourself some pain and put something like this in your /etc/profile:
export PS1="${USER}@`hostname -s`:\w$ "
That particular one is for ksh; it might work for bash, too. I don't really use bash.
You could even make the machine name flash red if you wanted to.
You might be interested in molly-guard (available in Debian/Ubuntu, and presumably others):
The package installs a shell script that overrides the existing shutdown/reboot/halt/poweroff commands and first runs a set of scripts, which all have to exit
successfully, before molly-guard invokes the real command.
One of the scripts checks for existing SSH sessions. If any of the four commands are called interactively over an SSH session, the shell script prompts you to enter the name of the host you wish to shut down. This should adequately prevent you from accidental shutdowns and reboots.
This shell script passes through the commands to the respective binaries in /sbin and should thus not get in the way if called non-interactively, or locally.
22:56:13 rock:~ > sudo shutdown -r 5 ...
W: molly-guard: SSH session detected!
Please type in hostname of the machine to shutdown: box
Good thing I asked; I won't shutdown rock
W: aborting shutdown due to 30-query-hostname exiting with code 1.
(I only have it installed on my server, so getting the question is enough to make me hit ^C. Also, my prompt is yellow on my home PC, red on my work PC, cyan on servers, and includes the hostname, so I'd need to be really tired to make a mistake.)
In general, USB Serial under Windows is horrible. Windows XP has many USB serial ports with buggy drivers. Most devices that I tested had either data corruption issues, or simply wouldn't do high baud rates, or both. If you use the FTDI chipset based devices, then at least no data corruption occurs at high baud rates. All of the drivers that I used would fail if the USB device was disconnected while RS-232 communication was occurring, and then reconnected again. To recover, Windows XP either had to be rebooted, or the USB port reassigned to a different COM port number. A reboot for a USB driver???
Also, many older specialty programs won't work with USB serial ports. Essentially, Microsoft slightly changed the behavior of the polled mode ReadFile/WriteFile calls, so USB serial ports behave differently than built-in serial ports. This breaks old software.
USB serial ports under Windows for antiquated embedded / real-time applications can be a real nightmare. The only success I had at high baud rates was with the FTDI chipset and drivers. Even they, broke old software, and required a reboot if the USB device was unplugged during communications.
And you are worried about Linux driver support? I'm pretty sure that this is one of those cases where Linux works better than Windows.
For P4s and Celeron Prescott/Northwood using same technology, just install cpufreqd and make sure it's using the ondemand governor. cpufrequtils is also useful and doesn't clash. The actual work is done by the kernel module p4_clockmod, must be in /etc/modules.
This makes some difference to power consumption. As for temperature, the best thing I did was to remove the old thermal paste on the CPU/cooler and apply some new Zaward paste - CPU temperature dropped by 20 degrees C (something like 30F).
Have a look on ebay for a compaq iLo PCI card. This is a network-attached video card (also providing keyboard and mouse) allowing an administrator to get an actual screen (like VNC) over a network connection.
You'll have access to bios as well!
This would be a good idea if the machine was an HP server and literally the worst fucking idea I've ever heard if it isn't. An iLO card will work in certain HP servers, an RSA card will work in certain IBM servers and a DRAC card will work in certain Dell servers. A generic card which will work in anything does not exist. These things aren't generic peripherals.