Headless Linux Systems: Easy Remote Access with TeamViewer

If you uselynxto browse the World Wide Web, you probably never thought about installing TeamViewer on a headless Linux server. But if you’re more used to the convenience of a graphical user interface, you might have thought about (or dreamed of) administering your servers with TeamViewer.

Maybe you have even tried it. The first problem you may have encountered is that Linux servers often don’t have any graphical user interface installed by default.

Of course, you know how to solve that. Just grab the packages of your favorite desktop environment and then start it… oh wait, what? X does not start? Complaining about the absence of a screen? Bummer.

Sure, you can solve that, too. Or just start some virtual X (Xvfb). But… still no success… something is still not working properly… Giving up. Been there? Sit back…

Defining some terms

A Virtual Terminal (VT) provides an interface for the user to log in and work. You can switch between VTs using the Ctrl+Alt+Fx shortcuts. They are usually text based.

The graphical desktop environment traditionally runs on VT7 (Ctrl+Alt+F7). I will refer to this as GVT. Before Version 11, TeamViewer could only be used on the GVT.

A framebuffer terminal (or console) is a pixel-based terminal, unlike the traditional character-based terminal. Today, most distributions use a framebuffer console by default. It uses colored output and can display a penguin when booting the computer.

A framebuffer pixel-based terminal also allows higher resolutions than the traditional 80×25 characters in text mode. In this article, I will refer to a framebuffer as VT.

You can leave your head on

With headless support enabled, remote control connections will take you to the active VT. The active VT is the one that you see on the monitor — or would see, if one was attached.

This can also be the GVT. And is different from, say, ssh connections. They emulate a VT that only lives as long as the connection. TeamViewer connects to the active VT on the system – if you connect again, it will still have the contents, including command history, that you saw before.

Another difference (compared to ssh connections) is that the resolution is that of the VT. If a monitor is attached, it is usually the native resolution of the screen.

Let’s see…

To reiterate: You will always be taken to the active VT (the thing you switch using Ctrl+Alt+F1…F12). So, you will always see what the user in front of the Linux box sees. Or what he would see, if a screen were attached.

Conversely, that user (if present) will also see what you do. You can’t connect to a VT if a user is active on the GVT.

There is always some indication that a TeamViewer connection is running: On the GVT, you’ll always see the typical TeamViewer windows and maybe a tray icon.

Requirements and setup

After installing the TeamViewer package, just run teamviewer setup (as root) to configure it for headless use.

Setup will ask you for the credentials of your TeamViewer account and then assign your computer to that account. If you run setup again, it’ll inform you that it has already been assigned to your account.

Note that the account assignment is removed when you remove the TeamViewer package – but not when you install a TeamViewer update.

And that’s actually it. Nothing more to be done.

The machine should now appear in your Computers & Contacts list and you can connect to it by simply double-clicking on it.

Want to find out what else you can do with TeamViewer 11? Click the button below!