Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port forwarding #309

Open
Saviq opened this issue Jul 4, 2018 · 4 comments
Open

Port forwarding #309

Saviq opened this issue Jul 4, 2018 · 4 comments
Labels
Projects

Comments

@Saviq
Copy link
Collaborator

@Saviq Saviq commented Jul 4, 2018

Forwarding instance ports out onto multipassd's listening address(es):

# can pass multiple --forward rules
$ multipass launch --forward <target_port>[:<listen_port>]
Port forwarding configured on:
Port <target_port>: <external_ip>:<listen_port>

$ multipass forward <name> <target_port>[:<listen_port>]
Port forwarding configured on: <external_ip>:<listen_port>

$ multipass unforward <name>[:<target_port>] [<name>[:<target_port>] ...]

$ multipass info <name>
[...]
Port forwarding:
<target_port>  <listen_port>

Where it's possible / makes sense, use hypervisor for this, otherwise have multipassd listen.

@Saviq Saviq created this issue from a note in 18.10 cycle (Backlog) Jul 4, 2018
@Saviq Saviq added this to To do in 19.10 cycle via automation Feb 21, 2019
@setempler

This comment has been minimized.

Copy link

@setempler setempler commented Jul 21, 2019

Possible w/ ssh local (or remote) port forwarding:

  • forward requests from multipass host (port 9000) to multipass instance (port 80)

      sudo ssh \
          -i /var/root/Library/Application\ Support/multipassd/ssh-key/id_rsa \
          -L 9000:localhost:80 \
          multipass@<multipass instance ip>
    
  • access multipass instance (port 80) from any box that can access multipass host

      curl <mutlipass host ip>:9000
    

Notes:

  • ssh key path valid for macOS #913
  • related issues #512 #118
@JonTheNiceGuy

This comment has been minimized.

Copy link

@JonTheNiceGuy JonTheNiceGuy commented Feb 3, 2020

Can I also request another feature?

bridge <NICNAME> == vboxmanage modifyvm "VM name" --nic2 bridged --bridgeadapter2 NICNAME

unbridge <NICNAME> == vboxmanage modify "VM name" --nic2 none

@Saviq

This comment has been minimized.

Copy link
Collaborator Author

@Saviq Saviq commented Feb 3, 2020

@JonTheNiceGuy that would be #118 - remember we need to be able to support the features across all of the hypervisors, not everywhere it is as easy as this :)

@Saviq Saviq removed the question label Feb 3, 2020
@JonTheNiceGuy

This comment has been minimized.

Copy link

@JonTheNiceGuy JonTheNiceGuy commented Feb 4, 2020

not everywhere it is as easy as this :)

Fair comment :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
19.10 cycle
  
To do
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.