Sunday, 26 May 2013

Running X server on ubuntu pc without monitor , keyboard or mouse attached. Configure it to connect X remotely via XDMCP from windows 7

I searched and searched and found no good article on how to connect remotely via XDMCP on windows 7 to ubuntu 12.04 X server running without monitor , keyboard or mouse attached. First problem i hit was in ubuntu X wont start because it detects no monitor attached. That took some time to realise why X wont start. X logs are not explicit in stating that. I find X log are difficult to read, as they not clear on what caused fatal errors. It is a kernel that detects no monitor attached and passes on this info to X causing X to stop from starting. So i added the following to grub.
like below
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset"
and ran update-grub
I enabled XMCP in lightdm.conf as below


In the above lines i added are last 3 lines and last 2 lines are absolute essential.

In my troubleshooting exercise i changed the xorg.conf as below , (not sure if this is what caused x to work for me):

Section "Device"
    Identifier  "Configured Video Device"
    Driver      "dummy"
Section "Monitor"
    Identifier  "Configured Monitor"
    HorizSync 31.5-48.5
    VertRefresh 50-70
Section "Screen"
    Identifier  "Default Screen"
    Monitor     "Configured Monitor"
    Device      "Configured Video Device"
    DefaultDepth 24
    SubSection "Display"
    Depth 32
    Modes "1920x1080"

Also i installed xserver-xorg-video-dummy package. I changed the line modes to have a high resolution since my big hd monitor supports it. Then reboot the box.

Now on my windows box side. i searched for suitable X server. Here i am stuck with one of these 3 solutions. 
First one was to use xming. But xming free version was ages old now and they interested in payment to get a recent version. So i stayed away from it.
Second was to use mobaxterm. I downloaded the portable version and i instantly hated it ugly UI.
Third option was to use X/cygwin. I choose this one. It brings in quite a number of packages when installing but works fine for me. It also has a Terminal. So before i configured X to work for me in X. I did ssh -Y user@hostname to my ubuntu and lauched a GUI app and it appeared in my local windows fine. But then i was looking for full GUI. 
After ubuntu booted up. I did a ps -ef and netstat -anp to ensure X server is running and listening on ubuntu without monitor or keyboard or mouse attached. I was happy to find it is working. Now i launched xlaunch from xcygwin terminal and then it fails to connect . I googled a solution was easy to find. Basically X server is trying some ipv6 foo and fails, so in the end of xlaunch there is a option called additional parameters for X. add the following:
-from your_windows_ipv4_address
and then X server connects fine and the unity greeter welcomes you with prompt for username and password.

Linux blog visitors are windows users

From google stats as of May 26th 2013 IST i see that more than 65% of my blog viewers are from windows and using chrome. WTF ??? My blog is predominantly Linux oriented and the visitors are windows users. Viewers from linux are 20%. It doesn't make sense. Maybe they are using windows for their desktop and logging into linux through ssh and fixing things ? Thats bad.