···15151616### Core VM Management
17171818-- ๐๏ธ **Full VM lifecycle management**: Create, start, stop, inspect, and remove
1818+- ๐๏ธ **Full VM lifecycle management**: Create, start, stop, restart, inspect, and remove
1919 VMs
2020- ๐พ **Persistent state tracking**: SQLite database stores VM configurations and
2121 state
2222- ๐ **VM listing and monitoring**: View running and stopped VMs with detailed
2323 information
2424- ๐ **VM inspection**: Get detailed information about any managed VM
2525+- ๐ **VM logging**: View and follow VM logs with built-in log management
2626+- ๐ **VM restart**: Gracefully restart VMs with preserved configuration
2527- ๐๏ธ **VM removal**: Clean removal of VMs from the database
2628- ๐ท๏ธ **Auto-generated VM names**: Unique identifiers for easy VM management
2729- ๐๏ธ **Cross-platform support**: Works on both x86_64 and aarch64 architectures
3030+- ๐ง **Background mode**: Run VMs in detached mode for headless operation
28312932### Network & Storage
3033···3235- ๐ **Network bridge support**: Automatic bridge creation and management with
3336 `--bridge`
3437- ๐ง **MAC address management**: Persistent MAC addresses for each VM
3535-- ๐พ **Persistent storage support**: Attach and auto-create disk images
3838+- ๏ฟฝ **Port forwarding**: Custom port mapping for network services with `--port-forward`
3939+- ๏ฟฝ๐พ **Persistent storage support**: Attach and auto-create disk images
3640- ๐๏ธ **Multiple disk formats**: Support for qcow2, raw, and other disk formats
3741- ๐ **Configurable disk sizes**: Specify disk image size on creation
3842···165169freebsd-up rm vm-name
166170```
167171172172+Restart a VM:
173173+174174+```bash
175175+freebsd-up restart vm-name
176176+```
177177+178178+View VM logs:
179179+180180+```bash
181181+freebsd-up logs vm-name
182182+```
183183+184184+Follow VM logs in real-time:
185185+186186+```bash
187187+freebsd-up logs vm-name --follow
188188+```
189189+168190````
169191### Customize VM Configuration
170192171171-Specify custom CPU type, core count, memory allocation, persistent storage, and networking:
193193+Specify custom CPU type, core count, memory allocation, persistent storage, networking, and port forwarding:
172194173195```bash
174196# Custom CPU and memory
···185207186208# Use bridge networking (requires sudo)
187209freebsd-up --bridge br0 14.3-RELEASE
210210+211211+# Configure port forwarding for specific services
212212+freebsd-up --port-forward 8080:80,2222:22 14.3-RELEASE
213213+214214+# Run VM in background (detached mode)
215215+freebsd-up --detach 14.3-RELEASE
188216189217# Download to specific location
190218freebsd-up --output ./downloads/freebsd.iso 15.0-BETA3
191219192220# Combine all options
193193-freebsd-up --cpu qemu64 --cpus 2 --memory 1G --image ./my-disk.qcow2 --disk-format qcow2 --size 30G --bridge br0 --output ./my-freebsd.iso
221221+freebsd-up --cpu qemu64 --cpus 2 --memory 1G --image ./my-disk.qcow2 --disk-format qcow2 --size 30G --bridge br0 --port-forward 8080:80,2222:22 --detach --output ./my-freebsd.iso
194222````
195223196224### Get Help
···227255### Network Options
228256229257- `-b, --bridge <name>` - Name of the network bridge to use (e.g., br0)
258258+- `-p, --port-forward <mappings>` - Port forwarding rules in the format hostPort:guestPort (comma-separated for multiple)
259259+260260+### Execution Options
261261+262262+- `-d, --detach` - Run VM in the background and print VM name
230263231264### File Options
232265···235268### Management Commands
236269237270- `ps [--all]` - List running VMs (use --all to include stopped VMs)
238238-- `start <vm-name>` - Start a specific VM by name
271271+- `start <vm-name> [--detach]` - Start a specific VM by name (optionally in background)
239272- `stop <vm-name>` - Stop a specific VM by name
273273+- `restart <vm-name>` - Restart a specific VM by name
240274- `inspect <vm-name>` - Show detailed information about a VM
275275+- `logs <vm-name> [--follow]` - View VM logs (optionally follow in real-time)
241276- `rm <vm-name>` - Remove a VM and its configuration from the database
242277243278### Help Options
···266301# Use bridge networking for better network performance
267302freebsd-up --bridge br0 14.3-RELEASE
268303304304+# Configure port forwarding for web and SSH access
305305+freebsd-up --port-forward 8080:80,2222:22 14.3-RELEASE
306306+307307+# Run VM in background mode
308308+freebsd-up --detach 14.3-RELEASE
309309+269310# Save ISO to specific location
270311freebsd-up --output ./isos/freebsd.iso https://example.com/freebsd.iso
271312272272-# Combine multiple options with bridge networking and persistent storage
273273-freebsd-up --cpu host --cpus 4 --memory 8G --image ./vm-disk.qcow2 --disk-format qcow2 --size 50G --bridge br0 --output ./downloads/ 14.3-RELEASE
313313+# Combine multiple options with bridge networking, port forwarding, and persistent storage
314314+freebsd-up --cpu host --cpus 4 --memory 8G --image ./vm-disk.qcow2 --disk-format qcow2 --size 50G --bridge br0 --port-forward 8080:80,2222:22 --detach --output ./downloads/ 14.3-RELEASE
274315275316# List all VMs (including stopped ones)
276317freebsd-up ps --all
277318278319# Start a previously created VM
279320freebsd-up start my-freebsd-vm
321321+322322+# Start a VM in background mode
323323+freebsd-up start my-freebsd-vm --detach
280324281325# Stop a running VM
282326freebsd-up stop my-freebsd-vm
283327328328+# Restart a VM
329329+freebsd-up restart my-freebsd-vm
330330+284331# Get detailed information about a VM
285332freebsd-up inspect my-freebsd-vm
286333334334+# View VM logs
335335+freebsd-up logs my-freebsd-vm
336336+337337+# Follow VM logs in real-time
338338+freebsd-up logs my-freebsd-vm --follow
339339+287340# Remove a VM
288341freebsd-up rm my-freebsd-vm
289342```
···313366 `--image`)
314367- **Network**: User mode networking with SSH forwarding (host:2222 โ guest:22)
315368 or bridge networking with `--bridge`
369369+- **Port Forwarding**: Configurable port mappings with `--port-forward`
316370- **Console**: Enhanced serial console via stdio with proper signal handling
317371- **Default Version**: FreeBSD 14.3-RELEASE (when no arguments provided)
318372- **State Management**: Persistent VM state stored in SQLite database
319373- **Auto-naming**: VMs get unique names for easy management
374374+- **Background Mode**: Support for detached execution with `--detach`
320375321376### Networking Modes
322377···375430freebsd-up --cpus 4
376431377432# Add persistent storage
378378-freebsd-up --image ./freebsd-data.qcow2 --disk-format qcow2
433433+freebsd-up --image ./freebsd-data.qcow2 --disk-format qcow2 14.3-RELEASE
379434380380-# Combine options with persistent storage
381381-freebsd-up --cpu host --cpus 4 --memory 8G --image ./vm-storage.qcow2 --disk-format qcow2 14.3-RELEASE
435435+# Configure port forwarding for web server and SSH
436436+freebsd-up --port-forward 8080:80,2222:22 14.3-RELEASE
437437+438438+# Run in background mode
439439+freebsd-up --detach 14.3-RELEASE
440440+441441+# Combine options with persistent storage and port forwarding
442442+freebsd-up --cpu host --cpus 4 --memory 8G --image ./vm-storage.qcow2 --disk-format qcow2 --port-forward 8080:80,2222:22 --detach 14.3-RELEASE
382443```
383444384445### Creating Disk Images
···466527 โโโ utils.ts # Core VM utilities and QEMU interface
467528 โโโ subcommands/ # CLI subcommand implementations
468529 โโโ inspect.ts # VM inspection command
530530+ โโโ logs.ts # VM logging command
469531 โโโ ps.ts # VM listing command
532532+ โโโ restart.ts # VM restart command
470533 โโโ rm.ts # VM removal command
471534 โโโ start.ts # VM start command
472535 โโโ stop.ts # VM stop command