I've just realised I can't install previous osx partitions with Lion on an iMac 2013. Therefore I would like to try to use Lion in a virtual machine.
I need it to use xCode 3. Am I going to have issues with this approach?
A virtual install of OS X Lion runs without issue on Mavericks.
All the popular VM software understand Lion as an OS and should let you install it. I don't see you having any problems with this setup as long as your hardware is Mac.
Yes. You can run OS X in a virtualized environment on another Mac.
VMWare Fusion just added additional/updated support for OS X. I use it every day for development and it is very efficient (for a VM).
I don't know if VirtualBox supports OS X or not, but I am guessing that it does on Mac hardware.
Historically, the problem with OS X in a VM was emulating the EFI firmware. But that is becoming more and more commonplace so support has greatly improved.
Lion expects Xcode 4, not Xcode 3. If you want to run Xcode 3, you have two options: