Remote debug from Windows Host to Linux VM
I am using GoLand 2018.1.4 on Windows 2016 version 1607 with Go 1.10.
I am trying to setup a remote debug using the instructions provided in the configurations dialog.The target machine is a Debian 9.1 x64 VM with Go 1.10 installed.
It builds correctly and runs properly. After after connecting to dlv from the IDE the breakpoints get a cross on them. Note that I set the breakpoints before running the debug session.
And on the target machine the application continues to work.
Could someone guide me on how to get remote debugging working?
Please sign in to leave a comment.
Is your project under the same package path in the VM and on the host machine? I can't tell it very well because of the blurred images but it looks like one project is in "/x/repos/go" (which does not appear to be a valid Go Workspace, https://golang.org/doc/code.html#Workspaces) and one is under "$GOPATH/src/github.com/..." (which looks like a valid Go Workspace).
Thank you.
Both of them are on the same path. On the VM its /x/repos/go/src/github.com/hardy/xxx/ and on my windows machine its on X:\repos\go\src\github.com\hardy\xxx\
This is the GOPATH on the VM
This is a better example:
I solved it! The global GOPATH was incorrectly set.