Melt coconut oil in a large skillet over medium heat. Add sliced onion and sauté, stirring occasionally, until they turn deep brown, about 10-15 minutes. Turn heat down to low-medium and continue cooking, stirring occasionally while roasting potatoes.
Preheat oven to 425° while the onions are cooking
Add potatoes to a large bowl, along with olive oil, rosemary leaves, and garlic. Toss to combine and season with salt, to taste.
Spread potatoes onto a large, rimmed baking sheet and arrange in a single layer without overcrowding. Place in the oven and roast for 15 minutes.
Remove pan from oven and turn potatoes so they brown evenly. Return to oven and roast for another 10-15 minutes, or until potatoes are fork tender.
Once the potatoes are done and the onions are caramelized, transfer the potatoes to a large serving bowl. Add the onions and toss gently. Taste and adjust salt if needed. Serve warm.