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 *.dylib
*.test *.test
*.out *.out
*.qcow2
go.work 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" image_url: "/home/othman/Projects/proxmox-tools/templates/iso/AlmaLinux-9-GenericCloud-latest.x86_64.qcow2"
vm_name: "cloudimg-rocky-stream-8" vm_name: "cloud-image-alma-8"
vm_id: 0 vm_id: 0
storage: "local" storage: "local"
memory: 1024 memory: 1024
cores: 1 cores: 1
disk_size: "40G" disk_size: "10G"
bridge: "vmbr1" bridge: "vmbr1"
vlan_tag: 301 vlan_tag: 301
proxmox_host: "10.10.26.11" proxmox_host: "10.10.26.11"

View File

@@ -3,7 +3,7 @@
set -e set -e
INSTALL_DIR="/usr/local/bin" INSTALL_DIR="/usr/local/bin"
BINARY_NAME="proxmox-cloud-image" BINARY_NAME="pib"
REPO_URL="https://github.com/yourusername/proxmox-cloud-image" REPO_URL="https://github.com/yourusername/proxmox-cloud-image"
echo "==========================================" 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), "--memory", fmt.Sprintf("%d", config.Memory),
"--cores", fmt.Sprintf("%d", config.Cores), "--cores", fmt.Sprintf("%d", config.Cores),
"--net0", buildNetworkConfig(config), "--net0", buildNetworkConfig(config),
"--cpu", "host",
} }
fmt.Printf("Running: %s\n", strings.Join(createCmd, " ")) fmt.Printf("Running: %s\n", strings.Join(createCmd, " "))
@@ -195,19 +196,19 @@ func createProxmoxVM(config *Config) error {
}, },
{"qm", "set", fmt.Sprintf("%d", config.VMID), {"qm", "set", fmt.Sprintf("%d", config.VMID),
"--serial0", "socket", "--serial0", "socket",
"--vga", "serial0", "--vga", "std",
}, },
{"qm", "set", fmt.Sprintf("%d", config.VMID), {"qm", "set", fmt.Sprintf("%d", config.VMID),
"--ipconfig0", "ip=dhcp", "--ipconfig0", "ip=dhcp",
}, },
} }
// Tambahkan ini // Install Qemu Guest Agent if requested
if config.GuestAgent { if config.GuestAgent {
commands = append(commands, []string{ commands = append(commands, []string{
"qm", "set", fmt.Sprintf("%d", config.VMID), "qm", "set", fmt.Sprintf("%d", config.VMID),
"--agent", "enabled=1", "--agent", "enabled=1",
}) })
} }
// Firewall is now handled as part of the network config (buildNetworkConfig), // Firewall is now handled as part of the network config (buildNetworkConfig),