The reason you are having problems is that the first monitor is selected by the bios at boot time.  If there is no monitor attached, it has to make the 'first' monitor the one on the laptop.  If the laptop lid is closed, it may pick the external as the first monitor.<p>Generally the easiest way to get this done is to have nvidia graphics and use nvidia-settings.  If you have some less well supported graphics setup, welcome to the world of linux!