incus icon indicating copy to clipboard operation
incus copied to clipboard

Incus action support --console vga

Open nanjj opened this issue 1 year ago • 6 comments
trafficstars

Supports below usage:

  1. incus start instance --console,
  2. incus start instance --console=vga,
  3. incus start instance --console vga # my favor one

nanjj avatar Jul 19 '24 13:07 nanjj

That doesn't work.

incus create images:ubuntu/24.04 vga --vm
incus start --console vga

The above needs to give me the text console for the instance named vga.

stgraber avatar Jul 19 '24 15:07 stgraber

That doesn't work.

incus create images:ubuntu/24.04 vga --vm
incus start --console vga

=>

To detach from the console, press: <ctrl>+a q
...

So it works. And incus stop --console vga =>

To detach from the console, press: <ctrl>+a q
[  OK  ] Stopped target Swap.
[  OK  ] Unmounted /boot/efi.

also works.

The above needs to give me the text console for the instance named vga.

The fix only handle len(names) > 1 situation so the above works as you expect.

nanjj avatar Jul 20 '24 01:07 nanjj

What happens if you do incus start --console console vga ?

I would expect that to start a text console on instance named vga, but from my reading of the code, this will instead give me a vga console on instance console.

stgraber avatar Jul 20 '24 03:07 stgraber

What happens if you do incus start --console console vga ?

I would expect that to start a text console on instance named vga, but from my reading of the code, this will instead give me a vga console on instance console.

Fixed.

nanjj avatar Jul 20 '24 04:07 nanjj

I think this will fail if I do incus start vga --console console as it will incorrectly try to use the VGA console for it now.

stgraber avatar Jul 23 '24 06:07 stgraber

Supports below usage:

1. incus start instance --console,

2. incus start instance --console=vga,

3. incus start instance --console vga # my favor one

You are suggesting that --console should be able to used either on its own (without parameter, assuming the default to be vga),

or as --console vga, which means that the next string after --console will be the name of reserved parameter vga.

Such a feature would add ambiguity to the users. In the first example, --console does not consume the next token and then it does. In the second example, there's ambiguity. Is vga a parameter to --console or is it the name of the instance?

incus start --console mycontainer
incus start --console vga mycontainer

and

incus init images:debian/12 vga
incus start --console vga

simos avatar Aug 02 '24 13:08 simos