Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am in the process of building my first development server and plan on running Ubuntu Server as the OS. This morning, I was doing some initial designs for it and it got me thinking: how do "headless Linux" systems (terminal-only systems with no desktop/window environment) boot without prompting any user to login?

With a desktop Linux server, such as Ubuntu Server, when I start the machineit prompts me for a username and password; I have to login before I can use the system or access it remotely (which is what I intend to do).

How does a "headless Linux" server work? When you turn the machine on, since there is no terminal/monitor/UI to interact with, how do users connect remotely (with a remote desktop tool for instance) to it and begin using it when the OS hasn't even finished loading yet (which is what I assume is happening when you log in to the machine at startup with a desktop server)? Thanks in advance!

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

Headless machines are configured to start automatically all the services needed to use them and log into them. Usually, ssh is the primary means of connecting to the server from the outside world.

share|improve this answer
    
Thanks @David Schwartz (+1) - but I'm still not seeing the "forest through the trees." Say I write my own daemon service, my-svc.exe and I want it to start when the physical machine is booted up. What are the series of steps I would need to go through to configure my-svc.exe to start at machine startup, login to the OS as you say, and be available for use by clients? Thanks again! –  pnongrata Aug 6 '12 at 11:54
1  
You create an entry for the service in your distribution's service manager and set it to enabled in whichever startup profile you start up in. I don't know specifically what Ubuntu uses, whether it's upstart, systemd, or whatever. But each startup manager has the idea of different startup profiles with services that are enabled on startup for each profile. (Update: Ubuntu uses upstart -- set start on startup if you want a job to start on startup.) –  David Schwartz Aug 6 '12 at 11:56
    
Ahh, so therein lies the root of my confusion: as you said, it looks like you can choose a startup profile when you power-on the machine, yes? If so, how does the machine know which startup profile to use (i.e. can you define a "default profile")? Thanks again (and +1 for the research)! –  pnongrata Aug 6 '12 at 12:03
    
That's correct. Usually, after installation, the default profile is "multi-user networking, plus GUI". Upstart allows you to use runlevels. –  David Schwartz Aug 6 '12 at 12:05
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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