#!/bin/bash

echo "🚀 === Particle-OS VM Connection Helper ==="
echo ""

echo "📊 VM Status:"
sudo virsh list --all | grep particle-os-test
echo ""

echo "🌐 Network Status:"
sudo virsh net-list --all | grep particle-os-net
echo ""

echo "🔌 SSH Port Forwarding:"
ss -tlnp | grep :2222
echo ""

echo "📱 VM Network Info:"
sudo virsh domifaddr particle-os-test
echo ""

echo "🔗 Connection Options:"
echo ""
echo "1. SSH via Port Forwarding (Recommended):"
echo "   ssh -p 2222 user@localhost"
echo "   (Replace 'user' with the username from the live ISO)"
echo ""
echo "2. VNC Viewer:"
echo "   Connect to: particle-os:5900"
echo "   (Use virt-manager or any VNC client)"
echo ""
echo "3. Console Access:"
echo "   sudo virsh console particle-os-test"
echo "   (Press Ctrl+] to exit)"
echo ""

echo "💡 Tips:"
echo "- The live ISO may take a few minutes to boot"
echo "- Default Debian Live username is usually 'user' or 'debian'"
echo "- If SSH doesn't work, try the console first to see boot progress"
echo "- Check 'sudo virsh domifaddr particle-os-test' for IP address"
echo ""

echo "🚀 Ready to connect!"
