- setup a ubuntu 21.4 desktop box in VMware/VirtualBox with minimum setup chosen.
- follow instructions here https://pdos.csail.mit.edu/6.828/2020/tools.html
You do not need to apply the hack of qemu on ubuntu 21.4
engineer@vm-ubuntu:~$ sudo apt-get install git build-essential gdb-multiarch qemu-system-misc gcc-riscv64-linux-gnu binutils-riscv64-linux-gnu
engineer@vm-ubuntu:~$ riscv64-linux-gnu-gcc --version