Jump to content

VirtualBox Control


Recommended Posts

Inspired by Parallels Controller and VMWare Fusion Controller I decided to make a similar workflow for VirtualBox.

You can find it here:

 

https://github.com/aiyodk/Alfred-Extensions/raw/master/AlfredApp_2.x/VirtualBox-Control/VirtualBox-Control.alfredworkflow

 

To use it you simply type "vm" and you get a list of all VirtualBox VM on your system. If the VM is not running you can start it and if it is not running you will get a list of options (Power Off, ACPI Shutdown, Reset, Pause, Save State).

 

VirtualBox-Control-Screenshot.png

 

Hope you will find it useful

 

Link to post

Very nice. I like the multi-layer actioning approach but it doesn't work well when some of the commands take options or keywords. Nevertheless, I really liked the OS-specific icons and stole them for the latest version of the VMWare Fusion controller. Thanks for the great work!

Link to post

Very nice. I like the multi-layer actioning approach but it doesn't work well when some of the commands take options or keywords. Nevertheless, I really liked the OS-specific icons and stole them for the latest version of the VMWare Fusion controller. Thanks for the great work!

 

I think it would be possible to add commands that takes options in a multilayer approach, but it do complicate the script vastly (e.g. you could print an item that is not valid when no option is given and valid when there is a option, you could maybe even sanitize the option)

 

I like the OS specific icons too, make it much easier to distinguish the VMs from each other. And you are welcome to you them in your own scripts :)

Link to post
  • 1 month later...

Hi, I have a Windows 7 VM but it never shows up at all. Any idea why?

 

 

bash-3.2$ sh test.sh
Name:            Windows 7
Guest OS:        Windows 7
UUID:            e52f2309-8f90-43e0-bbe6-9c74d215860c
State:           powered off (since 2013-02-26T15:27:50.000000000)
UUID:            e52f2309-8f90-43e0-bbe6-9c74d215860c
State:           powered off (since 2013-02-26T15:27:50.000000000)
bash-3.2$ sh virtualbox_control.sh
<?xml version="1.0"?>
<items>
</items>
Link to post

Hi, I have a Windows 7 VM but it never shows up at all. Any idea why?

 

 

bash-3.2$ sh test.sh
Name:            Windows 7
Guest OS:        Windows 7
UUID:            e52f2309-8f90-43e0-bbe6-9c74d215860c
State:           powered off (since 2013-02-26T15:27:50.000000000)
UUID:            e52f2309-8f90-43e0-bbe6-9c74d215860c
State:           powered off (since 2013-02-26T15:27:50.000000000)
bash-3.2$ sh virtualbox_control.sh
<?xml version="1.0"?>
<items>
</items>

 

Try to download the latest version here: https://github.com/a....alfredworkflow

 

Cheers,

Jonas

Link to post

Still no luck I'm afraid... test.sh output is different: 

 

 

bash-3.2$ sh test.sh
UUID:            e52f2309-8f90-43e0-bbe6-9c74d215860c
State:           powered off (since 2013-02-26T15:27:50.000000000)
bash-3.2$ sh virtualbox_control.sh
<?xml version="1.0"?>
<items>
</items>
 
Would you like me to try any other command to help debug?
Link to post

Still no luck I'm afraid... test.sh output is different: 

 

 

bash-3.2$ sh test.sh
UUID:            e52f2309-8f90-43e0-bbe6-9c74d215860c
State:           powered off (since 2013-02-26T15:27:50.000000000)
bash-3.2$ sh virtualbox_control.sh
<?xml version="1.0"?>
<items>
</items>
 
Would you like me to try any other command to help debug?

 

The workflow is updated (again) and should now work with VMs that is not in a group.

 

https://github.com/a....alfredworkflow

(All links in this thread points to the same version of the Workflow)

 

Cheers

Link to post
  • 2 months later...

Hi there,

 

This is a really great workflow and I use it every day, however I've recently started keeping all of my VM's on a remote machine on my local network; can you give me some help in being able to use this workflow to control the virtual machines that are not my local computer?

 

My programming skills are really not much, but even a nudge in the right direction of a solution would be a great help!

 

I'm going to see if I can wrap your code inside some AppleScript that will enable it to work on my server at home, no idea if this will work but it's got to be worth a try :-) again, definitely a great workflow.

Link to post

Very nice workflow; thank you!

 

Would it be possible to have a "settings" option?  I know this isn't strictly speaking CONTROLLING the virtual boxes, but it would still be useful.  Not sure how it would integrate well into the current setup, though, since it would need to be reachable whether the vbox were running or not.

Link to post
  • 2 years later...

I found the issue. In the /bin folder there is no VBoxManage file  so you need to have it there, 

for example you can create a link:

sudo ln -s /Applications/VirtualBox.app/Contents/MacOS/VBoxManage /Bin/VBoxManage

Works like charm. Thanks for the fix!

Link to post
  • 1 month later...
  • 2 weeks later...

The location of VBoxManage has moved in El Capitan to /usr/local/bin, which means you have to call it explicitly with the full path in this workflow's virtualbox_control.sh.

 

You can either edit the script yourself in the workflow folder, at line 58:

 

From:

VBoxManage list vms -l | sed -n -e '/^Name/N' -e '/\nGroups/P' -e '/\nGuest OS/p' -e '/^Guest OS/P' -e '/^UUID/P' -e '/^State/P' > 

To:

/usr/local/bin/VBoxManage list vms -l | sed -n -e '/^Name/N' -e '/\nGroups/P' -e '/\nGuest OS/p' -e '/^Guest OS/P' -e '/^UUID/P' -e '/^State/P' > 

and then update the path in the 'Run Script' part of the workflow to /usr/local/bin/VBoxManage too.

 

Alternatively, I updated the workflow which you can download from here.

Edited by beardscratcher
Link to post
  • 4 weeks later...

Hi,
 
I use this workflow every day and I love it, thanks for that.
 
But currently the workflow doesn't launch the VM. Checked this thread and updated my workflow but now alfred doesnt trigger on 'vm'. If I type 'v' it shows me the vm workflow entry but when hitting enter nothing happens.

Edit: I'm running OS X 10.11.1 and Alfred is on v2.8 (414). 

 

 

Do you have any help:)?

 

Edit:

 

Please forgive me. I just updated VirtualBox and restartet and everythings fine:) Thank you anyway:)

Edited by mkr
Link to post
  • 6 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...