Ubuntu – How to run Ubuntu in headless mode

graphicsheadlessintel graphicskvmvirtualization

I would like to set up Ubuntu in headless mode – configured to operate without a monitor, keyboard, and mouse; probably without access to graphics hardware altogether. The rationale for this is: I will have a KVM virtual machine running that would have graphics hardware to itself.

How do I do it? Which Ubuntu distribution could I be using and why? The options that come to my mind are desktop and server, but both don't offer an option to be installed in headless mode by default, or do they?

I am going to install Ubuntu 14.04 LTS x86_64 on a ThinkPad X Series (intel integrated graphics).

Best Answer

Your question is a bit ambigous. If you want to install ubuntu without any keyboard/monitor present, then you need to automate the installation. You'll generally find a lot of information about that if you look for "preseed" file and netinstallation. Please be aware that this may require some pre-existing infrastructure, depending on the exact method chosen (such as DHCP, TFTP services). You also want to do this with ubuntu server.

However please note that even KVM guests generally do have (virtualized) keyboard, mouse and monitor outputs and the KVM host on which the KVM guests run on generally have the ability to give you access to those via VNC connection. The end result is that you have a "headless" server but still console control over it remotely via VNC and you can perform the installation as if you had a monitor and keyboard on a real physical server.

Unless you really want to learn to automate an ubuntu server installation with no questions asked I strongly suggest investing time to see how you can get the console of KVM guests to appear whereever it is you are working from.