Once GeoServer is installed and running, open up a web browser and go to the web admin console (Web administration interface). Navigate to the Layer Preview by clicking on the Layer Preview link at the bottom of the left sidebar. You will be presented with a list of the currently configured layers in your GeoServer instance. Find the row that says topp:states. To the right of the layer click on the link that says KML.
An alternative to serving KML directly into Google Earth is to use a Network Link. A Network Link allows for better integration into Google Earth. For example, using a Network Link enables the user to refresh the data within Google Earth, without having to retype a URL, or click on links in the GeoServer Map Preview again.
To add a Network Link, pull down the Add menu, and go to Network Link. The New Network Link dialog box will appear.
Name your layer in the Name field. (This will show up in My Places on the main Google Earth screen.) Set Link to:
http://GEOSERVER_URL/wms/kml?layers=topp:states
(Don’t forget to replace the GEOSERVER_URL.) Click OK. You can now save this layer in your My Places.