Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
In my experience, grub2 isn't as easy as grub-legacy to install. It can be only installed on a physical drive not a disk image, the installer is still buggy, sometimes you even cannot install it on a secondary hard drive.
You can try qemu and mount the disk image as a secondary hard drive.
losetup -o <offset in file to the partition> /dev/loop/1 /dev/loop/0
If you disk image contains more than one partition the offset is not so easy to find out. You should use kpartx instead
As you said, I guess I can boot a linux live CD in a virtual machine and attache the image file as the primary hard drive and install GRUB2 that way. But still this is not the solution I am looking for. I want to install GRUB2 in a similar fashion as i install GRUB Legacy (see OP), if possible.
If you disk image contains more than one partition the offset is not so easy to find out. You should use kpartx instead
You can find the offsets with $ fdisk -lu /dev/loop/0, I was just to lacy to write it in the OP.