• Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
  • Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

Turn on/off VM on VirtualBox using APIs

Scheduled Pinned Locked Moved
General Problems
2
4
676
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.
  • D
    davide1611
    last edited by Apr 22, 2020, 2:12 PM

    Hi everyone!

    I have installed on windows10, VirtualBox 6.0.14 where there are VMs:

    • Ubuntu 18:04 with FOG server and DHCP server --> server
    • Ubuntu 18:04 --> client

    I installed on the client the OS through NFS and everything works.

    My goal is to turn on/off the client through APIs using WOL.

    First, a question that’s not properly of this forum but maybe someone has already encountered this difficulty: Is it possible to do that? I mean, can I turn on/off VM on VBox from FOG server? Reading the forum the function is not enabled by Virtualbox but maybe there is a way to circumvent it.

    • If it’s not possible: should someone advise me a solution to test the turn on/off machine? LXC? I could move on from VBox because I need just to test this solution and in the future move to physical machines. Nevertheless, I prefer to use VBox if it’s possible.

    • If it’s possible: I think to create an “empty” snapin using WOL:true (to turn on) or shutdown:true (to turn off). Does it make sense?

    I posted a similar question but it had some gaps so I preferred to post it more detailed.

    Thanks to the community!

    1 Reply Last reply Reply Quote 0
    • G
      george1421 Moderator
      last edited by Apr 22, 2020, 3:34 PM

      First let me say this isn’t a FOG issue, but a hypervisor issue. It is out of scope of the FOG project to support this.

      With that said, you need to look at your hypervisor to see if there is a way to start up a virtual machine. For a virtual machine WOL is not an option in almost all cases. What you would need is a way to instruct the hypervisor to start a VM (regardless if FOG has anything to do with the VM or not to start with). What would be helpful is if the VM has a powershell option to start a VM. I know for ESXi there is a VMWare toolbox that can be used to remote start a VM. In this case we are not talking about vmware but virtualbox.

      Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

      1 Reply Last reply Reply Quote 0
      • G
        george1421 Moderator
        last edited by Apr 22, 2020, 3:38 PM

        A quick google-fu check found this link: https://www.techrepublic.com/article/how-to-run-virtualbox-virtual-machines-from-the-command-line/

        From that article you will find
        VBoxManage startvm "Ubuntu Server" --type headless to start the VM and

        VBoxManage controlvm "Ubuntu Server" poweroff --type headless to power off the VM.

        So all you need to do is have a process to run those commands on the hypervisor host computer when you want them to execute.

        Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

        D 1 Reply Last reply Apr 24, 2020, 6:50 AM Reply Quote 1
        • D
          davide1611 @george1421
          last edited by Apr 24, 2020, 6:50 AM

          @george1421 ok, could be a way to solve the problem! Thank you!

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          1 / 1
          • First post
            3/4
            Last post

          150

          Online

          12.0k

          Users

          17.3k

          Topics

          155.2k

          Posts
          Copyright © 2012-2024 FOG Project