New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 848127 link

Starred by 43 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Feature



Sign in to add a comment

Port forwarding

Project Member Reported by tbuck...@chromium.org, May 31 2018

Issue description

Allow users to choose VM ports in Settings to make accessible from external devices. This will allow users to debug their website on a mobile phone.
 
Cc: jopra@chromium.org

Comment 2 by jopra@chromium.org, May 31 2018

I think port forwarding is also useful for web developers who want to debug HTTPS websites.

Possibly the two use cases should be separate bugs.

Comment 3 Deleted

Comment 4 Deleted

There is a workaround for this. Run "ip addr" to find the IP of your VM then use "Connection Forwarder" from the chrome store to forward connections to your chromebooks local ip into the container's ip. 

https://chrome.google.com/webstore/detail/connection-forwarder/ahaijnonphgkgnkbklchdhclailflinn

I use this setup to test a web app running in development mode with my phone.
Status: Assigned (was: Available)
Doesn't look like the extension works with a web socket.

Also it looks like port 8000 is already forwarding. Any others set by default?

Looks like port 8080 works also by default
re: default ports and workaround:

When I grep for ssh processes in crosh (`ps aux | grep ssh`), there's one that forwards ports to the container I'm running:

```
/usr/bin/ssh \
  -i /run/vm_cicerone/private_key \
  -o UserKnownHostsFile=/run/vm_cicerone/known_hosts \
  -N \
  -p 2222 \
  -L 3000:localhost:3000 \
  -L 4200:localhost:4200 \
  -L 5000:localhost:5000 \
  -L 8000:localhost:8000 \
  -L 8008:localhost:8008 \
  -L 8080:localhost:8080 \
  -L 8085:localhost:8085 \
  -L 8888:localhost:8888 \
  -L 9005:localhost:9005 \
  <username redacted>@<ip address redacted>
```

I guess these ports are the ones forwarded by default.

I was able to forward an additional port by executing a similar command in a crosh shell:

```
sudo su \
  -s /bin/bash
  -c '/usr/bin/ssh \
    -i /run/vm_cicerone/private_key
    -o UserKnownHostsFile=/run/vm_cicerone/known_hosts 
    -N \
    -p 2222 \
    -L 9000:localhost:9000 \
    <username redacted>@<ip address redacted>' \
  vm_cicerone
```

I have developer mode enabled and I'm not sure if that's necessary for this workaround though.
I keep losing the port forwards for some reason today. I'm fine if I use my 100.*.*.* address to access web services running. I'm guessing the SSH sessions are dying? Everything was working great last night. I don't know what I'm doing different other than taxing the system more.

I start the terminal and it works great. Then within a few minutes all the port forwards die.

Sign in to add a comment