Its not exactly straight forward and usually involves some familiarity with Unix/Linux but its being done regularly and there are step by step guides
Not all hardware is compatible and not all features are possible because the iMacs do have some specific hardware.
Look up 'Hackintosh' and also 'Hack Mac', 'Mac Hack'
|