How do junior professors build up a team of lab personnel? In the field of computer science how does a junior professor recruit graduate and undergraduate research assistants to initially build up a lab at a university? How long would this normally take? In the mean time, does the professor have to engage in the time-consuming 'grunge work' of research (ie. programming and running experiments), to generate papers?

Where would be a junior professor initially get the money to pay lab staff?
As usual, things vary a bit between institutions, countries and even specific posts. One particularly important point here is what exactly a "junior professor" is and how independent (s)he is supposed to work. In the following, I am assuming that you mean an entry-level "real" professorship, where the junior professor is supposed to execute pretty much the same responsibilities as other faculty, just maybe on a different scale.


  how does a junior professor recruit graduate and undergraduate research assistants to initially build up a lab at a university? How long would this normally take?


Generally speaking, the hardest part about getting started as a professor is not finding people. Of course it is sometimes hard to find good students, and recruiting them takes a bit of time, but generally (depending on system) we are talking about weeks or a few months here. The real issue is indeed finding ways to pay for them.

Junior professors may have a so-called startup grant / package, which is basically a defined amount of staff money or positions given to her/him as part of the contractual negotiations. This money is available right away, but will not be sufficient to cover the entire intended research group. Hence, the junior professor will typically spend a substantial fraction of her/his time writing grant proposals to fund new staff. The two troubles with that are that, (1) grant proposals are rather uncertain money (most funding agencies have very competitive acceptance rates), and (2) the entire process takes a while (in Switzerland, the review window of proposals to the national funding agency is 6 months). Hence, if you are a new faculty and you really need some project money, it is often unwise to just write one or two proposals. Rather, you will need to write a bunch of proposals concurrently to hedge. This is typically very time-consuming.


  In the mean time, does the professor have to engage in the time-consuming 'grunge work' of research


Yes, typically a starting faculty with a small team will to more her/himself than the head of a larger lab. However, most faculty don't perceive this as "having to do the grunge work", but rather as "still having time to do actual research". That is, most professors like being researchers (that's what they signed up for, after all), so if they still have the chance to get down and do some work themselves, that's typically a positive rather than a negative.