XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Run a script inside guest OS from host

    Scheduled Pinned Locked Moved XCP-ng
    22 Posts 5 Posters 5.4k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • olivierlambertO Offline
      olivierlambert Vates 🪐 Co-Founder CEO
      last edited by

      Hi,

      I'm not sure about your real use case/functional requirement, but my first answer will be to check Cloudinit first 🙂 (XO is compatible with it)

      V 1 Reply Last reply Reply Quote 0
      • V Offline
        Virtual @olivierlambert
        last edited by

        @olivierlambert I mostly deal with Windows VMs and my automation is mostly based on PowerShell. There are some PowerShell commands that only work when run locally in the VM. I am looking for a way to initiate those commands at the host level. VMWare has that capability via the Invoke-VMScript cmdlet, so I was wondering if xcp-ng has a similar capability

        I looked a little bit into cloudinit and and that seemed to be mostly around Linux guests

        1 Reply Last reply Reply Quote 0
        • olivierlambertO Offline
          olivierlambert Vates 🪐 Co-Founder CEO
          last edited by

          I think there's a support in Windows for cloud init (I remember users doing that in this forum).

          Do you need automation at VM creation or later in the life of the VM?

          V 1 Reply Last reply Reply Quote 0
          • V Offline
            Virtual @olivierlambert
            last edited by

            @olivierlambert Later in the life of the VM

            1 Reply Last reply Reply Quote 0
            • olivierlambertO Offline
              olivierlambert Vates 🪐 Co-Founder CEO
              last edited by

              Okay so it's something else, I don't think XenStore is meant for that, you would probably need something more complex for security reasons (like Qrexec which is not available in XCP-ng but in QubesOS)

              There's no mechanism in the Windows world to do things like you can do in Linux? (like relying on SSH to access the machine and do whatever you want remotely?)

              ajpri1998A 1 Reply Last reply Reply Quote 0
              • ajpri1998A Offline
                ajpri1998 @olivierlambert
                last edited by

                @olivierlambert said in Run a script inside guest OS from host:

                There's no mechanism in the Windows world to do things like you can do in Linux?

                You can enable an ssh server in Windows Desktop and Server. It works just like Linux.
                https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse?tabs=gui

                DanpD 1 Reply Last reply Reply Quote 1
                • DanpD Offline
                  Danp Pro Support Team @ajpri1998
                  last edited by

                  @ajpri1998 What about using something like psexec or
                  the powershell command Invoke-Command?

                  D 1 Reply Last reply Reply Quote 1
                  • D Offline
                    DustinB @Danp
                    last edited by

                    @Danp said in Run a script inside guest OS from host:

                    @ajpri1998 What about using something like psexec or
                    the powershell command Invoke-Command?

                    Exactly what I was going to recommend, but the request is to be sent from XCP-ng (the hypervisor) rather than some management server..

                    What would the Windows PowerShell command be doing within the VM, that resides on XCP-ng?

                    and

                    Why does the hypervisor need to issue the command to the VM?

                    V 1 Reply Last reply Reply Quote 1
                    • V Offline
                      Virtual @DustinB
                      last edited by

                      @DustinB I need to run Install-ADServiceAccount to install service accounts in VMs. This cmdlet unfortunately cannot be run remotely from a management server, or at least I haven't found a way to do so reliably

                      D 1 Reply Last reply Reply Quote 0
                      • D Offline
                        DustinB @Virtual
                        last edited by

                        @Virtual said in Run a script inside guest OS from host:

                        @DustinB I need to run Install-ADServiceAccount to install service accounts in VMs. This cmdlet unfortunately cannot be run remotely from a management server, or at least I haven't found a way to do so reliably

                        But XCP-ng won't be able to do this either, it sounds like you need an RMM to assist with some of your workloads and are looking at the wrong portion of your technology stack.

                        V 1 Reply Last reply Reply Quote 0
                        • D Offline
                          DustinB
                          last edited by

                          XCP-ng nor Xen Orchestra can run things within the confines of a VM, they act on the Virtual Hardware that are a portion of the VM.

                          Everything that happens after the OS loaded (and within the Console for simplicity) are a function of the Operating System and the tools you have installed within it.

                          1 Reply Last reply Reply Quote 0
                          • V Offline
                            Virtual @DustinB
                            last edited by

                            @DustinB Yeah but VMWare has a functionality that can initiate a command which runs locally in the guest OS

                            So I was wondering if xcp-ng has a similar functionality

                            1 Reply Last reply Reply Quote 0
                            • olivierlambertO Offline
                              olivierlambert Vates 🪐 Co-Founder CEO
                              last edited by

                              And the short answer is not at the moment 🙂

                              V 1 Reply Last reply Reply Quote 0
                              • V Offline
                                Virtual @olivierlambert
                                last edited by

                                @olivierlambert Is something like this planned in the future?

                                1 Reply Last reply Reply Quote 0
                                • olivierlambertO Offline
                                  olivierlambert Vates 🪐 Co-Founder CEO
                                  last edited by

                                  It's possible that we re-use the system from QubesOS. But it's mostly the demand that will drive the effort. Since there's already something well designed, it's all about integration and use cases. So I'm not against it at all, I hope we'll grow enough to be able to tackle all the topics we have in the backlog 😆

                                  V 1 Reply Last reply Reply Quote 0
                                  • V Offline
                                    Virtual @olivierlambert
                                    last edited by

                                    @olivierlambert Not sure what Vates' marketing budget is like, but have you considered doing sponsored spots with big tech YouTubers like Linus Tech Tips? That will surely help get more traction for the great product that is xcp-ng.

                                    1 Reply Last reply Reply Quote 0
                                    • olivierlambertO Offline
                                      olivierlambert Vates 🪐 Co-Founder CEO
                                      last edited by

                                      In fact, LTT (via Floatplane) is already an XCP-ng/XO customer 😆

                                      But yeah, it's also a question of the target audience and such. Be certain that we do our max to get that growth, I'd be happy to do that feature as soon as I can 🙂

                                      V ajpri1998A 2 Replies Last reply Reply Quote 0
                                      • V Offline
                                        Virtual @olivierlambert
                                        last edited by

                                        @olivierlambert Much appreciated

                                        1 Reply Last reply Reply Quote 0
                                        • ajpri1998A Offline
                                          ajpri1998 @olivierlambert
                                          last edited by

                                          @olivierlambert

                                          That's quite amazing. I hear them talk about in-office about using Proxmox for VMs, but NEVER about XCP-ng/XO.

                                          1 Reply Last reply Reply Quote 0
                                          • olivierlambertO Offline
                                            olivierlambert Vates 🪐 Co-Founder CEO
                                            last edited by

                                            Because we are less known, Proxmox was out in 2008, XCP-ng as a fork was created 10 years later.

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post