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

it this extention work for virtual box on windows>? #4

Open
liuyanbiao opened this issue Nov 17, 2015 · 2 comments
Open

it this extention work for virtual box on windows>? #4

liuyanbiao opened this issue Nov 17, 2015 · 2 comments

Comments

@liuyanbiao
Copy link

I am running virtualbox on windows desktop.

would this extension work?

@Shuliyey
Copy link

yeah same question I had in mind.

Also the Virtual Host Credentials, does it use ssh to authenticate for powering on and off the machine, if that's the case, I believe this extension won't work on windows, unless you set up an openssh-server on windows

@Shuliyey
Copy link

yeah I think you can get to work on windows, after you install openssh-server on windows

The power_on file

/usr/bin/maas login maas http://localhost/MAAS `cat ~/VBox_extensions/maas-api-key`

# Retrieve the id from the MAAS Power address
vm_to_start=${1//:}

# Loop through all the zones to send the request to all the VBox host machines
for zone_description in `maas maas zones read | grep '"description": "' | cut -d: -f 2`
do
    # Remove the "s
    vbox_host_credentials=${zone_description//\"}

    # Check if there is the @ sign, typical of ssh user@address
    if [[ ${vbox_host_credentials} == *"@"* ]]
    then
        # Create the command string
        command_to_execute="ssh ${vbox_host_credentials} '~/VBox_host_extensions/startvm ${vm_to_start//-}'"
        # Execute the command string
        eval "${command_to_execute}"

        # Log the command
        echo -e "VirtualBox-Power ON:" `date` "\n" \
                "Credentials: ${vbox_host_credentials}\n" \
                "ID: ${vm_to_start}\n" >> /tmp/VBox.log
    fi
done

As you can see, it is actually using ssh to push the remote execution command.

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

No branches or pull requests

2 participants