What is the best version of Linux to install and work with this issue in VirtualBox? I am going to create Buildroot for Raspberry 3 and 4.
Sorry, I can't help with buildroot - when I did this I wrote a custom build script, partly because with the likes of buildroot (and, especially, crosstool) if you hit a strange problem it can often take more effort to sort it out than to have done your own from the start.
Having said that, a quick google suggests that this page may be of use:
https://jenda.hrach.eu/w/rpi-gcc
I had already read about the compiler, an old version is kept in Raspbian for compatibility with Raspberry pi 1, but I was not convinced by the solution.
So I tried again with VirtualBox, and again problems, it installed well, also without problems to configure everything, but when trying to Start it gave me an error, I tried to solve it, but it could not be. I already activated virtualization in the BIOS because before it did not allow me to install 64bit versions, only 32bit and with problems.
So I looked for a Debian version for ARM, not Raspbian, there is a Debian ARM that does have the GCC compiler updated to the latest version. It has also been somewhat complicated because there are enough differences with Raspbian to configure the IP, SSH and WIFI, but finally I managed to start it, and again I started to compile buildroot in the Raspberry pi4.
And there is now the Raspberry pi 4 with Debian compiling buildroot, to see if there is luck and it does not give errors.
The truth is that it is a nightmare, I found three options, and two of them gave me an error, and the third was being very complicated:
1.- PC with Virtualbox and Linux Debian
2.- Raspberry pi 4 with Raspbian
3.- Raspberry pi 4 with Debian 10.
If all fail, then I will order a new SSD disk for my PC to install a Linux version.