fix qemu-guest-agent problem

This commit is contained in:
2025-11-28 02:09:21 +07:00
parent 651ca6ecd3
commit 835ac13046
3 changed files with 22 additions and 1 deletions

13
config.yaml Normal file
View File

@@ -0,0 +1,13 @@
image_url: "https://cloud.centos.org/centos/10-stream/x86_64/images/CentOS-Stream-GenericCloud-x86_64-10-latest.x86_64.qcow2"
vm_name: "cloudimg-centos-stream-10"
vm_id: 0
storage: "local"
memory: 1024
cores: 1
disk_size: "10G"
bridge: "vmbr1"
vlan_tag: 301
proxmox_host: "10.10.26.11"
proxmox_user: "root@pam"
proxmox_pass: "Pnd77net!"
guest_agent: true

BIN
proxmox-template Executable file

Binary file not shown.

View File

@@ -195,13 +195,21 @@ 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
if config.GuestAgent {
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),
// so no separate "qm set --firewall" command is required here.