Skip to content

Commit 0755886

Browse files
committed
README: Add kgdb instructions
1 parent 003b169 commit 0755886

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ For example, you can:
88

99
* Connect to Docker for Windows from the Linux Docker client in WSL
1010
* Connect interactively to a Hyper-V Linux VM's serial console
11+
* Use gdb to connect to debug the kernel of a Hyper-V Linux VM
1112

1213
Let me know on Twitter ([@gigastarks](https://twitter.com/gigastarks)) if you come up with more interesting uses.
1314

@@ -137,7 +138,8 @@ Refer to your VM Linux distribution's instructions for enabling the serial conso
137138

138139
### Connecting to the serial port
139140

140-
For this step, WSL must be running elevated
141+
For this step, WSL must be running elevated or your Windows user must be in the
142+
Hyper-V Administrators group.
141143

142144
#### Directly via socat
143145

@@ -165,6 +167,18 @@ $ screen $HOME/foo-pty # Attaches to the serial
165167

166168
See the `screen` documentation (`man screen`) for more details.
167169

170+
## Debugging the kernel of a Hyper-V Linux VM
171+
172+
Follow the same steps to enable the COM port for your VM, then run the serial
173+
relay as though you were going to run `screen` to connect to the serial console.
174+
175+
Next, run gdb and connect to the serial port:
176+
177+
```bash
178+
gdb ./vmlinux
179+
target remote /home/<myuser>/foo-pty
180+
```
181+
168182
## Custom usage
169183

170184
Take a look at the scripts for sample usage, or run `npiperelay.exe` without any parameters for parameter documentation.

0 commit comments

Comments
 (0)