First thing is XPS14Z is nvidia optimus enabled. Optimus is not supported by nvidia in linux. The bumblebee project is really helpful in power saving but still its a nightmare specially in case of multi moniter setup.
There are two kind of video chips with optimus (source)
The port (DisplayPort / HDMI / VGA) is wired to the Intel chip, you do not need to do anything special to get external monitors to work in this case.
The port is wired into the nvidia chip. In this case you can currently not expand the screen over monitors. The monitor may still be used as extra screen (with no desktop running on it) or to run the full desktop on it (with no output on the Intel LVDS output, a.k.a. "the laptop display").
XPS 14z has the second setup. So you can use your either your external monitor or your laptop screen.
According to your question you want Desktop on external monitor, you need to follow the below steps, (I don't have XPS 14z, all information is from here)
- Do not install bumblebee. If already installed , uninstall it first.
- install nvida-current.
sudo apt-get install nvidia-current. Don't reboot.
- Connect the external monitor. Get the connected monitors by executing
/usr/lib/nvidia-current/bin/nvidia-xconfig --query-gpu-info --nvidia-cfg-path=/usr/lib/nvidia-current
at the end line you will get something like below, figure out your monitor from there. remember the corresponding value like
CRT-0. we will need it later
Display Device 0 (CRT-0):
/etc/X11/xorg.conf. For this, press Alt+F2 and type
gksu gedit /etc/X11/xorg.conf.
The content should be like
VendorName "NVIDIA Corporation"
Option "NoLogo" "true"
Option "ConnectedMonitor" "DFP"
DFP to the display device number as you got in step 3.
Restart the X server (or simply reboot the system)
To restart X follow this,
- Press Alt+Ctrl+F1 , log in using your credential.
- type in
sudo restart lightdm
If you get a black screen, please remove the config file by executing
sudo rm /etc/X11/xorg.conf
Please feel free to edit this answer to add more guidance if required.