Port forward debugging
This commit is contained in:
@@ -380,17 +380,27 @@ public class VmManagementService
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
var json = File.ReadAllText(configFile);
|
var json = File.ReadAllText(configFile);
|
||||||
|
Console.WriteLine($"Loading config from {configFile}");
|
||||||
|
Console.WriteLine($"JSON content: {json}");
|
||||||
|
|
||||||
var config = JsonSerializer.Deserialize<VmConfiguration>(json);
|
var config = JsonSerializer.Deserialize<VmConfiguration>(json);
|
||||||
|
|
||||||
if (config != null && !string.IsNullOrWhiteSpace(config.Name))
|
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;
|
_vmConfigurations[config.Name] = config;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Console.WriteLine($"Failed to deserialize config from {configFile}: config is null or has no name");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
// Log error but continue loading other configurations
|
// Log error but continue loading other configurations
|
||||||
Console.WriteLine($"Failed to load configuration from {configFile}: {ex.Message}");
|
Console.WriteLine($"Failed to load configuration from {configFile}: {ex.Message}");
|
||||||
|
Console.WriteLine($"Exception details: {ex}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
9
port-forwards.json
Normal file
9
port-forwards.json
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"VmName": "ubuntu-desktop",
|
||||||
|
"HostPort": 8080,
|
||||||
|
"VmPort": 80,
|
||||||
|
"Protocol": "TCP",
|
||||||
|
"Created": "2025-08-31T23:55:53.202737Z"
|
||||||
|
}
|
||||||
|
]
|
Reference in New Issue
Block a user