Jump to content
aiyo

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

 

Share this post


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!

Share this post


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 :)

Share this post


Link to post

Hi! same situation than pstadler here. Anything I can do to help you debug it?

 

Thanks for helping out!

 

I have updated the workflow fixing this bug.

Share this post


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>

Share this post


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

Share this post


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?

Share this post


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

Share this post


Link to post

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.

Share this post


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.

Share this post


Link to post

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

Share this post


Link to post

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!

Share this post


Link to post

This worked for me.  Thanks @malinich

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

Share this post


Link to post

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

Share this post


Link to post

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

Share this post


Link to post

This seems to have broken in the latest build of Alfred 3 :(

 

Any chance that it will get fixed?

 

Edit: This one was one of the cases where the .sh file had to have Alfred-2 replaced with Alfred-3. Works fine now.

Edited by TheJesusFish

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...