Openbox : make 4 desktops 2x2

Took me a while but now I found a workaround. openbox.org wiki FAQ linked to a tiny program (called setlayout) which is doing the job

You have to compile it with:

  1. sudo aptitude install libx11-dev
  2. gcc setlayout.c -o setlayout -lX11

Call it with: ./setlayout 0 2 2 0


Credit to strangeqargo who pasted a link to this answer in a comment on the first answer

As stated in the above, you can avoid having to download, compile, and use setlayout by using the xprop command.

Examples

To get 4 columns x 2 rows:

xprop -root -f _NET_DESKTOP_LAYOUT 32cccc -set _NET_DESKTOP_LAYOUT 0,4,2,0

Set number of workspaces/desktops to 8:

xprop -root -f _NET_NUMBER_OF_DESKTOPS 32c -set _NET_NUMBER_OF_DESKTOPS 8

The exact specification for _NET_DESKTOP_LAYOUT is available here

This is a lightly edited version of the Original answer