Melt butter in a large saucepan over low heat, add onions and cook slowly, stirring occasionally, until onions are golden and tender, about 20 minutes. Add vegetable stock, salt and pepper to taste, and simmer for about 15 minutes. Stir in dry sherry or cognac.
Rub garlic clove on each piece sliced bread and toast on a baking sheet until both sides are golden.
Place bread in a casserole or in 6 individual ovenproof, bowls and ladle onion soup over top. Top with a mixture of Gruyere and Parmesan and place casserole or individual bowls under the broiler and to melt cheese and slightly brown top