Skip to content

Run virtual RISC-V on QEMU emulator

Fedora released a new cloud image in January for RISC-V, and it can be run as a virtual machine on the QEMU emulator. The system is relatively straightforward to set up, and it allows enthusiasts and developers who do not have the hardware to experiment and test RISC-V on a virtual machine.

Run RISC-V on Fedora

Fedora have an excellent guide on the steps to getting RISC-V emulation running on Fedora, using Libvirt/QEMU hypervisors. Fedora RISC-V guide.

It is important to note that the steps here will give you a headless system that does not have a graphical user interface. For this reason, 4096MB of ram and four cores as listed in the guide is probably a little overkill for a headless cloud init based server. Depending on your use case, this could easily be reduced.

Once set up, the initial boot is a little slow, more like the boot up time on an older system with a mechanical hard drive. Subsequent boots are quicker. You can log into the system with:

username - fedora
password - linux
Then you can run dnf upgrade to upgrade your system. When you run dnf list you will get a list of installed programs on the system. Interestingly, text editors such as vi and nano are here.

I tried to install neofetch but it was not available in the repo. I quickly realized that given the experimental nature of the project, the number of programs available is limited. But the system is usable, and it is something I will explore further. Other server images from Ubuntu, Debian, OpenSuse and Arch are also available.

I ran ip a and the system returned an ip address of 192.168.124.231, which is the default network of Libvirt.

To view/edit the config file, run the following command:

virsh net-edit default
This will show that the default dhcp range for the network is 192.168.124.1 to 192.168.124.254. So all makes sense. I was able to ping other devices on my LAN. Programs such as git are also not yet available in the fedora repos.

I used the old school groff text processor to output a test PDF file, and then realised that popular viewers such as evince and zathura are not available in the Fedora repos. I'm sure this will change though as the technology advances, and it becomes more widely adopted. RVVM is a virtual machine emulator that allows you run virtual machine with graphical user interfaces, and this is something I will test soon. Watch this space!