microsoft/openvmm

Public

mirrored from https://github.com/microsoft/openvmmAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
7b228ba1c5ed173d8d960f5f8a702b0372dad2de

Branches

Tags

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

Clone

HTTPS

Download ZIP

Guide/src/dev_guide/dev_tools/hypestv.md

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