Skip to content

Commit 09846ae

Browse files
author
User
committed
docs: expand hyper-v.md from 46 to 83 lines
Added create/start/stop API examples, detailed limitation table, architecture flow, use-case guidance for Hyper-V vs VirtualBox.
1 parent 8a4c775 commit 09846ae

1 file changed

Lines changed: 57 additions & 20 deletions

File tree

docs/hyper-v.md

Lines changed: 57 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,82 @@
22

33
## Requirements
44

5-
- **Windows 11 Pro, Enterprise, or Education** (Home edition doesn't include Hyper-V)
5+
- **Windows 11 Pro, Enterprise, or Education** Home edition doesn't include Hyper-V at all
66
- **Hyper-V feature enabled** in Windows Features
7+
- No VirtualBox or VBoxManage needed — Hyper-V is built into Windows
78

89
```powershell
9-
# Enable Hyper-V (Admin):
10+
# Enable Hyper-V (Admin, one-time):
1011
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
12+
# Reboot required
1113
```
1214

1315
## VM Management
1416

15-
Same UI as VirtualBox — the VMs page shows both providers. Hyper-V VMs have a blue badge.
17+
The main VMs page shows VirtualBox and Hyper-V side by side. Hyper-V VMs are marked with a blue badge.
1618

17-
| Action | How |
18-
|--------|-----|
19-
| List VMs | `GET /api/v1/vms` (includes Hyper-V VMs) |
20-
| Create | Set `provider: "hyperv"` in the create form |
21-
| Start/Stop | Same buttons, routed to Hyper-V via `?provider=hyperv` |
22-
| Pause/Resume | Same as VirtualBox |
19+
### Create a Hyper-V VM
2320

24-
## Limitations
21+
From the **Hyper-V** page:
22+
1. Click **Create VM**
23+
2. Set name, RAM (MB), disk (GB)
24+
3. The VM is created with default switch networking (NAT-equivalent)
2525

26-
Hyper-V support is currently focused on **basic lifecycle** (create, start, stop, pause, resume). Compared to VirtualBox:
26+
Via API:
27+
```powershell
28+
POST /api/v1/vms
29+
Content-Type: application/json
30+
31+
{"name": "hyperv-test", "provider": "hyperv", "memory_mb": 4096, "disk_gb": 40}
32+
```
33+
34+
### Start / Stop / Pause / Resume
35+
36+
Same buttons as VirtualBox — the provider is detected from the VM metadata. The backend routes to Hyper-V PowerShell cmdlets automatically.
37+
38+
| Action | Button | API |
39+
|--------|--------|-----|
40+
| Start | ▶ Start | `POST /api/v1/vms/{name}/start?provider=hyperv` |
41+
| Stop | ■ Stop | `POST /api/v1/vms/{name}/stop?provider=hyperv` |
42+
| Pause | ⏸ Pause | `POST /api/v1/vms/{name}/pause?provider=hyperv` |
43+
| Resume | ▶ Resume | `POST /api/v1/vms/{name}/resume?provider=hyperv` |
44+
45+
## Current limitations
46+
47+
Hyper-V support is focused on **basic lifecycle operations**. Advanced VirtualBox features are not available for Hyper-V:
2748

2849
| Feature | VirtualBox | Hyper-V |
2950
|---------|-----------|---------|
51+
| Create / Start / Stop |||
52+
| Pause / Resume |||
53+
| Delete |||
3054
| Snapshots |||
31-
| Networking |(NAT, bridged, etc.) | |
32-
| Console | ✅ (VRDP + VNC) ||
33-
| ISO attach |||
55+
| Network config (NAT, bridged, etc.) | | ❌ (uses default switch) |
56+
| Console (VNC / VRDP) | ||
57+
| ISO attach / detach |||
3458
| Unattended install |||
59+
| Port forwarding |||
60+
| Templates |||
61+
62+
Hyper-V is ideal for:
63+
- **Lightweight Windows dev VMs** that just need to exist and run
64+
- **Quick testing** where you don't need snapshot rollback or console access
65+
- **Leveraging Windows-native virtualization** without installing VirtualBox
3566

36-
Hyper-V is best for **lightweight Windows VM management** — if you need advanced features, use VirtualBox.
67+
If you need snapshots, console access, advanced networking, or ISO management, use VirtualBox instead — both providers coexist on the same machine.
3768

3869
## Architecture
3970

40-
Hyper-V calls go through PowerShell cmdlets:
41-
```python
42-
# vm_service.py routes to:
43-
hyperv_manager → PowerShell → Hyper-V WMI
71+
Hyper-V operations go through PowerShell cmdlets, not VBoxManage:
72+
73+
```
74+
Frontend POST → REST API → vm_service → hyperv_manager → PowerShell → Hyper-V WMI
4475
```
4576

46-
No VBoxManage needed. Hyper-V operations run in a separate process via `subprocess.run(["powershell", "-Command", ...])`.
77+
The `hyperv_manager.py` module runs PowerShell commands via `subprocess.run`:
78+
- `Get-VM` — list VMs
79+
- `New-VM` — create VM
80+
- `Start-VM` / `Stop-VM` / `Suspend-VM` / `Resume-VM` — lifecycle
81+
- `Remove-VM` — delete
82+
83+
No VBoxManage, no VirtualBox installation required. Works on any Windows edition that supports Hyper-V.

0 commit comments

Comments
 (0)