{"id":44836,"date":"2023-12-05T14:55:11","date_gmt":"2023-12-05T14:55:11","guid":{"rendered":"https:\/\/ubuntuhandbook.org\/?p=44836"},"modified":"2024-04-30T12:39:40","modified_gmt":"2024-04-30T12:39:40","slug":"virtualbox-vm-separate-icon","status":"publish","type":"post","link":"https:\/\/ubuntuhandbook.org\/index.php\/2023\/12\/virtualbox-vm-separate-icon\/","title":{"rendered":"Make VirtualBox VMs to Have Separate Icons in Ubuntu 22.04"},"content":{"rendered":"<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/08\/virtualbox-logo.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-thumbnail wp-image-44276\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/08\/virtualbox-logo-250x250.webp\" alt=\"\" width=\"250\" height=\"250\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/08\/virtualbox-logo-250x250.webp 250w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/08\/virtualbox-logo-300x300.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/08\/virtualbox-logo-600x600.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/08\/virtualbox-logo-768x768.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/08\/virtualbox-logo.webp 1200w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/><\/a><\/p>\n<p>I&#8217;m using Virtualbox to try out different Linux Distributions in virtual machines. It always has 2 logo icons on Ubuntu dock: one for the manager, and another for VMs.<\/p>\n<p>The VM and VM manager icons on the dock are totally same, causing me to make mis-clicks frequently. And, all the opened VMs are grouped into single icon on the dock.<\/p>\n<p>If you don&#8217;t like this default behavior, then it&#8217;s easy to make Virtual Virtual Machines to have separate icon per instance.<\/p>\n<p>As the screenshot below shows you, after following this tutorial, every VM will have its own system logo on Ubuntu Dock:<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vbox-vm-icons.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-44837\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vbox-vm-icons-600x402.webp\" alt=\"\" width=\"600\" height=\"402\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vbox-vm-icons-600x402.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vbox-vm-icons-300x201.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vbox-vm-icons-768x515.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vbox-vm-icons.webp 1182w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p><b>UPDATE: This tutorial ONLY works for Virtualbox installed from <a href=\"https:\/\/www.virtualbox.org\/wiki\/Linux_Downloads\" target=\"_blank\" rel=\"noopener\">virtualbox.org\/wiki\/Linux_Downloads<\/a>.<\/b><\/p>\n<h3>Method 1: Disable virtualboxvm.desktop<\/h3>\n<p>The VM icons for Linux are handled by <code>virtualboxvm.desktop<\/code> file under &#8220;\/usr\/share\/applications&#8221; directory. Simply disable that file will make Virtualbox VM (<b>7.0.12 in my test<\/b>) fall back to separate icon with system\/distro logo.<\/p>\n<p><b>To do so, just create an empty file with same filename under &#8220;.local\/share\/applications&#8221;.<\/b> It will be taken in use instead of the one in &#8216;\/usr\/share\/applications&#8217; for current user only.<\/p>\n<p><b>Option 1: Single command to create empty virtualboxvm.desktop<\/b><\/p>\n<p>Ubuntu user can press <b>Ctrl+Alt+T<\/b> on keyboard to open terminal, then run the single command below to create the empty file:<\/p>\n<pre>touch ~\/.local\/share\/applications\/virtualboxvm.desktop<\/pre>\n<p><i>This command should work in most Linux, though running command <code>mkdir -p ~\/.local\/share\/applications<\/code> may be required first to create the directory.<\/i><br \/>\n<a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/touch-vboxvm-desktop.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-44838\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/touch-vboxvm-desktop-600x362.webp\" alt=\"\" width=\"600\" height=\"362\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/touch-vboxvm-desktop-600x362.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/touch-vboxvm-desktop-300x181.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/touch-vboxvm-desktop-768x463.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/touch-vboxvm-desktop.webp 795w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><br \/>\n<b>Option 2: Use text editor to create empty virtualboxvm.desktop<\/b><\/p>\n<p>For those who hate Linux commands, simply search for and launch a text editor window.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/04\/open-texteditor.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-43854\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/04\/open-texteditor.webp\" alt=\"\" width=\"480\" height=\"270\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/04\/open-texteditor.webp 480w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/04\/open-texteditor-300x169.webp 300w\" sizes=\"auto, (max-width: 480px) 100vw, 480px\" \/><\/a><\/p>\n<p>Then, it should by default open an empty file (if not create one). There open menu and select &#8220;Save as&#8221;.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/empty-saveas.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-44839\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/empty-saveas-600x354.webp\" alt=\"\" width=\"600\" height=\"354\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/empty-saveas-600x354.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/empty-saveas-300x177.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/empty-saveas-768x453.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/empty-saveas.webp 969w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>In next dialog, name the empty file to <b>virtualboxvm.desktop<\/b> and save it into &#8220;Home &gt; .local &gt; share &gt; applications&#8221;.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/save-vboxvm-desktop.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-44840\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/save-vboxvm-desktop-600x327.webp\" alt=\"\" width=\"600\" height=\"327\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/save-vboxvm-desktop-600x327.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/save-vboxvm-desktop-300x163.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/save-vboxvm-desktop-768x418.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/save-vboxvm-desktop.webp 961w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>The change will be applied next time you launch a VirtualBox VirtualBox.<\/p>\n<h3>Method 2: Edit virtualboxvm.desktop<\/h3>\n<p>In case the first method does not work for you, you can configure the file to make it start VM as separate process.<\/p>\n<p>1. First, open 2 &#8220;Files&#8221; windows. Then drag&#8217;n&#8217;drop <b>virtualboxvm.desktop<\/b> to local folder.<\/p>\n<ul>\n<li>In &#8220;Files&#8221; (aka nautilus), navigate to Other Locations -&gt; Computer -&gt; usr -&gt; share -&gt; applications, then, find out the <b>virtualboxvm.desktop<\/b> file.<\/li>\n<li>In another &#8220;Files&#8221; window, press Ctrl+H, then navigate to .local -&gt; share -&gt; applications. Finally, drag&#8217;n&#8217;drop the file to this folder.<\/li>\n<\/ul>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/move-vbox-vm-desktop.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-44842\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/move-vbox-vm-desktop-600x380.webp\" alt=\"\" width=\"600\" height=\"380\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/move-vbox-vm-desktop-600x380.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/move-vbox-vm-desktop-300x190.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/move-vbox-vm-desktop-768x486.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/move-vbox-vm-desktop-1320x836.webp 1320w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/move-vbox-vm-desktop.webp 1350w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>2. Right-click on the <b>virtualboxvm.desktop<\/b> file in .local\/share\/applications folder and click &#8220;Open with Text Editor&#8221;.<\/p>\n<p>When the file opens, add <code>--separate<\/code> flag to &#8216;Exec&#8217; line. So it will be &#8216;<code>Exec=VirtualBoxVM --separate %U<\/code>&#8216;.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vboxvm-separate.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-44843\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vboxvm-separate-600x472.webp\" alt=\"\" width=\"600\" height=\"472\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vboxvm-separate-600x472.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vboxvm-separate-300x236.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vboxvm-separate-768x604.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2023\/12\/vboxvm-separate.webp 825w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>For choice, you can change the icon to <code>Icon=virtualbox-vbox<\/code>, or replace with \/path\/to\/whatever-icon that your want. However, all VMs will use the same icon on Ubuntu Dock.<\/p>\n<h3>How to Restore<\/h3>\n<p>To restore the change, simply delete the empty file either in your file manager or by running command in terminal:<\/p>\n<pre>rm ~\/.local\/share\/applications\/virtualboxvm.desktop<\/pre>\n<p>That&#8217;s it. Enjoy!<\/p>","protected":false},"excerpt":{"rendered":"<p>I&#8217;m using Virtualbox to try out different Linux Distributions in virtual machines. It always has 2 logo icons on Ubuntu dock: one for the manager, and another for VMs. The VM and VM manager icons on the dock are totally same, causing me to make mis-clicks frequently. And, all the opened VMs are grouped into [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":44276,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[38],"class_list":["post-44836","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","tag-virtualbox"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/44836","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/comments?post=44836"}],"version-history":[{"count":0,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/44836\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media\/44276"}],"wp:attachment":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media?parent=44836"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/categories?post=44836"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/tags?post=44836"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}