It depends on your ubuntu-version.
On newer systems (since Maverick) you have to install some additional packets:
sudo aptitude install iscsitarget iscsitarget-source iscsitarget-dkms
This compiles the required module automagically.
On Lucid you have to compile yourself (and maybe again after every kernel-update):
sudo aptitude install iscsitarget iscsitarget-source
# compile with module-assitant
sudo m-a a-i iscsitarget