Before you go about this, what's the problem you're having getting the OS to load on the other machine? Have you got the boot order right in the BIOS?
Regardless, if you have the other box working I'd just unplug your main drive, then install the OS on the hard drive from the other machine. Windows XP is especially pretty forgiving in this respect, I've just unplugged drives and shoved them in other machines when I was in a hurry and it worked, but no guarantees. Most the big problems crop up are related to drivers being loaded for your motherboard which might cause the OS to bail, if you want to do it the 'proper' way and you're using windows, here's a guide to switching out upgrading motherboards which if you follow will let you move an installation from place to place:
http://episteme.arstechnica.com/groupee/forums/a/tpc/f/77909774/m/1400925745
I've done the same with a linux install before as well, but I've less experience with it so I that's with slightly more caveat emptor included if you're moving a *nix install around.