# How To Run vmware-console Remotely With Apple's X11

Update: Mark Wilson has gone through this with a more recent version of VMware, and his article is likely to be more useful.

Regarding this piece, thanks to Chris Dagdigian for pointing out the need for trusted X forwarding.

One of the biggest issues with managing VMware Server for me has always been not having a native Mac OS X remote administration client (or a Mac OS X anything, but that's another story).

So, with every release, I kept trying to find a way to both see and control my virtual machine consoles by running vmware-console on the server and forwarding the X display to my Mac - which never seemed to work due to various X11 quirks - either the application bombed instantly, or there were masses of debug logging - but never a working remote console.

However, after months of virtual head-banging, Chris Dagdigian e-mailed me a note saying that he had got his vmware-console running by using trusted X forwarding, and after a while I had the rest figured out - keyboard mappings and all.

The following notes assume you have a Linux-based VMware Server host (running build 22088) and that you can access it over SSH from a Mac with X11 installed.

#### On The VMware Host

Keyboard detection doesn't work properly when you're using X11.app, so you have to go to /usr/lib/vmware/xkeymap and pick a suitable keyboard map (see this for more info).

You then have to edit ~/.vmware/preferences to set that keyboard map:

xkeymap.language="pt104"

...and pay attention to the vmware-console output.

#### On Mac OS X:

Start X11.app, open an xterm and SSH to the VMware Server using trusted X forwarding:

monotith:~ user$ssh -Y [email protected]/* <![CDATA[ */!function(t,e,r,n,c,a,p){try{t=document.currentScript||function(){for(t=document.getElementsByTagName('script'),e=t.length;e--;)if(t[e].getAttribute('data-cfhash'))return t[e]}();if(t&&(c=t.previousSibling)){p=t.parentNode;if(a=c.getAttribute('data-cfemail')){for(e='',r='0x'+a.substr(0,2)|0,n=2;a.length-n;n+=2)e+='%'+('0'+('0x'+a.substr(n,2)^r).toString(16)).slice(-2);p.replaceChild(document.createTextNode(decodeURIComponent(e)),c)}p.removeChild(t)}}catch(u){}}()/* ]]> */ Last login: Sun Mar 12 21:42:49 2006 from monolith.internal.taoofmac.com [[email protected]/* <![CDATA[ */!function(t,e,r,n,c,a,p){try{t=document.currentScript||function(){for(t=document.getElementsByTagName('script'),e=t.length;e--;)if(t[e].getAttribute('data-cfhash'))return t[e]}();if(t&&(c=t.previousSibling)){p=t.parentNode;if(a=c.getAttribute('data-cfemail')){for(e='',r='0x'+a.substr(0,2)|0,n=2;a.length-n;n+=2)e+='%'+('0'+('0x'+a.substr(n,2)^r).toString(16)).slice(-2);p.replaceChild(document.createTextNode(decodeURIComponent(e)),c)}p.removeChild(t)}}catch(u){}}()/* ]]> */ ~]$ vmware-console

And presto, it should appear on your X11 display. There is a very important point that needs stressing, though -

If VMware is unable to detect your keyboard settings, you won't be able to control guest virtual machines properly - you won't even be able to see the console.

Hence the importance of setting the keymap properly. You might also want to remember that some key combos are slightly different on the Mac - for instance, Ctrl+Alt to exit a VM is actually Ctrl+Command, etc., etc.

Regarding xauth and X11.app in other contexts, some people have noted that xauth usually works for them after issuing the following command in xterm:

xauth generate :0 . trusted

Although I've yet to establish a relationship, it seems to have helped me as well.