Grate the coconut flesh out. Place the grated coconut on a sieve and slowly pour in 500 liters of boiling water and collect the coconut milk in a bowl or a pot. Constantly stir and press the grated coconut with a spoon so that all the coconut milk is collected, as much as possible.
Heat oil in a pan and fry the onion slices.
Pour the coconut milk when the onions turn slightly golden. When the coconut milk starts to bubble, add the rice, salt and green chillies. Stir and allow the rice to cook until the coconut milk dries up completely, the oil starts to simmer and float on top. Now sprinkle the sugar on top and serve.