It is very simple; just follow the instructions of this article:

But there is a gotcha: if you don't connect your MacBook to the power outlet, you will never be able to use the external display.