Running Budgie under RISC-V using QEMU

Here are some notes I made in my adventures trying out Budgie under QEMU RISC-V emulation.

The TL;DR; damn it is slow - you need a really fast PC to make this usable. In reality real hardware is needed.

Install the Ubuntu 22.04 RISC-V server image and install budgie-desktop on it.

I used the following ubuntu discourse as my crib sheet and adapted it:

Ubuntu installation on a RISC-V virtual machine using a server install image and QEMU - RISC-V-docs - Ubuntu Community Hub

On ther ubuntu budgie host, grab the server image :

mkdir riscv
cd riscv

Next unpack it:

gzip -d ubuntu-22.04-live-server-riscv64.img.gz

Create the disk image on which you will install Ubuntu Budgie. 16 GiB should be enough.

dd if=/dev/zero bs=1M of=disk count=1 seek=16383

Next install the essential QEMU packages:

sudo apt-get install qemu-system-misc opensbi u-boot-qemu

Next start the Ubuntu Server RISCV image:

/usr/bin/qemu-system-riscv64 -machine virt -m 4G -smp cpus=2 -nographic \
-bios /usr/lib/riscv64-linux-gnu/opensbi/generic/fw_jump.bin \
-kernel /usr/lib/u-boot/qemu-riscv64_smode/u-boot.bin \
-netdev user,id=net0 \
-device virtio-net-device,netdev=net0 \
-drive file=ubuntu-22.04-live-server-riscv64.img,format=raw,if=virtio \
-drive file=disk,format=raw,if=virtio \
-device virtio-rng-pci -no-reboot

Install with all defaults + openssh-server

After shutdown (can force a qemu shutdown via CTRL-A followed by x)

start the qemu VM using 4 cpus (max 8) via:

/usr/bin/qemu-system-riscv64 -machine virt -m 4G -smp cpus=4 -nographic \
-bios /usr/lib/riscv64-linux-gnu/opensbi/generic/fw_jump.bin \
-kernel /usr/lib/u-boot/qemu-riscv64_smode/u-boot.bin \
-netdev user,id=net0,hostfwd=tcp::5555-:3389,hostfwd=tcp::2222-:22 \
-device virtio-net-device,netdev=net0, \
-drive file=disk,format=raw,if=virtio \
-device virtio-rng-pci

note 3389 is the binding of RDP to host port 5555 so can connect using localhost:5555 for remmina
or use ssh username@localhost -p2222

Final steps - install budgie, cleanup

sudo apt purge -y cloud-init
sudo apt update
sudo apt -y install ubuntu-budgie-desktop gnome-terminal

choose lightdm for the display server.

For some reason gnome-shell was also installed - so we need to delete this:

sudo apt -y purge gnome-shell gnome-shell-common gdm3 ubuntu-session ubuntu-wallpapers ubuntu-wallpapers-jammy
sudo apt -y autoremove

Next install XRDP

sudo apt install xrdp

finally enable our XRDP config:

sudo /usr/lib/budgie-desktop/arm/ enable
sudo shutdown now

Startup using the qemu command above - connect via RDP using remmina localhost:5555

Use remmina’s full screen mode and click the dynamic resolution update button to ensure the resolution fits your monitor

Enjoy … sort of. It is very very slow running under qemu emulation.

Running individual apps

X11 has the ability to send its contents to a remote host - thus you can run individual RISCV apps and have the graphical display on your Ubuntu Budgie host.

First ssh to your Risc-V vm e.g. ssh username@localhost -p2222

ensure “/etc/ssh/ssh_config” has the following values.

X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes

Restart SSH and exit your session

sudo systemctl restart ssh

Reconnect but this time tell SSH that we are going to port forward

ssh -X username@localhost -p2222

then run your app e.g. gnome-calculator


if all goes well after a while you will see the RISC-V gnome-calculator appearing on your UB host desktop

Using xephr

if you have xephr installed then you can display the entire desktop in a window on your host - you need the X11 forwarding configuration described above to be applied to your RISCV vm

Start Xephr and say it will be displaying on display “10”

Xephyr :10 &
DISPLAY=:10 ssh -Y username@localhost -p2222 budgie-desktop

The second command runs budgie-desktop using that display