C and C++ Engineer | Linux & Unix Expert with embedded & Linux Kernel development experience

Ágatha Isabelle's personal and professional website

Using virtiofsd to Setup the rootfs of an ArchLinux Virtual Machine for Linux Kernel Testing

Tutorial on how to use virtiofsd to setup an ArchLinux system without having a separate disk for easier testing of the Linux Kernel. This way you can easily share files between host and guest and do some easier management tricks.

Sometimes you want to have a comfortable testing environment for your own home-based personal contributions to the Linux Kernel. I haven't done any of those in quite some time, for lack of time, and my laptop's disk is kinda full, my SSD hardware failed a while ago, so I decided to use my "development server" (an old machine I bought for using in embedded development, where I would connect electronic devices projected by myself therefore I needed it to avoid ruining my USB ports - and yeah, compiling a kernel there is painful).

But why using virtiofsd? Well, there are several advantages in my opinion, but the main one is that it's quite comfortable since you have the guest filesystem accessible within the host. You can easily install, for instance, kernel modules from within the host while running the VM, for instance, among several other use cases. I used to have a shell script for that in the past, but I managed to lose it, probably from the old SSD that failed.

There are some disadvantages as well, like running a complete standard system like this for kernel testing is way too disk consuming compared to using those small images generated with tools like buildroot using i.e. `busybox` to have a system. But you gain all the flexibility of using a regular system that you are used to, so the convenience pays off IMHO.

3 weeks ago