Add Virtualbox Shortcut in Unity Launcher to boot to a VM
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?
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.
Save the shortcut to another place and don't delete it.
If you move it to /usr/share/applications it will be accessible to all users and it will appear on the Dash, but any other place will do.
Then you can drag the new shortcut to the Unity Bar even from the dash.