Import a Virtualbox VM

TrueNAS Scale Version: 25.04.2.4

I wasn’t able to find an answer in the docs or on this forum. Is it possible to import and existing VM into TrueNAS Scale? I have a .vbox and .vdi file that were created in some version of Virtualbox that I’d like to host on TrueNAS. I guess I’d need to convert it first, or maybe export it from Virtualbox into an .ova file, but I’m not sure what next steps would be.

Can somebody point me to a primer on this?

Edit: I posed this question to AI and its response seems plausible to me. I’d appreciate if somebody can look this over for a sanity check and tell me if you agree.

Yes — you can import VirtualBox VMs into TrueNAS SCALE 25.04, but it requires converting the VirtualBox disk(s) and attaching them to a SCALE VM. Common workflow:

1. Convert VirtualBox disk to a raw image:
   - On the VirtualBox host: 
     ```
     VBoxManage clonehd --format raw path/to/disk.vdi path/to/disk.raw
     ```
   - Or export to VMDK and convert with qemu-img if you prefer:
     ```
     qemu-img convert -O raw disk.vmdk disk.raw
     ```

2. Transfer the raw image to SCALE:
   - Copy the .raw into a dataset (e.g., /mnt/pool/dataset/) via scp/rsync/samba or upload via the UI.

3. Write the raw image to a zvol (recommended) or add as a file-backed disk:
   - Create a zvol (Storage → ZVOLs).
   - From SCALE shell:
     ```
     dd if=/mnt/pool/dataset/disk.raw of=/dev/zvol/pool/dataset-zvol status=progress bs=4M
     ```
   - (Or use `zfs receive`/`send` if appropriate.)

4. Create a VM in TrueNAS SCALE (Virtualization → VMs):
   - Use matching CPU/firmware (BIOS/UEFI) and disk controller (AHCI often works; VirtIO may need guest drivers).
   - Add the existing zvol as the VM disk (Devices → Add → choose ZVOL).
   - Configure NIC (VirtIO is fine if guest has drivers) and other devices.

5. Guest adjustments (common fixes if it won't boot):
   - Ensure correct boot firmware (UEFI vs BIOS/CSM) matching the original VM.
   - If Linux: enable a serial console or install virtio drivers before migration.
   - If Windows: install VirtIO storage/network drivers (use an ISO) or use AHCI initially, then switch to VirtIO after driver install.
   - Verify disk bus (AHCI vs VirtIO) and correct disk order.

6. Boot and troubleshoot:
   - Use SCALE Serial Shell or VNC to view console.
   - If black screen or kernel panic, try alternate disk mode, change firmware type, or boot from a rescue ISO to repair fstab/GRUB.

Notes and tips:
- Converting to and using a zvol is the most common reliable method.
- Keep the original VirtualBox VM until migration succeeds.
- File-backed raw images (not written to a zvol) can work but are slower and less integrated.
- TrueNAS SCALE docs and community threads contain many distro-specific tips; search “VirtualBox to TrueNAS SCALE migrate VM” if you hit a problem.

If you want, tell me the guest OS and whether you have the disk as .vdi/.vmdk so I can give exact commands and recommended VM settings.

25.10 adds an option to import an image (qcow2, qed, raw, vdi, vhdx, vmdk) to a zvol while creating a VM.

It’s mentioned in the RC.1 release notes, but we don’t have detailed docs on the option just yet: 25.10 (Goldeye) Version Notes | TrueNAS Documentation Hub

That sounds like a good feature.