Dual monitor setup, why does NVidia 340 Prime only detect one monitor?

Solution 1:

Post-installation and removal Nvidia, I noticed a strange(and a good one at that) behavior. And that its that the GUI response in the second monitor has become much improved.

And I also noticed that the xorg.conf has a different setting, pasting it for your reference,

jpvel@jpvel-M11xR3:~/Downloads$ sudo cat /etc/X11/xorg.conf.04192015 

Section "ServerLayout"
    Identifier "layout"
    Screen 0 "nvidia"
    Inactive "intel"
EndSection

Section "Device"
    Identifier "intel"
    Driver "intel"
    BusID "PCI:0@0:2:0"
    Option "AccelMethod" "SNA"
EndSection

Section "Screen"
    Identifier "intel"
    Device "intel"
EndSection

Section "Device"
    Identifier "nvidia"
    Driver "nvidia"
    BusID "PCI:1@0:0:0"
    Option "ConstrainCursor" "off"
EndSection

Section "Screen"
    Identifier "nvidia"
    Device "nvidia"
    Option "AllowEmptyInitialConfiguration" "on"
    Option "IgnoreDisplayDevices" "CRT"
EndSection

I suspect that the existing nouveau driver seems to start honoring the configuration and appropriately instruct the graphics card to send the output to the external monitor. As

For those souls who tried using the DVI port or HDMI to VGA adapter, let me forwarn you, it does not work. As neutrino pointed out, the HDMI port is welded with Nvidia card in Alienware laptops

Edit from 2nd answer:

I went for the reinstallation and again tried using the latest Nvidia drivers from ppa:xorg-edgers/ppa for Nvidia-340, it ended up mucking the UI. So I decided to uninstall and live with the existing setup.

However, with the fresh installation, I am able to work with a dual monitor setup that is not perfect, but usable. I mirrored the displays and ensured that the intel's graphics driver could do the rendering(but it is lousy though I admit)