Step 1: Install the LEGO NXT-G patch from the Virtual Robotics Toolkit
Step 2: Write your NXT-G program just as you normally would for the real robot
Step 3: Download the compiled RBT file and save to your computer. The newly compiled file will have a .RXE extension.
Step 4: In the Virtual Robotics Toolkit, open the virtual NXT brick
Step 5: Load compiled program
Step 6: Run the program