Skip to content

How to remote debugging on a vagrant machine? #303

Answered by mfussenegger
TornaxO7 asked this question in Q&A
Discussion options

You must be logged in to vote

If you change the vagrant configuration to:

Vagrant.configure("2") do |config|
    config.vm.box = "generic/debian10"
    config.vm.network "forwarded_port", guest: 3128, host: 3128
    config.vm.network "forwarded_port", guest: 5678, host: 5678
    # ...
end

and start debugpy with python -m debugpy --listen 0.0.0.0:5678 --wait-for-client /tmp/test.py it should work.
Vagrant (or rather, virtualbox if using the default provider) sets up some 10.0.x.y interface for communication from host to guest system. If you start debugpy with --listen 5678 it will bind to 127.0.0.1 in the guest and the host won't be able to communicate with it. Using 0.0.0.0:5678 ensures that it will bind the debugpy…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@TornaxO7
Comment options

@mfussenegger
Comment options

@TornaxO7
Comment options

@TornaxO7
Comment options

Answer selected by TornaxO7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants