How cool is that: VM console screenshots just by browser

Recently William Lam posted about a lesser known vSphere feature that I was not yet aware of: You can produce and look at screenshots of your VMs just by pointing a web browser to your ESXi host or vCenter server. If you have already read his post you will probably agree that this is very cool, but you might also wonder what this can be actually used for. So I want to share this knowledge again while adding some useful comments ... and use cases.How to access the screen shots

To look at a screenshot of a VM's console you just need to point a web browser to a URL like

https://<host-or-vcenter-address>/screen?id=<vm-id>

You will be prompted by a username/password. Your host's root credentials resp. the credentials of an authorized vCenter user will do the trick.
All you need to find out first is the <vm-id> parameter. If you access an ESXi host directly then it is easy to find this id by looking at yet another web page:

https://<host-address>/mob/?moid=ha-folder-vm

will display a properties' table of the host's VM folder, and the ids of the VMs will be displayed in the value column of the childEntity row:

ESXi mob browser: ha-folder-vm view

In the case of directly accessing a host these ids are just numbers. If you access a vCenter server then the ids are strings like "vm-number", and unfortunately it is not that easy to find them out. It is still possible though to find the id through vCenter's managed object browser (/mob). This post will give you an idea.

Use cases

When it comes to mobile devices the options to look at (or even control) a VM's console in an affordable way are very limited: In fact the only free option that I can currently think of is VMware WSX - it even allows for controlling the console, and all that from any HTML5 capable browser (that means: even on the iPhone and iPad!), but it needs an additional machine-in-the-middle (for running WSX) which means it is relatively complex to set up.

In contrast the option described here is instantly available with any ESXi host. Just think of the following scenarios:

You are running a Windows VM for offering an important service, but since a recent change this VM tends to crash intermittently with a blue screen. While being on the road you can periodically check with your mobile if the machine has crashed.

You are running a lengthy job on the console of a VM (Windows or Linux), and you have no idea when it will finish. Just look at it from time to time, using any accessible Internet browser.

One case that happened to myself: I have the OpenSource edition of Zimbra (VMware's Email and collaboration suite) running on a Linux VM in my hosted vSphere lab. After changing an advanced configuration option in the software it suddenly showed a memory leak in some process that brought the server to a grinding halt after some time. To find out when this happened and what process caused the memory leak I ran the top utility on the VM's console and looked at that from time to time. How easy this would have been with the browser trick!

Avoid screen blanking

If you try this out on your own then you will probably notice that most of the consoles you look at are just completely black. This is because both Windows and Linux OSs blank the console's screen after some timeout. In a physical world this is meant to avoid LCD screen burn-in and save monitor power, but in a virtual world this is just annoying (I even doubt that this will save any CPU cycles).

Luckily there are ways to turn off screen blanking. For Windows you need to look at the Power options to do this (also remember to turn off the screen saver in the Display settings). On Linux text consoles e.g. you can do this with the command "setterm -blank 0".