Step 1: Downloading NRT
There are two root programs that I’ve used. Those would be the Nexus Root Toolkit, and Nexus 7 Toolkit. I find both easy, but NRT is easier, and I will be using NRT for this tutorial.
Step 1. Download, and run the program. Click OK and stuff until you get to the menu shown in the picture.
As you can see, you have the driver installation guide, backup/restore, root, OEM lock, unlock, and flash stock unroot. Those are pretty self explanatory, so I won't explain what they all are.
Step 2: Root your device!
Once its rooted, your warranty is voided. I’ve had my Nexus replaced before, and I rooted the first device, but I flashed Stock android on it and locked it again, and they replaced it. So, apparently, your warranty is only void while your device is rooted.