Install on a laptop with external monitor only

If you can't access your system but GRUB is shown then press e on the Ubuntu menu entry in grub2, this will take you to edit mode and add the following option to the kernel line (add it to the end of the line which starts with "linux")

video=LVDS-1:d

Then press CTRL+x to boot with the edited kernel command line.

If it doesn't work try it with video=LVDS-0:d or to force output to VGA with video=VGA-1:e or video=VGA-0:e . More on these parameters here.

After you succeed with the boot just edit your /etc/default/grub and add the working kernel line parameter to the GRUB_CMDLINE_LINUX_DEFAULT= line to disable the LVDS output.After you edited the file run

sudo update-grub

To save the kernel line for for later boots.