multipass icon indicating copy to clipboard operation
multipass copied to clipboard

Add integration with SSH

Open zeminzhou opened this issue 4 years ago • 4 comments

What are you trying to do? A description of what you want to happen. I want to use VScode SSH to VM, but seemingly I can only use “multipass shell vm-name" to interact with an instance

zeminzhou avatar Feb 06 '21 14:02 zeminzhou

Hi @zeminzhou, you can use --cloud-init <file> to populate the authorized keys, like so:

ssh_authorized_keys:
    - <your key>

Then, if using Hyper-V, you can use <instance-name>.mshome.net as the host you're trying to connect to. If using VirtualBox, you'll need to forward the SSH port from the instance, or use the new --network feature to have direct networking between your host and the instance.

We plan to improve this by populating your ssh config with instances so they're always in sync.

Saviq avatar Feb 06 '21 14:02 Saviq

Think your answer

zeminzhou avatar Feb 06 '21 14:02 zeminzhou

We plan to improve this by populating your ssh config with instances so they're always in sync.

I think this would be very useful.

gparmeggiani avatar Apr 06 '21 19:04 gparmeggiani

The only thing left is to manually copy or link private key from internal multipass store as explained here: https://github.com/canonical/multipass/issues/913

nikelborm avatar Mar 20 '24 13:03 nikelborm