Two years ago [1], I wrote about running your TrueNAS VMs from the boot pool by manually updating the virsh configuration. The problem here, however, was that you had to repeat these steps each time you rebooted the VM as TrueNAS would reset the configuration. Also, it wasn't 100% reliable and the commands might need a few attempts to work.
Since then, two of my readers, John and Michael, reached out to me to tell me about a better solution they both (independently) discovered: Editing the TrueNAS database instead of manipulating the virsh service configuration.
WARNING! Just as last time, this guide is definitely not how TrueNAS is intended to be used. It may be better than my last approach, but it's still dirty. You may brick your installation (even if you followed this guide perfectly), or even worse, lose your VMs and data. Only do this if you can live with losing everything and having to reconfigure your entire system.
-- I'll probably regret this when I finally lose my data
I've been meaning to transfer my Raspberry Pi based services into a virtual machine on my main server running TrueNAS for a while now, but I've always delayed as I didn't know where to store the VM's disk. I have 7 disks in my main server: 2x 128 GB SSDs as the boot array, 4x 4 TB HDDs as the main array, and another single 4 TB HDD for less important data.
Basically, I don't care where I store the VM, but I want my HDDs to spin down during the night and low load periods. Since a VM will definitely keep the drives up, the mechanical drives are out, leaving me only with the boot pool. It has enough storage for what I need, but, and here comes the problem, TrueNAS does not allow me to keep custom datasets on the boot pool.
But, under the hood, TrueNAS is just FreeBSD. So as I had some time over the holidays, I set out to find a solution to do it nonetheless.
→ UPDATE: There is an updated, much more reliable version of this guide based on editing the database [1]. I strongly recommend to use that instead. ←
WARNING! This guide is definitely not how TrueNAS is intended to be used. It's dirty and terrible. If you brick your installation (even if you followed this guide perfectly), or even worse, lose your VMs and data, don't tell me I didn't warn you. Only do this if you can live with losing everything and having to reconfigure your entire system.
Please note that, by enabling this video, data is transferred to YouTube LLC, and is subject to their privacy policy.
In this video I will show you one of the recent upgrades to my file server I have at home.
It had a cheap power supply and the original fans in there and I finally decided to invest the money and change them in the hope of better temperatures and longer lifespan for the entire system.