microsoft/openvmm

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
7d61702bf0cba28ca985f1a5ef27c4e1caec009c

Branches

Tags

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

Clone

HTTPS

Download ZIP

Guide/src/dev_guide/dev_tools/hypestv.md

108lines · 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
25In the future, it might be able to:
26
27* Enable Hyper-V log output
28* Capture serial port output to a file
29* Inspect host state
30* Persistence workspaces (save/restore configured serial ports and logs)
31
32## Example session
33
34`hypestv` launches into a detached mode, unless you specify a VM name on the
35command line. To select a VM to work on, the VM named `tdxvm` in this example,
36use the `select` command. If successful, you will now see the name and VM state
37in the prompt:
38
39```
40> select tdxvm
41tdxvm [off]>
42```
43
44After this, all commands will implicitly operate on `tdxvm`. Use `select` again
45to work on another VM.
46
47To enable serial port output, use the `serial` command. This can be used at any
48time, even while the VM is not running. E.g., to open a separate window for
49interactive use of COM1 and enable logging serial port output for COM2:
50
51```
52tdxvm [off]> serial 1 term
53tdxvm [off]> serial 2 log
54```
55
56You can also enable paravisor log output at any time:
57
58```
59tdxvm [off]> paravisor kmsg log
60```
61
62Start a VM with `start`. This is an asynchronous command: you can continue to
63type other commands at the prompt while the VM starts. You should see an output
64message when the VM finishes starting, as well as output about any configured
65serial ports connecting.
66
67Note that, due to limitations of the `rustyline` crate, the displayed VM state
68on the prompt may not be accurate until you type another command or press Enter.
69
70```
71tdxvm [off]> start
72com1 connected
73com2 connected
74VM started
75tdxvm [off]>
76tdxvm [running]>
77```
78
79At this point, the VM is running, including the paravisor (if one is
80configured). As in the OpenVMM interactive console, you can inspect paravisor
81state with the `inspect` or `x` command, but under the `paravisor`/`pv` command:
82
83```
84tdxvm [running]> pv x
85{
86 build_info: _,
87 control_state: "started",
88 mesh: _,
89 proc: _,
90 trace: _,
91 uhdiag: _,
92 vm: _,
93}
94```
95
96You can terminate the VM with `kill`. This will disconnect any connected serial
97ports as well, but they will reconnect next time the VM starts. Killing a VM
98does not detach/deselect it; subsequent commands will continue to operate on the
99VM.
100
101```
102tdxvm [running]> kill
103com1 disconnected
104com2 disconnected
105VM killed
106tdxvm [stopping]>
107tdxvm [off]>
108```
109