Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Port Forwarding with VirtualBox on Windows #1333
I have installed MultiPass on a Windows system (
Like others have noted, when using the VirtualBox backend, you don't get an IPv4 address which is fine, but I'm able to configure any port forwarding or bridging, this is because MultiPass on Windows uses the System account, so I can't start the virtualbox user interface, nor can I run any commands using the "Run as Administrator" or "Run as different user" as... well, you can't use the system account like that.
Some have suggested that you should use an SSH tunnel, but as I can't see what port Multipass is connecting to, I'm stuck there too! (Also, I can't work out where the SSH key would be for Multipass either! Hat-tip to #913)
With a Vagrant file I have on this machine, I can run
With this data, you'd be able to show that the interface is "NAT"'d, and that there's an SSH port forward available on host port 2222. I'm guessing that Multipass has this detail stored internally somewhere (so you can access primary, for example).
It would be helpful if instead of showing "IPv4" as
I'd also like to endorse #309 for something similar.
Until this is resolved, I'm unable to use Multipass with Virtualbox for anything other than the most simplistic tasks, and must resort to using Vagrant.
Hi @JonTheNiceGuy, thanks for a detailed write-up.
There's a balance that we try to maintain between features and usability, thinking hard before we introduce a feature inside Multipass. Most of our hypervisors create a virtual network segment, so port forwarding is not that as much of a requirement as it is for VirtualBox, which is at least part of why it never got done. But we recognize the need for it, we just need to design a good user experience around it.
The SSH port / key is an internal implementation detail that we would like to not expose to users (we want to replace it altogether in the long run), so I'd rather not add it to
Would implementing port forwarding indeed solve your issue? If so, can you please say "Duplicate of #309" and close this issue?
I don't think this is exactly a Duplicate - there are separate and fun issues around the privilege model within Windows (like the psexec thing). So, there are some documentation changes I'd like to see off the back of this - noting the psexec part for getting access to VirtualBox would be a big start
I've now used psexec, and so when I run
Watching the Virtualbox application at the time this is run, it doesn't seem to start running the VM either. Even manually starting the VM, the "primary" machine seems to struggle to have it's shell opened with that timeout message. I think this is a separate issue, but no logs were showing as to why it was failing, so I don't know if I'd fat-fingered something, or if it was just one of "those things" about "primary".
I tried, instead, doing the same with a "launched" image (
I now get a VM with the second interface in a "down" state. I think, at this point, it's because I need to do something with a cloud-init to say "Yep, you can use the second interface", either that, or push something into
So, yes, while fundamentally this could be a duplicate of #309, if that's not going to be around for a while, it's worth documenting this work-around until 309 is available, and noting that it's a work around pending the completion of that.
I hope some of these notes above can help towards that documentation? If so, and you want me to create a PR based on those notes - point me to where I should do that, and I'll do what I can.
As an aside, and worth pushing as a comment to someone who's looking at it - I ended up using Multipass because the MicroK8S documentation recommends using Multipass, which I guess assumes that you're using Hyper-V, because if you're using the Virtualbox backend, you need these extra settings otherwise you're stuck with a K8S environment that isn't reachable from well, anything that isn't Multipass!