Add VirtualBox Guest OS Shortcut to Dock & Menu

Icon/Shortcut directly to VirtualBox Guest OS in Dock, Menu and/or Desktop

Add shortcuts directly to your guest VM's instead of opening VirtualBox to access them. This will also add your individual guest os/Vm's as menu items.

There may be an alternate way to do this, but this was the only way I could get it to work in Zorin.

Here's how:

#1. Create a folder somewhere in your home directory. (I created a new folder called 'scripts' in my Documents folder.)

#2. Go online and find a nice .png file for your VM's icon file and save it to that new folder.

#3 Get the exact name of your guest VM. (What you named it when you installed it.) In this example, I'm making a shortcut for my Windows 11 VM. (Note: whatever VirtualBox shows in bold is the name. If your VM is running from a snapshot just ignore that tag. Your VM will still work. Stick with only the VM name in bold.

#4. Go inside your new 'scripts' folder and right click. Select 'Open in terminal' and enter sudo nano to open an editor.

#5. Copy and Paste

#!/bin/bash
VBoxManage startvm "Win11" $1 

IMPORTANT: replace the word Win11 with the exact name of your guest VM. Capitalization matters here.

Save your file as a .sh (I named mine win11-vm.sh )
To do this in nano hit ctrl+o to name it, then ctrl+x to exit the editor.

Now, in the same terminal, we need to give that new file permission to run. Enter:

sudo chmod +x filename.sh

Eg: sudo chmod +x win11-vm.sh

#6. While still in terminal enter sudo nano to bring up the editor again. Copy and paste:

[Desktop Entry] Version=1.0
Type=Application
Name=Win11
Comment=Start Win11 VM
Exec=/home/YourUserName/Documents/scripts/win11-vm.sh
Icon=/home/YourUserName/Documents/scripts/win11.png
Terminal=false

On the Name line replace Win11 with your VM name. Replace the Exec and Icon lines with the path of your new folder and replace the .png and sh file names too.

Hit ctrl+o to save this file as a .desktop file, only we are going to save it to this new location: /usr/share/applications/
Eg: I saved my file as: /usr/share/applications/win11.desktop

#7. Now all we need to do is add it to your desktop or to the dock. Just search for it in the applications menu (the Zorin icon) and right click. Either add it to favorites (to add to your dock) or add to your desktop.

Sometimes you need to log out before the new entry will show up.

There you have it, folks. VM shortcuts on your menu, dock and desktop.
Namaste!

2 Likes