microsoft/openvmm

Public

mirrored fromhttps://github.com/microsoft/openvmmAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
fe2bbc9829558a07c5e06d2b6ececc383b6593bf

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

Guide/src/dev_guide/dev_tools/hypestv.md

109lines · modecode

1# hypestv
2
3`hypestv` is an interactive command-line interface for Hyper-V VMs, designed for
4making OpenHCL developers' lives easier.
5
6Similar to [`ohcldiag-dev`][], it can interact with the OpenHCL paravisor
7running inside a Hyper-V VM. But unlike `ohcldiag-dev`, it sports an interactive
8terminal interface (with history and tab completion), and it is specifically
9designed to interact with Hyper-VMs.
10
11[`ohcldiag-dev`]: ../../reference/openhcl/diag/ohcldiag_dev.md
12
13In many ways, it is similar to the OpenVMM interactive console. In time, it may
14end up sharing code and capabilities with it and with `ohcldiag-dev`, but it
15will always be a Hyper-V specific tool.
16
17Currently, it can:
18
19* Change VM state (starting/stopping/resetting)
20* Enable serial port output to standard output, or input/output to another
21 terminal window
22* Enable paravisor log output to standard output or another terminal window
23* Inspect paravisor state
24* Modify the paravisor (update the paravisor command line, reload the paravisor)
25
26In the future, it might be able to:
27
28* Enable Hyper-V log output
29* Capture serial port output to a file
30* Inspect host state
31* Persistence workspaces (save/restore configured serial ports and logs)
32
33## Example session
34
35`hypestv` launches into a detached mode, unless you specify a VM name on the
36command line. To select a VM to work on, the VM named `tdxvm` in this example,
37use the `select` command. If successful, you will now see the name and VM state
38in the prompt:
39
40```text
41> select tdxvm
42tdxvm [off]>
43```
44
45After this, all commands will implicitly operate on `tdxvm`. Use `select` again
46to work on another VM.
47
48To enable serial port output, use the `serial` command. This can be used at any
49time, even while the VM is not running. E.g., to open a separate window for
50interactive use of COM1 and enable logging serial port output for COM2:
51
52```text
53tdxvm [off]> serial 1 term
54tdxvm [off]> serial 2 log
55```
56
57You can also enable paravisor log output at any time:
58
59```text
60tdxvm [off]> paravisor kmsg log
61```
62
63Start a VM with `start`. This is an asynchronous command: you can continue to
64type other commands at the prompt while the VM starts. You should see an output
65message when the VM finishes starting, as well as output about any configured
66serial ports connecting.
67
68Note that, due to limitations of the `rustyline` crate, the displayed VM state
69on the prompt may not be accurate until you type another command or press Enter.
70
71```text
72tdxvm [off]> start
73com1 connected
74com2 connected
75VM started
76tdxvm [off]>
77tdxvm [running]>
78```
79
80At this point, the VM is running, including the paravisor (if one is
81configured). As in the OpenVMM interactive console, you can inspect paravisor
82state with the `inspect` or `x` command, but under the `paravisor`/`pv` command:
83
84```text
85tdxvm [running]> pv x
86{
87 build_info: _,
88 control_state: "started",
89 mesh: _,
90 proc: _,
91 trace: _,
92 uhdiag: _,
93 vm: _,
94}
95```
96
97You can terminate the VM with `kill`. This will disconnect any connected serial
98ports as well, but they will reconnect next time the VM starts. Killing a VM
99does not detach/deselect it; subsequent commands will continue to operate on the
100VM.
101
102```text
103tdxvm [running]> kill
104com1 disconnected
105com2 disconnected
106VM killed
107tdxvm [stopping]>
108tdxvm [off]>
109```
110