Port forward debugging

This commit is contained in:
2025-08-31 23:19:53 -04:00
parent 307d256ddf
commit c8a48e61e7
2 changed files with 19 additions and 0 deletions

View File

@@ -380,17 +380,27 @@ public class VmManagementService
try
{
var json = File.ReadAllText(configFile);
Console.WriteLine($"Loading config from {configFile}");
Console.WriteLine($"JSON content: {json}");
var config = JsonSerializer.Deserialize<VmConfiguration>(json);
if (config != null && !string.IsNullOrWhiteSpace(config.Name))
{
Console.WriteLine($"Successfully loaded VM: {config.Name}");
Console.WriteLine($"Network interfaces count: {config.Network?.Interfaces?.Count ?? 0}");
_vmConfigurations[config.Name] = config;
}
else
{
Console.WriteLine($"Failed to deserialize config from {configFile}: config is null or has no name");
}
}
catch (Exception ex)
{
// Log error but continue loading other configurations
Console.WriteLine($"Failed to load configuration from {configFile}: {ex.Message}");
Console.WriteLine($"Exception details: {ex}");
}
}
}

9
port-forwards.json Normal file
View File

@@ -0,0 +1,9 @@
[
{
"VmName": "ubuntu-desktop",
"HostPort": 8080,
"VmPort": 80,
"Protocol": "TCP",
"Created": "2025-08-31T23:55:53.202737Z"
}
]