Hacker News new | ask | show | jobs
by IshKebab 3824 days ago
I'm not sure it's even "ready for the server".

I have a server without a monitor I'd like to VNC to. Unfortunately X doesn't start without a physical monitor plugged in because it uses it for autodetection. It's such a silly problem that you can even buy fake "monitor" dongles to plug in to trick X into thinking that there is one.

I don't feel like spending money on a software problem so I followed the standard workaround - create a static xorg.conf file. This is very suboptimal because what happens if I later plug in a real monitor?

Ok so now X starts. Sort of. Actually lightdm starts and I still can't get X11vnc to connect to the `:0` display. Apparently there is a workaround involving the MIT magic cookie but at this point I've given up.

In fact does X even support monitor hot-plugging?

Oh and also, if the wifi connection goes down and X isn't running it doesn't automatically reconnect! Wtf? I assume this is because the thing that does the reconnecting is a GUI tool of some sort.

Madness.

4 comments

All that sounds more like PEBKAC than anything else. I've had multiple VNC servers running on headless machines for longer than I can remember.

Using x11vnc to connect to a VNC server is like SSHing into localhost instead of just opening up a terminal. You're approaching the task the wrong way around.

Wifi not reconnecting sounds like your system has a graphical widget handling the network connections. No X = no graphical programs = no network connections.

In fairness to Linux, you're not actually building a "server" there. A typical server would be running on over ethernet rather than WiFi and on server board with support for remote management (eg IPMI or iLO) which would have mitigated the VNC issues you were having (though anecdotally I've never had any problems running X + VNC on a headless Linux box on the rare occasions I've needed to)

But arguments about VNC aside, the vast majority of the time you don't want nor need a GUI running on a server to begin with. Aside maybe some game servers, any Linux server daemon is command line configurable so you're better off saving your RAM and managing your server via SSH (or better yet, Vagrant / Puppet / equivalent)

In my experience, Linux is actually very good on servers. But by this I mean "proper" servers. Personally I'd still rather run FreeBSD, but many of the same arguments for and against Linux are applicable for FreeBSD as well.

Who says a server can't use wifi? A server is just a computer that primarily provides services to other computers.

And who says I don't want to run a GUI? I don't live in the 70s.

> I have a server without a monitor I'd like to VNC to.

That’s your problem right there. You can’t (or, rather, don’t) “VNC” to Unix servers. For normal remote access, you use SSH. If you really need to run a graphical X program continuously on a server, you run a virtual X server program like “Xvfb”, and point your graphical X program to that. You can then “VNC” all you like to this virtual X server. All without a monitor or even a graphics card or a mouse on the actual server.

This thinking – the idea that a server has something one can refer to as “the” screen, or “the” mouse – is completely and utterly wrong, and betrays a thinking born from Microsoft Windows and other desktop-only-oriented operating systems.

> the idea that a server has something one can refer to as “the” screen, or “the” mouse – is completely and utterly wrong

I don't disagree with your point per se but the reality is a little more nuanced that you suggest. For example, UNIX provided green screens to null terminals long before Windows Server was a thing. And mouse enabled Linux / UNIX terminal tools (eg elinks or aptitude) support mouse input even over SSH.

Though I do appreciate you were referring to "monitors" specifically when you discussed "screens", it's still worth noting that the old thin client model of computing has come back into trend again with Windows desktops available in the cloud (typically aimed at organisations that want a managed deployment of workstations - akin to a hosted Windows Terminal Services).

So it really depends on your workloads and what your definition of "screens" are :)

Microsoft is going to ship a headless version of Windows Server:

https://technet.microsoft.com/en-us/library/mt126167.aspx

I had a play with the headless Windows 2016 TP3 on Azure late last year and blogged my experience here [1]. You can even run GUI programs on it; I found it useful to run Sys Internals Process Explorer to track what was really happening with the Containers. Obviously there's no desktop with file explorer etc.

[1] https://etrading.wordpress.com/2015/10/13/windows-containers...

Microsoft started down the headless server route quite a while back with the Server Core [0] installations (started with server 2008)

IIRC starting with server 2012 or 2012 R2, all configuration and management functionality was exposed via powershell commandlets, as Server Core was the default installation type and server management was meant to be done via winRM/remote powershell sessions.

[0]: https://en.wikipedia.org/wiki/Server_Core

The problem is that all server software written with Windows in mind already assume that their interface is a screen and a mouse, and will try to create a main window, dock icon, and show popups when something happens. How will they work on a headless Windows server?
Not all software will work, but plenty of Windows Server services can be controlled via remote procedure calls. Even Active Directory has supported remote administration via LDAP. These protocols can be wrapped around GUI applications or run via Powershell - either of which would obviously run from your client workstation like PuTTY / xterm would when SSHing into Linux.
Confused: remote desktop makes any server not headless.
So, if I understand you correctly, Windows’ new “headless” servers are not actually headless, they simply have an invisible head – it’s still there, you just can’t see it.
It sure doesn't seem like it is there reading the page I linked.

I guess the software you mention that depends on having a desktop will do some combination of not working and working poorly, but they aren't targeting legacy applications with it, they are fleshing out their cloud offering.

Ah. No remote login.
You may not VNC to servers. I would like to. I also use SSH.

This is a clear flaw in Linux/X - don't try to excuse it with the tired old "why would you want to do that?" refrain.

> In fact does X even support monitor hot-plugging?

Yes, it does. It's called XRandR.

Not sure how your desktop system handles it, is there a pretty graphical widget or how you configure it, I don't use a desktop GUI, I set it up with the xrandr command line tool (which is more easily repeatable than a GUI, albeit less discoverable).

> I assume this is because the thing that does the reconnecting is a GUI tool of some sort.

You're probably using network-manager, which is a graphical widget in Gnome (KDE has something similar). There are other methods of setting up Wifi (I use wifi-menu on Arch Linux).