Ubuntu – Add Virtualbox Shortcut in Unity Launcher to boot to a VM

shortcutsunityvirtualbox

Can I create a shortcut to a virtualbox OS in the unity sidebar without it being on the desktop too.
I tried to right click in virtualbox and create shortcut on desktop then move it. but if i do it then delete the desktop shortcut it renders the unity shortcut useless.

Any ideas?

Best Answer

To add a launcher item that runs a single specific virtual machine we can create a new launcher item as it is described here.

In short, to start a Virtual Box machine without the Virtual Box Manager we may add the following command to start the VM in the Exec= section of a .desktop file we can place in ~/.local/share/applications:

[Desktop Entry]
Name=the name you want it to have
Comment=
Exec=VirtualBox --startvm 'name of the machine'
Icon=icon name
Terminal=false
Type=Application
StartupNotify=true

After giving the .desktop file executable permission we can now start our virtual machine by double-click on it, or we can drag it on the Launcher or the Desktop for convenient access.

In more recent versions of VirtualBox the functionality to start a virtualmachine was moved to the VirtualBoxVM application. This needs a change of the EXEC line in the .desktop file tO

EXEC=/usr/lib/virtualbox/VirtualBoxVM --startvm "name of the machine"

or we may use the tool VBoxManage startvm instead.

Related Question