Diagnostic Tools
SmolVM includes built-in diagnostic capabilities to help you identify and resolve issues quickly.Doctor Command
Thesmolvm doctor command validates your environment and reports any issues:
Run
smolvm doctor first when experiencing issues. It checks KVM support, Firecracker/QEMU availability, network configuration, and permissions.Common Issues
VM Creation and Startup
VMAlreadyExistsError: VM already exists
VMAlreadyExistsError: VM already exists
Cause: You’re attempting to create a VM with an ID that’s already in use.Solution: Either reconnect to the existing VM or use a different ID:Or clean up the existing VM:
VMNotFoundError: VM not found
VMNotFoundError: VM not found
Cause: Attempting to reconnect to a VM that doesn’t exist or was already deleted.Solution: Verify the VM ID exists:If the VM was deleted, create a new one:
HostError: KVM not available
HostError: KVM not available
Cause: Your Linux system doesn’t have KVM support enabled or accessible.Solution:
-
Verify KVM is available:
-
Check if your CPU supports virtualization:
-
Ensure KVM kernel modules are loaded:
-
Add your user to the
kvmgroup: -
Re-run the system setup:
OperationTimeoutError: VM boot timeout
OperationTimeoutError: VM boot timeout
Cause: The VM failed to boot or become SSH-ready within the timeout period.Solution:
-
Increase the timeout:
-
Check system resources:
-
Verify the VM process is running:
-
Check Firecracker logs (if available):
Network Issues
NetworkError: Failed to create TAP device
NetworkError: Failed to create TAP device
Cause: Insufficient permissions or network configuration issues.Solution:
-
Verify sudo/root access:
-
Check for conflicting TAP devices:
-
Clean up stale network resources:
-
Re-run system setup to configure network permissions:
Cannot access internet from VM
Cannot access internet from VM
Cause: NAT or routing configuration issue.Solution:
-
Verify NAT is configured:
-
Test connectivity from the VM:
-
Check firewall rules:
Port forwarding not working
Port forwarding not working
Cause: Port already in use or forwarding rules not applied.Solution:
-
Check if the host port is available:
-
Use a different port:
-
Verify forwarding rules:
SSH and Command Execution
CommandExecutionUnavailableError
CommandExecutionUnavailableError
SSH connection refused
SSH connection refused
Cause: SSH service not started in the VM or connection blocked.Solution:
-
Wait for SSH to be ready:
-
Check SSH service status:
-
Verify guest IP and SSH port:
Command hangs or times out
Command hangs or times out
Cause: Long-running command or SSH connection issue.Solution:
-
Run commands in the background for long operations:
-
Check command output for errors:
Image and Storage Issues
ImageError: Failed to download or build image
ImageError: Failed to download or build image
Cause: Network issues, disk space, or corrupted image cache.Solution:
-
Check available disk space:
-
Clear image cache and rebuild:
-
Verify network connectivity:
Disk mode conflicts or read-only filesystem
Disk mode conflicts or read-only filesystem
Cause: Multiple VMs sharing the same disk in conflicting modes.Solution:Use isolated disk mode (default) for per-VM isolation:Or explicitly set shared mode if needed:
Error Reference
SmolVM uses a structured exception hierarchy. All exceptions inherit fromSmolVMError.
Exception Types
| Exception | Description | Common Causes |
|---|---|---|
ValidationError | Input validation failed | Invalid configuration, bad parameters |
VMAlreadyExistsError | VM ID already in use | Duplicate VM creation |
VMNotFoundError | VM doesn’t exist | Wrong ID, VM already deleted |
NetworkError | Network operation failed | TAP device, NAT, IP allocation issues |
HostError | Host environment issue | Missing KVM, dependencies, permissions |
ImageError | Image operation failed | Download, checksum, cache problems |
FirecrackerAPIError | Firecracker API call failed | VM boot failure, API communication |
OperationTimeoutError | Operation exceeded timeout | Slow boot, network delays |
CommandExecutionUnavailableError | Command execution not available | SSH not configured, wrong VM profile |
Accessing Error Details
All exceptions include structured error information:Debugging Techniques
Enable Verbose Logging
Increase logging verbosity to see detailed operations:Inspect VM State
Check VM status and metadata:Check System State
List all VMs and their states:Clean Up Resources
Remove stale or problematic VMs:Getting Help
If you’re still experiencing issues:- Check the documentation: Review relevant guides and API reference
- Run diagnostics:
smolvm doctor --jsonprovides detailed system info - Search issues: Look for similar problems in the GitHub issues
- Join the community: Get help on Slack
- Report bugs: Open a new issue with:
- Output of
smolvm doctor --json - Steps to reproduce
- Expected vs actual behavior
- Relevant logs and error messages
- Output of
Next Steps
Performance
Optimize VM performance and throughput
Security Considerations
Secure your SmolVM deployments