fix qemu-gues-agent issue and redhat based images

This commit is contained in:
2025-12-01 20:54:03 +07:00
parent 6b5ef25a3d
commit 11358a89dc
5 changed files with 12 additions and 10 deletions

View File

@@ -134,6 +134,7 @@ func createProxmoxVM(config *Config) error {
"--memory", fmt.Sprintf("%d", config.Memory),
"--cores", fmt.Sprintf("%d", config.Cores),
"--net0", buildNetworkConfig(config),
"--cpu", "host",
}
fmt.Printf("Running: %s\n", strings.Join(createCmd, " "))
@@ -195,19 +196,19 @@ func createProxmoxVM(config *Config) error {
},
{"qm", "set", fmt.Sprintf("%d", config.VMID),
"--serial0", "socket",
"--vga", "serial0",
"--vga", "std",
},
{"qm", "set", fmt.Sprintf("%d", config.VMID),
"--ipconfig0", "ip=dhcp",
},
}
// Tambahkan ini
// Install Qemu Guest Agent if requested
if config.GuestAgent {
commands = append(commands, []string{
"qm", "set", fmt.Sprintf("%d", config.VMID),
"--agent", "enabled=1",
})
commands = append(commands, []string{
"qm", "set", fmt.Sprintf("%d", config.VMID),
"--agent", "enabled=1",
})
}
// Firewall is now handled as part of the network config (buildNetworkConfig),