Open pd93 opened 4 years ago
Hello, this is something that I would love to have inside VSCode for remote development. How can we upvote it ? Is it only with a 👍🏼 on the issue ? Or is there some more formal process ?
Do you mean --expose option in addition to -p ? [docker run --expose] (https://docs.docker.com/engine/reference/commandline/run/#publish-or-expose-port--p---expose)
@PavelSosin-320 I think this issue is more about Remote - SSH extension, where what you're talking about is docker containers. Which would maybe be useful for the Remote - Containers extension but not SSH.
I have updated the title to better reflect that this is request is specifically for Remote SSH, not Containers or WSL.
Landed here because I also need it for mobile development, but handling "ssh -R" sounds like a good idea anyway, not too far from how "ssh -L" is done anyway (maybe?).
@Shosta This issue has nothing to do with Docker or ADB. I simply used ADB/Flutter as an example of a use case for the requested feature. While I appreciate the steps you've outlined in your comment might be useful for some, I'm not sure that this is the right place for it as it could confuse users who are coming here trying to get Remote SSH working.
Yes sure. If it is only related as an exemple.
Sorry for that.
This feature request has not yet received the 10 community upvotes it takes to make to our backlog. 10 days to go. To learn more about how we handle feature requests, please see our documentation.
Happy Coding
What about now? 🚀
+1, please that is really usefull, as a workaround, I've open the ports using wsl1
I know the original example is for remote SSH, but this would also be useful for containers. May not be best practice, but I was developing something in a container, moved it to a remote server, but still wanted to connect to it from a test script in the local container. The remote port is automatically forwarded to my local PC but I can't access it directly from the container.
This might be unrelated, but I was curious on how you managed to run Flutter on an emulator/physical device while developing remotely through SSH. I have managed to connect my device to ADB on the remote server, but flutter run
never finishes connecting to the VM service and observatory, while VS Code debug simply results in a black screen on my device.
@EirikFA its definitely not the simplest setup. However, once you get the hang of it, it is really quite nice to work with. I actually realised there were a couple of mistakes in my OP (now updated). Here's some steps/tips to get you started:
Ensure that you have the following installed on your local machine:
adb
in particular)Ensure that you have the following installed on your remote machine:
adb
in particular)Ensure that you have forwarded your port (in my case, I use 5555
)
Host myhost
User myuser
HostName x.x.x.x
RemoteForward 5555 127.0.0.1:5555
Start up a physical/emulated device (if physical, connect it via usb)
In your local terminal (powershell etc.):
adb devices
adb tcpip 5555
(restarts the debugger in TCPIP mode on port 5555)Load up VSCode (it should now remote forward the port for you)
On your remote terminal:
adb connect 127.0.0.1:5555
adb devices
adb connect
would not work. Turns out if you use an emulated device without the play store installed, it works just fine 🤷♂️ No idea why still (it's something to do with the adb authorization pop up).-s
or -t
flags.adb kill-server && adb start-server
and start again.localhost
instead of 127.0.0.1
in the adb connect
command. Doesn't work!p.s. I hope I haven't missed anything as I don't actually have this set up on my machine to test right now. Feel free to reply if you have any issues!
p.p.s If you're really adventurous, you can get wireless adb with a real device working! It's really puts a smile on your face to have your code on a remote dev machine auto-hot-reload onto a physical device with no cables!
@pd93 I see. I did in fact make it work with a physical device wirelessly, after making remote forwarding the ADB daemon and the VM service port (and specifying the latter and --dds-port
).
Hi, I also encountered this problem, is there any solution here?
Description
VSCode currently only displays Remote SSH port forwards in one direction (
LocalForward
orssh -L
). Please consider adding support forRemoteForward
orssh -R
.Use case
I've recently started using this in order to develop with the Flutter framework remotely over SSH with the Android emulator running on my local machine and the Flutter SDK and VS Code extension running on the remote.
This is possible by running
adb tcpip 5555
on your local machine (with an Android emulator running or phone plugged in via USB). You can then forward the ADB port (ssh -R 5555 127.0.0.1:5555
) to the remote, runadb connect 127.0.0.1:5555
and VS Code picks up the device perfectly.See example
~/.ssh/config
below:How it looks now: