Page 1 of 2

Custom icons for virtual machines

Posted: 20. Jun 2017, 09:39
by MHoefler
Hi!

I really like Virtualbox and it seems to be working better than VMware! One thing that would even make it much better is if I could select a custom icon for each virtual machine! This way, I could easily distinguish between them in the VM Manager and even more important, in the tray area! I use "DeskSoft WindowManager" to minimize the VMs to the tray and if they all have the same icon, it's hard to find a specific one.

Actually, selecting a custom icon should be very easy to implement and I can hardly believe it's not possible yet, becasue there is enough room in the settings page to make a selection possible - just clicking the icon would be enough to open a file dialog to search for the custom icon, etc.

So please, add this feature, because I know many people would love that!

Thanks,
Martin

Re: Custom icons for virtual machines

Posted: 20. Jun 2017, 09:59
by mpack
Are you assuming Windows hosts? I suspect so.

On Windows hosts you can create a shortcut to your VM on the desktop, and possibly in that desktop manager you mentioned. In Windows you can then right click the shortcut, view properties and change the icon.

Re: Custom icons for virtual machines

Posted: 20. Jun 2017, 10:38
by MHoefler
Yes, Windoes host - sorry I forgot to mention that.

I know about assigning icons to shortcuts in Windows, but that's not what I meant. The "original" VM icon is still used in the task manager, task list, tray icon, task bar, VirtualBox Manager, etc.

It would be nice to be able to assign a system-wide custom icon for each machine, that will be used everywhere.

I have dedicated virtual machines for different tasks (work, email, downloads, surfing, etc. - all WIndows 10 guests) and it would make life so much easier if I could assign my custom icons to each one, so that I can distinguish between them easily.

Thanks!

Re: Custom icons for virtual machines

Posted: 20. Jun 2017, 11:18
by socratis
Do you realize where the icon comes from? The executable (except in VirtualBox Manager). So, could you please explain to me how exactly you would modify the executable with your custom icon? Just the logic, not the actual implementation. And remember that it has to work with simple users (not administrators) as well.

Re: Custom icons for virtual machines

Posted: 20. Jun 2017, 11:45
by MHoefler
That's easy: VirtualBox creates Windows (each VM is a separate window) and you can easily assign each window any icon with the Windows API. Very easy for programmers...

Re: Custom icons for virtual machines

Posted: 20. Jun 2017, 11:50
by socratis
Not the way that VirtualBox is written. It's not using an MDI model. It's a different process with each VM being a different input parameter. Take a look at the command line.

But if you think that it would be easy for programmers to changes that (you seem to be one), I'm sure the developers might be interested. They are always open to ideas...

BTW, I'm not sure if in the Task Manager the different icons would show, or in the Taskbar.

Re: Custom icons for virtual machines

Posted: 20. Jun 2017, 13:37
by Perryg
I think you already can on a per machine basis.

Code: Select all

VBoxManage modifyvm  <uuid|vmname> [--iconfile <filename>]
It makes the *.vbox file really ugly but it works. Be sure to backup the original *.vbox file first.

Re: Custom icons for virtual machines

Posted: 20. Jun 2017, 13:53
by socratis
We tried the "--iconfile" in 01/2017 in multiple platforms with disappointing results. No one could make it work. And there's an open ticket, #16489, but that doesn't mean much...

Re: Custom icons for virtual machines

Posted: 20. Jun 2017, 14:16
by Perryg
It works for me. That's how I knew it makes the *.vbox file really ugly. It puts the icon code in the top of the file. IIRC this needs to be done while the main manager and probably the VBoxSVC is stopped, or at least the manage and svc needs to be reset to show the actual change.
custom icon.png
custom icon.png (9.12 KiB) Viewed 27374 times

Re: Custom icons for virtual machines

Posted: 20. Jun 2017, 14:21
by socratis
So what was the format of the icon file? Raw data? ICO? PNG? I should try it...

Re: Custom icons for virtual machines

Posted: 20. Jun 2017, 14:30
by Perryg
Not sure, but I know png works as that is what the file is I used.

Re: Custom icons for virtual machines

Posted: 21. Jun 2017, 06:58
by MHoefler
Interesting hint with VBoxManage - thanks Perryg, I'll try that.

However, since it obviously is possible to change the icon that complicated and user unfriendly way, it should be easy to let the user simply choose a custom icon in the settings of the VM by clicking on the icon, etc.

I hope, this will be implemented.

Thanks!

Re: Custom icons for virtual machines

Posted: 21. Jun 2017, 13:02
by Perryg
I am sure it is possible but doubtful. The cost benefit is just not there. Only a handful of people have asked and they took the time to put together a way to do this for the few but a global approach is costly.

Re: Custom icons for virtual machines

Posted: 14. Jun 2018, 20:41
by Hans4
Perryg wrote:It works for me. That's how I knew it makes the *.vbox file really ugly. It puts the icon code in the top of the file. IIRC this needs to be done while the main manager and probably the VBoxSVC is stopped, or at least the manage and svc needs to be reset to show the actual change.
custom icon.png
  • First, I realize this is a somewhat old post (but not so old that it's not still relevant).
  • The quote above does work for me (running VirtualBox 5.2.12 on Fedora 28) WITHIN the VirtualBox Manager - only.
  • However, I don't typically launch the manager and then launch machines. Rather, I have desktop shortcuts that launch my machines directly. And for which I've made my own sets of cool little icons, so I know which machine is which. These icons appear great in my menus and for my desktop shortcuts.
  • The problem: upon actually launching the machine, the VirtualBox executable goes and stomps on the icon used when launched with the lovely little virtual box logo. This makes it really cumbersome to quickly determine which minimized window in the app tray happens to correspond to which machine I'm looking for!
    • So, why does the executable have to override the icon that it was launched with (perhaps that's a multi-platform coding issue)?
    • But, in any such case, why doesn't it just use the appropriately scaled icon provided with the virtual machine (especially since it knows I started the machine with --startvm)?
    • I'd also happily provide a switch (say, --noicon) or even an iconfile to the 'VirtualBox --startvm' command, if for some reason it couldn't just use (or scale) the icon provided with the vm.

Re: Custom icons for virtual machines

Posted: 15. Jun 2018, 19:15
by socratis
Hans4 wrote:... the VirtualBox executable goes and stomps on the icon ...
... why does the executable have to override the icon ...
... why doesn't it just use the appropriately scaled icon
All of your questions have the same answer: that's your OS doing that, not VirtualBox. Your OS takes the executable icon from the executable. Unless your icon is a resource within the app, or defined somewhere that the OS knows about it, the answer is like the one above. And mind you, you can't have an icon per instance, which is what you're looking for.

Have you tried it with other applications? If so, do you have an example that's working?