[TUTORIAL] How to setup PBS as a VM in Unraid and uses Virtiofs to passthrough shares

Did you manage to solve this problem?
I would guess it has to do with the mover if you are using a cache drive. I would suggest to people using this method to backup to either setup the backup folder for PBS onto an unassigned device (its a backup, so no need to be on array), or if you want redundancy, I have setup cache pools with BTRFS mirrors for doing this kind of thing. The mover tends to break NFS shares as well (which is how I manage many remote backups). So either put directly on the Array (slow as we all know in unRAID), or its own drive/mirror.
 
Thank you for this guide!

for future users using unraid 6.12.6 or newer: follow part one and go to part 2 - step 15 without creating the vm. All the xml configuration is done by default by selecting virtio as the unraid share after creating the VM the first time around.
 
If I already have PBS installed as a VM on my Proxmox node, does it make sense to do all of this (to move PBS from Proxmox to Unraid), rather than just make a new share on Unraid and mount it to the PBS?
 
Thank you for the great tutorial. Any idea how i get past this?
View attachment 66238
Your VM is booting but you have not given it any boot "disk" you need to add the Proxmox Backup Server ISO to your ISO folder and then add it as the #1 boot disk in the vm settings. this should get you to the proxmox setup page, complete wizard.
Then you need to go back to the VM edit page and change boot order again to set the Vdisk as boot #1 and set iso as #2 or just remove the iso from the mount selection.
 
just followed the guide, joined here o say thank you.

currently working and no issues. backing up a test vm in my homelab as i type this message.
 
How does I use the unraid mount from within the proxmox backup server?

Got it to work properly but only lxc snapshots are working, vm backups fail always:

ERROR: VM 100 qmp command 'backup' failed - backup register image failed: command error: ENODEV: No such device
INFO: aborting backup job
INFO: resuming VM again
ERROR: Backup of VM 100 failed - VM 100 qmp command 'backup' failed - backup register image failed: command error: ENODEV: No such device
INFO: Failed at 2024-07-08 17:10:02
INFO: Backup job finished with errors
INFO: notified via target `mail-to-root`
TASK ERROR: job errors

Any tipps?
 
Last edited:
How does I use the unraid mount from within the proxmox backup server?

Got it to work properly but only lxc snapshots are working, vm backups fail always:

ERROR: VM 100 qmp command 'backup' failed - backup register image failed: command error: ENODEV: No such device
INFO: aborting backup job
INFO: resuming VM again
ERROR: Backup of VM 100 failed - VM 100 qmp command 'backup' failed - backup register image failed: command error: ENODEV: No such device
INFO: Failed at 2024-07-08 17:10:02
INFO: Backup job finished with errors
INFO: notified via target `mail-to-root`
TASK ERROR: job errors

Any tipps?
Mine also started to fail some days ago.

Have you updated to Unraid 7.0 Beta? I did and i think issues started from there. Containers working fine, but VMs running into problems.
 
Mine also started to fail some days ago.

Have you updated to Unraid 7.0 Beta? I did and i think issues started from there. Containers working fine, but VMs running into problems.
Yep, I already updated to Unraid 7.0 Beta and startet from there. Switched to the docker Container from the App Store in Unraid an its working as expected.
 
Yep, I already updated to Unraid 7.0 Beta and startet from there. Switched to the docker Container from the App Store in Unraid an its working as expected.


Where you able to use your existing backup storage or have you started from scratch?
 
Where you able to use your existing backup storage or have you started from scratch?
I just started with setting up an PBS, so I had not really build up an important backup store, so it was easy for me to just try the docker version.
 
First of all: this guide worked great!
Posting a problem that spontaniously appeared days ago + my solution below so others can benefit.

---

My setup somehow started to fail some days ago. It appears to be on the PBS end: it does not see "pbs" as a directory.
Running Unraid 6.12.11 and BPS (Proxmox Backup Server) 3.2-4 ..

If you see one of these problems:

A. In PVE (Proxmox Virtual Engine) a backup fails with this error in the log:

Code:
INFO: creating Proxmox Backup Server archive 'vm/102/2024-08-08T05:00:28Z'
INFO: starting kvm to execute backup task
ERROR: VM 102 qmp command 'backup' failed - backup connect failed: command error: unable to create backup group "/mnt/backup_proxmox/pbs/vm/102" - Not a directory (os error 20)
INFO: aborting backup job

B. In PBS (Proxmox Backup Server) a backup fails with this error in the log:

Code:
INFO: backup mode: snapshot
INFO: ionice priority: 7
INFO: creating Proxmox Backup Server archive 'vm/102/2024-08-08T05:00:48Z'
INFO: issuing guest-agent 'fs-freeze' command
INFO: issuing guest-agent 'fs-thaw' command
ERROR: VM 105 qmp command 'backup' failed - backup connect failed: command error: unable to create backup group "/mnt/backup_proxmox/pbs/vm/102" - Not a directory (os error 20)
INFO: aborting backup job

C. On PBS console, the folder is apparently not recognized as a folder anymore:

Code:
root@pbs:/mnt/backup_proxmox/pbs# ls
ls: cannot open directory '.': Not a directory

D. As a result of the above, in PVE (or PBS) the webinterface can show an error 400/500 when navigating the Storage/Backups screens.

Try these steps:
  • On PVE > datacenter > Storage remove and add the PBS storage.
  • On PVE > datacenter > Backups edit and re-select this PBS storage.
  • Reboot both PBS and PVE.
