Co-authored-by: Cursor <cursoragent@cursor.com>
5.0 KiB
VM Troubleshooting Guide
Comprehensive troubleshooting guide for virtual machine issues.
Common VM Issues
VM Won't Boot
Symptoms:
- VM starts but doesn't boot
- Boot loop
- Black screen
Solutions:
-
Check Boot Order:
qm config <vmid> | grep boot qm set <vmid> --boot order=scsi0 -
Verify Disk Attachment:
qm config <vmid> | grep scsi0 -
Check BIOS/UEFI Settings:
qm config <vmid> | grep bios # For UEFI: qm set <vmid> --bios ovmf # For BIOS: qm set <vmid> --bios seabios -
Review VM Logs:
journalctl -u qemu-server@<vmid> -f
VM Performance Issues
Symptoms:
- Slow response times
- High CPU usage
- Memory issues
Solutions:
-
Check Resource Allocation:
qm config <vmid> | grep -E "memory|cpu|cores" -
Monitor Resource Usage:
qm status <vmid> -
Optimize VM Settings:
# Enable CPU type for better performance qm set <vmid> --cpu host # Enable IO thread qm set <vmid> --iothread 1 # Set cache mode qm set <vmid> --cache none
Network Connectivity Issues
Symptoms:
- VM cannot reach network
- Cannot SSH to VM
- Network interface not working
Solutions:
-
Check Network Configuration:
qm config <vmid> | grep net -
Verify Bridge Configuration:
ip link show vmbr0 -
Test Network from Host:
ping <vm-ip> -
Check VM Network Interface:
# From within VM ip addr show ip link show
Disk Issues
Symptoms:
- Cannot create disk
- Disk full errors
- I/O errors
Solutions:
-
Check Disk Space:
pvesm status df -h -
Verify Disk Configuration:
qm config <vmid> | grep -E "scsi|virtio|ide" -
Check for Disk Errors:
dmesg | grep -i error -
Resize Disk if Needed:
qm resize <vmid> scsi0 +10G
Cloud-Init Issues
Symptoms:
- Cloud-Init not running
- User data not applied
- SSH keys not working
Solutions:
-
Check Cloud-Init Configuration:
qm config <vmid> | grep -E "ciuser|cipassword|sshkey|ipconfig" -
Verify Cloud-Init Drive:
qm config <vmid> | grep ide2 -
Check Cloud-Init Logs (in VM):
# From within VM journalctl -u cloud-init cat /var/log/cloud-init-output.log -
Reconfigure Cloud-Init:
qm set <vmid> --ciuser ubuntu qm set <vmid> --sshkey ~/.ssh/id_rsa.pub qm set <vmid> --ipconfig0 ip=dhcp
Guest Agent Issues
Symptoms:
- Cannot get VM status
- Shutdown not working
- No CPU/memory stats
Solutions:
-
Check Guest Agent:
qm config <vmid> | grep agent -
Enable Guest Agent:
qm set <vmid> --agent 1 -
Install Guest Agent in VM:
# Ubuntu/Debian sudo apt-get install qemu-guest-agent sudo systemctl enable qemu-guest-agent sudo systemctl start qemu-guest-agent
Template Issues
Symptoms:
- Cannot clone from template
- Template not found
- Clone fails
Solutions:
-
List Templates:
qm list | grep template -
Verify Template:
qm config <template-id> -
Clone Template:
qm clone <template-id> <new-vmid> --name <new-name> -
Configure Cloned VM:
qm set <new-vmid> --ciuser ubuntu qm set <new-vmid> --sshkey ~/.ssh/id_rsa.pub qm set <new-vmid> --ipconfig0 ip=<new-ip>/24,gw=<gateway>
VM Creation Issues
Cannot Create VM
Solutions:
-
Check Available Resources:
pvesh get /nodes/<node>/status -
Verify VM ID Availability:
qm list -
Check Storage:
pvesm status
Import Disk Fails
Solutions:
-
Verify Image File:
qemu-img info <image-file> -
Check Image Format:
file <image-file> -
Verify Storage:
pvesm status
VM Management
Useful Commands
# List all VMs
qm list
# Get VM status
qm status <vmid>
# Get VM configuration
qm config <vmid>
# Start VM
qm start <vmid>
# Stop VM
qm stop <vmid>
# Shutdown VM (graceful)
qm shutdown <vmid>
# Reset VM
qm reset <vmid>
# View VM console
qm terminal <vmid>
# View VM logs
journalctl -u qemu-server@<vmid> -f
Getting Help
If you cannot resolve a VM issue:
- Review VM configuration:
qm config <vmid> - Check VM logs:
journalctl -u qemu-server@<vmid> - Review Proxmox logs:
journalctl -u pve-cluster - Check Proxmox documentation
- Review Common Issues