2023-01-25 06:36 AM
Roughly 10 years ago, my experience using VirtualBox, with the development stuff running in it, and trying to debug, ... well the bottom line was basically "doesn't work".
While common, widely used & supported USB devices such as mouse and keyboard HIDs connected to the host machine have been working well within the VBox guest (otherwise it would be plenty useless ;) ), more "niche" USB devices such as FTDI, ST-Link or Keil debuggers for STM32, were extremely unreliable or didn't work at all, and our whole team back then couldn't resolve the issues and we gave up on that.
Now, I don't know whether there's anything inherent in the whole setup that makes this problem eternal, or it was just the state of development of VBox and/or the involved operating systems and drivers of back then.
A side note should perhaps be that the host OS back then was Windows (7).
I actually am thinking about using Linux as a host in my new laptop (that is to be carried around only in special situations, not regularly), and putting Windows in a VM for certain use cases. But Linux-on-Linux is also an imaginable scenario. More on that below.
So I'm throwing this question into the community space here ;)
Has this improved? Is STM32 development from within a VM, including debugging the hardware connected to the host computer (ST-link with reliable instruction stepping, variable reads, as well as virtual com port text), feasible now?
Because I have a use scenario where this would make things very practical:
I could have the VirtualMachine, with all the work-related stuff installed, on an external drive, and carry that between work-from-home vs. work-in-office days, plug it in, and just run the VM and everything is fine. While, when at home not working, the rest of the laptop is untouched by work stuff, and vice versa.
Which would be much preferrable to other alternatives, for my personal circumstances.
But I haven't bought anything yet. So if I got a good idea of the state of things today, I can base my planning for the very near future on it.
---
Edit:
Found some things where people had trouble and worked it out.
Here it was USB filters settings in VBox: https://forums.virtualbox.org/viewtopic.php?f=6&t=101416
And here, it worked directly on the laptop, but not the USB connector on the docking station (I noticed myself that ST-Link and USB hubs tend to not be friends)
https://community.st.com/s/question/0D50X0000A4q9RWSQY/stlinkv3-not-recognized
2023-01-25 12:11 PM
If you search the net for search terms like "st-link virtualbox", you will find a lot of similar questions, but also messages that it works without problems or hints that you have to share USB ports (by default = dsbl) or activate the USB EHCI controller in the VM, etc- All in all, it doesn't seem to be a problem with the ST-Link or its drivers, but with Virtualbox and its settings.
However, I have not yet tested this myself in the- Virtualbox, because I can easily take a project that works with relative paths as an archive and debug it on another computer, so that a VM does not bring any significant advantage.
But maybe one of the community users has some more helpful comments?
Regards
/Peter
2023-01-26 01:25 AM
Well it's not _only_ about transporting an isolated MCU project, but everything work-related in one go & cleanly separating it from the rest of the (host OS) machine.
If it's probably only about settings, that sounds at least encouraging.