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

1
.gitignore vendored
View File

@@ -5,4 +5,5 @@ proxmox-cloud-image
*.dylib
*.test
*.out
*.qcow2
go.work

View File

@@ -1,10 +1,10 @@
image_url: "https://dl.rockylinux.org/pub/rocky/8/images/x86_64/Rocky-8-GenericCloud-Base.latest.x86_64.qcow2"
vm_name: "cloudimg-rocky-stream-8"
image_url: "/home/othman/Projects/proxmox-tools/templates/iso/AlmaLinux-9-GenericCloud-latest.x86_64.qcow2"
vm_name: "cloud-image-alma-8"
vm_id: 0
storage: "local"
memory: 1024
cores: 1
disk_size: "40G"
disk_size: "10G"
bridge: "vmbr1"
vlan_tag: 301
proxmox_host: "10.10.26.11"

View File

@@ -3,7 +3,7 @@
set -e
INSTALL_DIR="/usr/local/bin"
BINARY_NAME="proxmox-cloud-image"
BINARY_NAME="pib"
REPO_URL="https://github.com/yourusername/proxmox-cloud-image"
echo "=========================================="

BIN
pib Executable file

Binary file not shown.

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,14 +196,14 @@ 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),