User avatar
Posts: 1634
Joined: Thu Jan 17, 2019 9:47 pm
Location: Texas! :)
Contact: Website

Need Testers: vdesktop VM runs any RPi OS with OpenGL graphics!

Tue Oct 13, 2020 2:02 am

Many of you advanced users have heard of, or even used, my vdesktop script. It uses systemd-nspawn and a few other tricks to 'boot' a RaspiOS .img file as a graphical virtual machine.
You'd be able to interact with the GUI desktop of the container, and make changes to the img before flashing it to a SD card.

Usage is quite straightforward:

Code: Select all

sudo /home/pi/vdesktop/vdesktop /home/pi/2020-08-20-raspios-buster-armhf.img
Anyway, a problem that's plagued vdesktop is the lack of HW-acceleration support (explains why chromium, firefox, and other graphical apps would crash constantly)
Recently, I received several generous donations amounting to $175 for vdesktop's development, so I decided to revisit the issue.
Found a brilliant genius guy out there called krishenriksen who said he could fix it for me. We went back and forth on github and later Discord to iron everything out. At the end, I sent him a good amount of cash for his help.

That being said: Vdesktop is now hardware accelerated!
Chromium works, Firefox works, a lot of stuff works now, and I've added graphics support for xfce4 RPi OS'es.
Don't go download vdesktop from my github repository - I haven't updated it yet. Before pushing all these changes, I need some beta users willing to give it a try.

This hardware acceleration works by running a virgl server on the host, then connecting to it from the guest. Now the guest "sees" a virtual GPU and uses it for HW-accelerated rendering via llvmpipe. The result is fully accelerated graphics within the Xephyr window.
Now since each pixel has to be rendered through two nested X servers, this is not as fast as doing the same thing in the host X server. But heavy web-browsing is completely doable, even watching Youtube videos. (and yes, sound works out of the box)

Here's the Google Drive link to the zipped folder: ... sp=sharing
Just extract it to /home/pi. (so the full path would be /home/pi/vdesktop.)
Usage is similar to the normal version, but with an added bind-mount directory (rootmount), a modified version of systemd-nspawn, and the added lines of code necessary to compile virgl and run it.
You also have some environment variables you can set to change settings:
UMOUNT_ON_EXIT: yes/no. Default is 'yes'
VDESKTOP_USER: anything you want. Default is 'pi'
VDESKTOP_PASS: anything you want. Default is 'raspberry'
VDESKTOP_MOUNTPOINT: any location you want. Default is /media/pi/vdesktop
VDESKTOP_ENABLE_ROOT_MOUNT: yes/no. Default is 'yes'
VDESKTOP_ENABLE_VIRGL: yes/no. Default is yes if booting in GUI mode, default is no if booting in cli or cli-login mode.
Example usage for environment vars:

Code: Select all

export VDESKTOP_USER=kali
export VDESKTOP_PASS=kali
sudo -E ./vdesktop/vdesktop /home/pi/kali-linux-2020.3a-rpi3-nexmon.img
Or you could do it as a one-liner:

Code: Select all

sudo VDESKTOP_USER=kali VDESKTOP_PASS=kali ./vdesktop/vdesktop /home/pi/kali-linux-2020.3a-rpi3-nexmon.img
Have fun!
Please report back on this thread how it went. My goal is to have vdesktop boot any RPi OS from any RPi OS.
Want to run Minecraft Java on your RPi? Easiest way is with Pi-Apps - just click Install.
Pi-Apps also includes Zoom, Visual Studio, Tor browser, Windows 10 theme, and 33 more.
Over 50,000 users!

Return to “Advanced users”