···2222- ⚙️ **Configurable**: Customize CPU, memory, cores, and more
2323- 🌐 **Network Ready**: Support for both NAT (SSH port forwarding) and bridge
2424 networking
2525-- 📝 **Serial Console**: Direct terminal access via `-nographic` mode
2525+- � **Port Forwarding**: Custom port mapping with `--port-forward` option
2626+- �📝 **Serial Console**: Direct terminal access via `-nographic` mode
2627- 🗃️ **VM Management**: Persistent state tracking with SQLite database
2727-- 📋 **VM Lifecycle**: Start, stop, list, and inspect VMs with unique names
2828+- 📋 **VM Lifecycle**: Start, stop, restart, list, and inspect VMs with unique names
2929+- 🗑️ **VM Cleanup**: Remove VMs from tracking with `rm` command
3030+- 📊 **Logs Management**: View and follow VM logs in real-time
3131+- 🔄 **Background Mode**: Run VMs detached with `--detach` option
2832- 🎯 **Smart Detection**: Automatically detects existing disk images to avoid
2933 data loss
3034- 🔗 **Bridge Support**: Automatic bridge network creation and QEMU
···7377# Start a specific VM by name or ID
7478openbsd-up start my-vm-name
75798080+# Start a VM in the background (detached mode)
8181+openbsd-up start my-vm-name --detach
8282+7683# Stop a running VM
7784openbsd-up stop my-vm-name
78858686+# Restart a VM
8787+openbsd-up restart my-vm-name
8888+8989+# Remove a VM from state tracking
9090+openbsd-up rm my-vm-name
9191+7992# Inspect VM details and configuration
8093openbsd-up inspect my-vm-name
9494+9595+# View VM logs
9696+openbsd-up logs my-vm-name
9797+9898+# Follow VM logs in real-time
9999+openbsd-up logs my-vm-name --follow
81100```
8210183102### Advanced Configuration
···92111 --disk-format qcow2 \
93112 --size 40G
94113114114+# Run VM in background (detached mode)
115115+openbsd-up 7.8 --detach
116116+95117# Bridge networking (requires sudo)
96118openbsd-up 7.8 --bridge br0
97119120120+# Custom port forwarding (host:guest port mappings)
121121+openbsd-up 7.8 --port-forward 8080:80,3000:3000
122122+98123# Save downloaded ISO to specific location
99124openbsd-up 7.8 --output ~/isos/openbsd-78.iso
100125```
···103128104129### Global Options
105130106106-| Option | Short | Description | Default |
107107-| --------------- | ----- | ------------------------------------------------------------ | -------------- |
108108-| `--output` | `-o` | Output path for downloaded ISO | Auto-generated |
109109-| `--cpu` | `-c` | CPU type to emulate | `host` |
110110-| `--cpus` | `-C` | Number of CPU cores | `2` |
111111-| `--memory` | `-m` | RAM allocation | `2G` |
112112-| `--image` | `-i` | Path to persistent disk image | None |
113113-| `--disk-format` | | Disk format (qcow2, raw, etc.) | `raw` |
114114-| `--size` | | Size of disk image to create if it doesn't exist | `20G` |
115115-| `--bridge` | `-b` | Name of the network bridge to use for networking (e.g., br0) | None |
131131+| Option | Short | Description | Default |
132132+| ---------------- | ----- | ------------------------------------------------------------ | -------------- |
133133+| `--output` | `-o` | Output path for downloaded ISO | Auto-generated |
134134+| `--cpu` | `-c` | CPU type to emulate | `host` |
135135+| `--cpus` | `-C` | Number of CPU cores | `2` |
136136+| `--memory` | `-m` | RAM allocation | `2G` |
137137+| `--image` | `-i` | Path to persistent disk image | None |
138138+| `--disk-format` | | Disk format (qcow2, raw, etc.) | `raw` |
139139+| `--size` | | Size of disk image to create if it doesn't exist | `20G` |
140140+| `--bridge` | `-b` | Name of the network bridge to use for networking (e.g., br0) | None |
141141+| `--detach` | `-d` | Run VM in the background and print VM name | `false` |
142142+| `--port-forward` | `-p` | Port forwarding rules (hostPort:guestPort, comma-separated) | None |
116143117144### Subcommands
118145···121148| `ps` | List virtual machines | `openbsd-up ps --all` |
122149| `start <name>` | Start a stopped VM by name or ID | `openbsd-up start my-vm` |
123150| `stop <name>` | Stop a running VM by name or ID | `openbsd-up stop my-vm` |
151151+| `restart <name>` | Restart a VM by name or ID | `openbsd-up restart my-vm` |
152152+| `rm <name>` | Remove a VM from state tracking | `openbsd-up rm my-vm` |
124153| `inspect <name>` | Show detailed VM information and configuration | `openbsd-up inspect my-vm` |
154154+| `logs <name>` | View VM logs | `openbsd-up logs my-vm` |
125155126156## 🖥️ Console Setup
127157···139169140170### NAT Mode (Default)
141171142142-- **SSH Port Forward**: `localhost:2222` → VM port `22`
172172+- **SSH Port Forward**: `localhost:2222` → VM port `22` (default)
173173+- **Custom Port Forwarding**: Configure with `--port-forward` option
143174- **Network Device**: Intel E1000 emulated NIC
144175- No special privileges required
145176177177+#### Custom Port Forwarding Examples
178178+179179+```bash
180180+# Forward host port 8080 to VM port 80
181181+openbsd-up 7.8 --port-forward 8080:80
182182+183183+# Multiple port forwards
184184+openbsd-up 7.8 --port-forward 8080:80,3000:3000,2222:22
185185+186186+# Access services after VM is running
187187+curl http://localhost:8080 # Access VM's port 80
188188+ssh -p 2222 user@localhost # SSH to VM
189189+```
190190+146191### Bridge Mode
147192148193- **Direct Bridge Access**: VM gets IP from bridge network
···180225- Start/stop VMs by name or ID
181226- Inspect detailed VM configurations
182227183183-## �💡 Tips
228228+## 💡 Tips
184229185230- 🐏 Allocate at least 2GB RAM for smooth installation
186231- 💿 ISOs are cached - re-running with same version skips download
···190235- 🏷️ Use VM names for easy management: `openbsd-up start my-web-server`
191236- 🌉 Bridge networking requires sudo but provides direct network access
192237- 📊 Use `openbsd-up ps --all` to see both running and stopped VMs
238238+- 🔄 Use `--detach` mode to run VMs in the background
239239+- 🔗 Configure custom port forwarding with `--port-forward host:guest`
240240+- 📝 Monitor VM activity with `openbsd-up logs <name> --follow`
241241+- 🗑️ Clean up unused VMs with `openbsd-up rm <name>`
193242194243### Creating Persistent VMs
195244···197246# Create a VM with persistent storage
198247openbsd-up 7.8 --image my-server.qcow2 --disk-format qcow2 --size 40G
199248249249+# Run a VM in the background
250250+openbsd-up 7.8 --detach --image background-vm.img
251251+252252+# Set up a web server VM with port forwarding
253253+openbsd-up 7.8 --image webserver.qcow2 --port-forward 8080:80,8443:443
254254+200255# Later, restart the same VM (no ISO needed for installed systems)
201256openbsd-up start <vm-name>
257257+258258+# Monitor the VM logs
259259+openbsd-up logs <vm-name> --follow
202260```
203261204262## 🔧 Architecture