These steps allowed me to trigger manual backup jobs in PVE.
I found that other systems (or the NAS/Unraid itself) can browse this folder without problems, so thats why I expect the problem to be in the VM or BPS itself.

Cause unknown to me:

No settings have not been altered, the backup just stopped working days ago. Might be after I updated PVE/PBS packages ..?
Insights welcome.
 
Last edited:
I'm struggling with step 16. I keep getting an error:
mount: /mnt/backup_proxmox: wrong fs type, bad option, bad superblock on backup_proxmox_virtiofs, missing codepage or helper program, or other error.
dmesg(1) may have more information after failed mount system call.
Just wanted to share my experience with installing Promox Backup Server as a VM in Unraid as I encountered some problems that I wasn't able to find any answers on the internet.

My setup is a baremetal Unraid 6.11.5, another baremetal Proxmox VE, with a HP Aruba Instant On 1930 8G 2SFP Switch (JL680A) in between them.
  1. Go to VMs tab in your Unraid dashboard, then click the "Add VM" button.
  2. Then, in my case, I selected Debian as the OS.
  3. I left most options as it is other than the following:
    • Initial memory: 4096 MB (this is the value I got from PBS site, but you may set it to more or less base on your use case)
    • OS Install ISO: Point this to the location of your ISO. (The ISO path is set in Unraid dashboard -> Settings -> VM Manager -> Default ISO storage path)
    • Primary vDisk Size: 32G (again, this is the value I got from PBS site)
    • Unraid Share Mode: Choose 9p mode for now so that you can save. (IMPORTANT: You'll need to set this to Virtiofs mode after creating the VM)
    • Unraid Share/Unraid Source Path: Choose the share that you want to use to store the backups, or type in the path manually.
    • Unraid Mount Tag: This is just a String to identify your source path in the VM. If you have chosen a share in "Unraid Share", then this is populated automatically. Else, you can just type in some easily identifiable name for your source path.
  4. Uncheck "Start VM after creation".
  5. Click the "Create" button.
  6. My VM setup at a glance.
  7. For more details for VM setup, you can visit the following links:
  1. If you have followed the steps above to install PBS as a VM, or you have an existing PBS VM, then you can proceed.
  2. Make sure your PBS VM is not running, then edit your VM.
  3. Click the toggle at the top right of the page to show "XML view".
  4. From my screenshot above, you should see that there is a red circle around the memoryBacking block. You'll need to change your VM settings as shown in my screenshot for Virtiofs to work. You can refer to libvirt's "Sharing files with Virtiofs" page for more info.
    • XML:
        <memoryBacking>
          <source type='memfd'/>
          <access mode='shared'/>
        </memoryBacking>
  5. Now, click the "Update" button to save the changes.
  6. Repeat step 2 to edit your VM. Ensure your page is in "Form view" instead of "XML view".
  7. Now, we can go to change our Unraid Share Mode to Virtiofs Mode. You can also add more Virtiofs shares at this point.
  8. Now, click the "Update" button again to save your changes.
  9. Repeat step 2 to edit your VM again. Ensure your page is in "XML view" instead of "Form view".
  10. Look for filesystemin your VM's XML, you should see something like this:
  11. For my case, although I'm able to access the share in PBS like this, but for some reason, both CT and VM failed to backup. So, I did the following change and it works for me:
    • XML:
          <filesystem type='mount' accessmode='passthrough'>
            <driver type='virtiofs' queue='1024'/>
            <binary path='/usr/libexec/virtiofsd' xattr='on'>
              <cache mode='always'/>
              <sandbox mode='chroot'/>
              /// remove this line <lock posix='on' flock='on'>
            </binary>
            <source dir='/mnt/user/backup_proxmox'/>
            <target dir='backup_proxmox_virtiofs'/>
            <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> /// don't replace this line in your XML with mine
          </filesystem>
  12. Click the "Update" button again to save your changes, and we are done. (Do note that if you update your VM settings again in the future in "Form view", the changes made to the filesystem in "XML view" may get overwritten, and so, you'll need to perform step 11 again)
  13. Start your VM! (If this is your first startup, then complete your PBS installation first)
  14. Go to your PBS dashboard, then navigate to Administration -> Shell page.
  15. Create a directory so that we can mount the share that we passthrough from Unraid. In my case, I created the following directory: mkdir /mnt/backup_proxmox.
  16. Now we can mount our share to the directory that was created previously with the following line: mount -t virtiofs backup_proxmox_virtiofs /mnt/backup_proxmox
    • Note that you should change my backup_promox_virtiofs to the value that you have configured as the tag/target dir in your VM setting.
    • Note that you should change my /mnt/backup_proxmox to the directory that you have created for your share.
  17. Once you are done mounting, check if you can create and read files from your share.
  18. If you are able to do that, then type the following in your shell: cat /etc/mtab. You should be able to see a line that corresponds to your mounts. In my case, it is backup_proxmox_virtiofs /mnt/backup_proxmox virtiofs rw,relatime 0 0
  19. If you would like to have your share mounted automatically on start, then copy the line(s) from what you have found in step 18 in /etc/mtab and paste them into /etc/fstab. In my case, it looks like this:
  20. Restart PBS and try to check again to see if your share is mounted automatically.
  21. If everything is ok, you can now add a datastore in your share. In my case, it looks like this:
  22. Once the datastore is created, you can now try to backup your CT, VM, or whatever you like to Unraid with PBS!

Hope it helps whoever that is struggling with this!
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!