I have some problems with my Ekos, in fact I can no longer see the "gain" option of the CCD Simulator. Therefore I want to remove indi libraries and kstars and reinstall them.
Is there a way to fix it without doing that?
If no, what commands should I write in the terminal of Ubuntu? (I had lots of problems in the first time when I installed them)
I never used Kstars on a virtual machine, but Wouter (wvreeven) uses it on a Mac as well. He would be able to give more qualified advice.
Generally, I would suggest using an RPi4 running Ubuntu MATE 20.04. I have the best experience with that constellation. Painless since I went from Ubuntu 18.04 to 20.04. Run everything on the Pi4, control it via VNC from inside the house. Just works.
I used to run KStars on a VirtualBox VM on Mac about two years ago but really haven't since (apart from occasionally compiling KStars and INDI myself and even that I don't do in a VM anymore). Apart from removing all KStars and INDI libraries and binaries I'd advice you to also remove the .indi and .local/share/kstars directories since they hold all configuration for INDI and KStars respectively.
Having said that, why not simply install KStars for Mac and run it directly without a VM?
I installed Indi/KStars on a Ubuntu 20.04 VM (VMware Fusion) on Mac OS Catalina a month or two ago.
According to my notes, this is what I did, starting from a pretty fresh 20.04 Ubuntu installation:
Only thought is to see if ~/.indi/CCD_Simulator_config.xml file syntax seems to be intact and includes something like:
<newNumberVector device="CCD Simulator" name="CCD_GAIN">
<oneNumber name="GAIN">
50
</oneNumber>
</newNumberVector>