Skip to content
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

qemu_guest_agent: Add ssh-key injection support for windows #4129

Merged

Conversation

6-dehan
Copy link
Contributor

@6-dehan 6-dehan commented Aug 6, 2024

Add public ssh-key injection support for windows. Linux had been supported already.

ID: 2587
Signed-off-by: Dehan Meng [email protected]

@6-dehan 6-dehan marked this pull request as draft August 6, 2024 10:48
@6-dehan 6-dehan force-pushed the KVMAUTOMA-2587-support-ssh-windows branch from 0e0517d to 54c8983 Compare August 7, 2024 05:00
@6-dehan 6-dehan force-pushed the KVMAUTOMA-2587-support-ssh-windows branch 2 times, most recently from ca6b48f to 45d95be Compare August 22, 2024 02:45
@6-dehan 6-dehan marked this pull request as ready for review September 13, 2024 02:29
@6-dehan 6-dehan force-pushed the KVMAUTOMA-2587-support-ssh-windows branch from 45d95be to 227c663 Compare September 13, 2024 02:29
@6-dehan
Copy link
Contributor Author

6-dehan commented Sep 13, 2024

@leidwang could you please help review it when you're free? thanks
(01/10) Host_RHEL.m9.u5.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win10.x86_64.io-github-autotest-qemu.qemu_guest_agent.virtio_serial.gagent_ssh_public_key_injection.administrator.q35: STARTED
(01/10) Host_RHEL.m9.u5.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win10.x86_64.io-github-autotest-qemu.qemu_guest_agent.virtio_serial.gagent_ssh_public_key_injection.administrator.q35: PASS (155.20 s)
(02/10) Host_RHEL.m9.u5.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win10.x86_64.io-github-autotest-qemu.qemu_guest_agent.virtio_serial.gagent_ssh_public_key_injection.non_admin_user.q35: STARTED
(02/10) Host_RHEL.m9.u5.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win10.x86_64.io-github-autotest-qemu.qemu_guest_agent.virtio_serial.gagent_ssh_public_key_injection.non_admin_user.q35: PASS (163.27 s)
(03/10) Host_RHEL.m9.u5.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2016.x86_64.io-github-autotest-qemu.qemu_guest_agent.virtio_serial.gagent_ssh_public_key_injection.administrator.q35: STARTED
(03/10) Host_RHEL.m9.u5.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2016.x86_64.io-github-autotest-qemu.qemu_guest_agent.virtio_serial.gagent_ssh_public_key_injection.administrator.q35: PASS (99.09 s)
(04/10) Host_RHEL.m9.u5.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2016.x86_64.io-github-autotest-qemu.qemu_guest_agent.virtio_serial.gagent_ssh_public_key_injection.non_admin_user.q35: STARTED
(04/10) Host_RHEL.m9.u5.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2016.x86_64.io-github-autotest-qemu.qemu_guest_agent.virtio_serial.gagent_ssh_public_key_injection.non_admin_user.q35: PASS (177.58 s)
(05/10) Host_RHEL.m9.u5.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2019.x86_64.io-github-autotest-qemu.qemu_guest_agent.virtio_serial.gagent_ssh_public_key_injection.administrator.q35: STARTED
(05/10) Host_RHEL.m9.u5.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2019.x86_64.io-github-autotest-qemu.qemu_guest_agent.virtio_serial.gagent_ssh_public_key_injection.administrator.q35: PASS (123.14 s)
(06/10) Host_RHEL.m9.u5.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2019.x86_64.io-github-autotest-qemu.qemu_guest_agent.virtio_serial.gagent_ssh_public_key_injection.non_admin_user.q35: STARTED
(06/10) Host_RHEL.m9.u5.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2019.x86_64.io-github-autotest-qemu.qemu_guest_agent.virtio_serial.gagent_ssh_public_key_injection.non_admin_user.q35: PASS (134.06 s)
(07/10) Host_RHEL.m9.u5.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.qemu_guest_agent.virtio_serial.gagent_ssh_public_key_injection.administrator.q35: STARTED
(07/10) Host_RHEL.m9.u5.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.qemu_guest_agent.virtio_serial.gagent_ssh_public_key_injection.administrator.q35: PASS (134.39 s)
(08/10) Host_RHEL.m9.u5.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.qemu_guest_agent.virtio_serial.gagent_ssh_public_key_injection.non_admin_user.q35: STARTED
(08/10) Host_RHEL.m9.u5.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2022.x86_64.io-github-autotest-qemu.qemu_guest_agent.virtio_serial.gagent_ssh_public_key_injection.non_admin_user.q35: PASS (141.86 s)
(09/10) Host_RHEL.m9.u5.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2025.x86_64.io-github-autotest-qemu.qemu_guest_agent.virtio_serial.gagent_ssh_public_key_injection.administrator.q35: STARTED
(09/10) Host_RHEL.m9.u5.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2025.x86_64.io-github-autotest-qemu.qemu_guest_agent.virtio_serial.gagent_ssh_public_key_injection.administrator.q35: PASS (98.81 s)
(10/10) Host_RHEL.m9.u5.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2025.x86_64.io-github-autotest-qemu.qemu_guest_agent.virtio_serial.gagent_ssh_public_key_injection.non_admin_user.q35: STARTED
(10/10) Host_RHEL.m9.u5.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2025.x86_64.io-github-autotest-qemu.qemu_guest_agent.virtio_serial.gagent_ssh_public_key_injection.non_admin_user.q35: PASS (102.32 s)

