-
Notifications
You must be signed in to change notification settings - Fork 79
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
consoles: Allow configuring VNC #1973
base: main
Are you sure you want to change the base?
Conversation
There is more work to be done here, of course:
|
Can you add a screenshot of the current status please? Thanks! |
Yes! Thanks for having a look @garrett! A runing virtual machine looks and behaves exactly like before. The console card of a not running machine has details about VNC. Machine without VNC: Machine with default VNC: Machine with custom VNC: Dialog for editing the VNC config: Dialog for adding VNC: (None of the above is meant to be final, of course.) |
2842ed0
to
cd06f95
Compare
Thanks for adding the screenshots! I like what I'm seeing so far.
It looks like a great start though, and I think it can be banged into resembling the mockups for this. Thanks again for picking up the work on Machines! |
cd06f95
to
28c5c41
Compare
f5583f6
to
78c6280
Compare
I have changed the information display a bit. It deemphasizes the "VNC" term and the listening address. No VNC: VNC with auto port: VNC with custom port: In the selector, "VNC console" is changed to "Graphical console (VNC)". The idea is that Cockpit talks about support for a graphical console inside Cockpit. That happens to be implemented via VNC, but that's a detail. And the per-VM listening address is not that interesting. People will very likely leave it at its default, and are better off changing the global default in qemu.conf in any case. The port on the other hand is interesting. VMs might fail to start if they use the same port by accident, and it is a genuine per-VM config setting. |
78c6280
to
5faf9fd
Compare
So that people can edit them or add VNC if it is missing.
- The dialogs talk about "server" and "listening" to make that clearer. - There are now placeholder texts to explain the defaults - We use the empty string instead "-1" to signify automatic port assignment in the UI. - The port does validation of its value. - The password field takes the whole row and has can reveal its value.
0ceb441
to
59ed7bf
Compare
If the inactive XML config contains a port but not a address, we would try to connect too early, before the address was actually filled in.
59ed7bf
to
5a4dc36
Compare
function add_vnc() { | ||
Dialogs.show(<AddVNC | ||
idPrefix="add-vnc" | ||
vm={vm} />); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These 4 added lines are not executed by any test.
function edit_vnc() { | ||
Dialogs.show(<EditVNCModal | ||
idPrefix="edit-vnc" | ||
consoleDetail={vnc} | ||
vmName={vm.name} | ||
vmId={vm.id} | ||
connectionName={vm.connectionName} />); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These 7 added lines are not executed by any test.
if (!consoleDetail) { | ||
return ( | ||
<div className="pf-v5-c-console__vnc"> | ||
<EmptyState> | ||
<EmptyStateBody> | ||
{_("Graphical console not supported. Shut down the virtual machine to add support.")} | ||
</EmptyStateBody> | ||
</EmptyState> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These 9 added lines are not executed by any test.
constructor(props) { | ||
super(props); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These 2 added lines are not executed by any test.
this.state = { | ||
dialogError: undefined, | ||
vncAddress: "", | ||
vncPort: "", | ||
vncPassword: "", | ||
addVncInProgress: false, | ||
validationErrors: { }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These 7 added lines are not executed by any test.
if (connectionName === "system") | ||
options.superuser = "try"; | ||
|
||
return cockpit.spawn(args, options); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This added line is not executed by any test.
export function domainChangeVncSettings({ | ||
connectionName, | ||
vmName, | ||
vncAddress, | ||
vncPort, | ||
vncPassword, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These 6 added lines are not executed by any test.
const options = { err: "message" }; | ||
if (connectionName === "system") | ||
options.superuser = "try"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These 3 added lines are not executed by any test.
if (connectionName === "system") | ||
options.superuser = "try"; | ||
|
||
const args = ["virt-xml", "-c", `qemu:///${connectionName}`, vmName, "--edit", "--graphics", `vnc,listen=${vncAddress},port=${vncPort},passwd=${vncPassword}`]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This added line is not executed by any test.
|
||
const args = ["virt-xml", "-c", `qemu:///${connectionName}`, vmName, "--edit", "--graphics", `vnc,listen=${vncAddress},port=${vncPort},passwd=${vncPassword}`]; | ||
|
||
return cockpit.spawn(args, options); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This added line is not executed by any test.
Demo: https://youtu.be/cSMRsOmSEhE
Via the "Consoles" card, when the machine is off.
This is the minimum to get #1795 finished, IMO, and we should not try to do more. Anything on top happens in #1972 and elsewhere, at its own pace.