podman-desktop icon indicating copy to clipboard operation
podman-desktop copied to clipboard

Provide ability to easily get a shell in a machine

Open slemeur opened this issue 3 years ago • 8 comments

Is your enhancement related to a problem? Please describe

It happens sometimes that I need to check the status of my podman-machine and instruct some commands into it.

Describe the solution you'd like

I'd like the ability to get a shell into the podman-machine so I can more easily interact with it and eventually configure/fix it.

Describe alternatives you've considered

No response

Additional context

No response

slemeur avatar Nov 23 '22 08:11 slemeur

This uses the older app nav but there is a mockup to show how this could work (not unlike how we do for containers): Details Podman (1)

mairin avatar May 31 '23 16:05 mairin

@mairin I am not sure how we connect to the VM from this mockup ? Is it the console tab ?

benoitf avatar May 31 '23 17:05 benoitf

@benoitf yep, that's right! And you would get to this screen by clicking on the machine name or on this button (I think @lstocchi has a WIP PR with this function in it to at least see the cpu/mem/etc details): Screenshot from 2023-05-31 13-10-38

mairin avatar May 31 '23 17:05 mairin

(But maybe that's too may steps, we could add a terminal icon to the action bar in the machine's card as an alternative and it could take you straight to the console tab?)

mairin avatar May 31 '23 17:05 mairin

Action could be in the kebab menu as well if it's a 'more advanced feature'

benoitf avatar May 31 '23 17:05 benoitf

For the Lima driver this is done by lima, after setting $LIMA_INSTANCE:

LIMA_INSTANCE=podman lima

That is, get the name of the lima instance from the preferences and set it.

  const engineType = configuration.getConfiguration('lima').get('type') || 'podman';
  const instanceName = configuration.getConfiguration('lima').get('name') || engineType;

afbjorklund avatar Jun 05 '23 15:06 afbjorklund

With WSL can be implemented by this way:

const { exec } = require('node:child_process')
exec('wt wsl -d podman-machine-default --cd ~')  // podman-machine-default is the default name of the WSL distro

rtritto avatar Jan 03 '24 16:01 rtritto

This issue has been automatically marked as stale because it has not had activity in the last 6 months. It will be closed in 30 days if no further activity occurs. Please feel free to leave a comment if you believe the issue is still relevant. Thank you for your contributions!

github-actions[bot] avatar Jul 02 '24 00:07 github-actions[bot]

Here can be found current progress: https://github.com/gastoner/podman-desktop/commit/1edae4fb5204fe68d8590df8f0722cbb3ea52016 I won't open a draft PR since it would add unnecessary stress to CI workers.

There are still some errors that I'm trying to solve e.g. shellInProvider in provider-registry.ts

gastoner avatar Sep 26 '24 08:09 gastoner