@6-dehan 6-dehan force-pushed the KVMAUTOMA-2587-support-ssh-windows branch from 227c663 to 153464c Compare September 27, 2024 02:02
@6-dehan
Copy link
Contributor Author

6-dehan commented Sep 27, 2024

@fbq815 @MiriamDeng @BohdanMar I'm not sure if you guys test Windows for qga or not, if not, it won't require any test, just please be aware of this support (send ssh-key to Windows/Linux via qga could be a non-network-option.)

@fbq815
Copy link
Contributor

fbq815 commented Sep 27, 2024

no windows guest is tested on s390x

@MiriamDeng
Copy link
Contributor

Windows is not supported on ppc side, please ignore ppc.

Copy link
Contributor

@leidwang leidwang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@MiriamDeng
Copy link
Contributor

Windows is not supported on ppc side. Thanks.

@6-dehan
Copy link
Contributor Author

6-dehan commented Oct 16, 2024

Hi @vivianQizhu , Could you please help to review and merge this patch?

@6-dehan 6-dehan force-pushed the KVMAUTOMA-2587-support-ssh-windows branch 3 times, most recently from 4fe12b3 to 4fe4cdc Compare October 21, 2024 04:41
@6-dehan 6-dehan force-pushed the KVMAUTOMA-2587-support-ssh-windows branch 5 times, most recently from 9edad2c to f63405e Compare November 22, 2024 05:59
@6-dehan
Copy link
Contributor Author

6-dehan commented Nov 23, 2024

@leidwang please help review again.
(1/2) Host_RHEL.m9.u6.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2025.x86_64.io-github-autotest-qemu.qemu_guest_agent.virtio_serial.gagent_ssh_public_key_injection.administrator.q35: STARTED
(1/2) Host_RHEL.m9.u6.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2025.x86_64.io-github-autotest-qemu.qemu_guest_agent.virtio_serial.gagent_ssh_public_key_injection.administrator.q35: PASS (165.65 s)
(2/2) Host_RHEL.m9.u6.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2025.x86_64.io-github-autotest-qemu.qemu_guest_agent.virtio_serial.gagent_ssh_public_key_injection.non_admin_user.q35: STARTED
(2/2) Host_RHEL.m9.u6.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.Win2025.x86_64.io-github-autotest-qemu.qemu_guest_agent.virtio_serial.gagent_ssh_public_key_injection.non_admin_user.q35: PASS (226.04 s)

@6-dehan
Copy link
Contributor Author

6-dehan commented Nov 28, 2024

@vivianQizhu please help to review and merge this patch. thanks

guest_user = "fedora"
guest_user_passwd = "redhat"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should keep the param name and description here for user's reference, e.g.

# Set user password
# guest_user_passwd =

Copy link
Contributor

@vivianQizhu vivianQizhu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM otherwise.

Windows:
install_config_openssh = "powershell.exe Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process -Force; WIN_UTILS:\Install_config_OpenSSH.ps1"
# Please fill out guest_user_passwd before running test
first_ssh_VM = 'sshpass -p %s ssh ${guest_user}@%s -o StrictHostKeyChecking=no dir "${guest_homepath}"'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would recommend to name it cmd_sshpass.

@6-dehan 6-dehan force-pushed the KVMAUTOMA-2587-support-ssh-windows branch from f63405e to 3bd3292 Compare December 8, 2024 14:32
@6-dehan 6-dehan force-pushed the KVMAUTOMA-2587-support-ssh-windows branch from 3bd3292 to 02c86a3 Compare December 8, 2024 14:33
Add public ssh-key injection support for windows. Linux had been
supported already.
Add script Install_config_OpenSSH.ps1 to prepare OPenSSH.

Signed-off-by: Dehan Meng <[email protected]>
@6-dehan 6-dehan force-pushed the KVMAUTOMA-2587-support-ssh-windows branch from 02c86a3 to dabb8f2 Compare December 8, 2024 14:39
@vivianQizhu vivianQizhu merged commit d4cb7fe into autotest:master Dec 16, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants