Skip to content

trungnt2910/TcpToPipe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TcpToPipe

Discord Invite 

Forwards a named pipe server to a remote TCP server.

Usage

TcpToPipe --remote remotehost:port --pipe pipename

Use case - Remote debugging

This is mainly used to connect to virtual machines where KDNET is faulty to WinDbg. QEMU supports forwarding serial port output to a TCP server, while WinDbg supports reading COM debugging data from named pipes instead of COM devices to serve Hyper-V guests.

The tool is currently being used to debug ARM64 builds of lxmonika on QEMU-KVM.

On a machine running ARM64 Linux:

qemu-system-aarch64 \
  -M virt -m 12G -cpu host -smp 8,sockets=1,cores=8 \
  -accel kvm \
# a bunch of other options
  -serial tcp::3333,server=on,wait=off,nodelay=off \
  -vnc :0

On the virtual machine:

bcdedit /debug on
bcdedit /dbgsettings serial debugport:1 baudrate:115200

The port number is usually 1, not 0. You might need to increase this index if you have added other serial ports in the QEMU command line arguments before the chosen debugging device.

On the Windows debugger client:

TcpToPipe --remote linuxhostname.local:3333 --pipe lxmonika

After that, follow this guide from Microsoft, treating lxmonika as PipeName. Since the pipe is open on your local computer, you should ignore the VMHost part.

WinDbg through TcpToPipe

Community

Need help using this project? Join me on Discord and find a solution together.