Skip to main content

Importing the Nextcloud AIO OVA into Proxmox

·955 words·5 mins
Babak Farrokhi
Author
Babak Farrokhi
Engineering and Technical Operations Leader

Nextcloud All-in-One ships as a VirtualBox OVA. Getting it to work in Proxmox needs some extra work, beyond a simple import using qm importovf. You will immediately run in an error like this:

import failed - unable to parse value of 'memory' - format error

The file format is correct (or it depends on how you look at it). The failure is due to some outdated assumption that Proxmox holds.

The OVA file is a VirtualBox export (despite all the VMWare references in the file, and VMDK disk format), and VirtualBox writes the OVF 2.0 envelope namespace (http://schemas.dmtf.org/ovf/envelope/2). Unfortunately Proxmox only understands 1.0 (.../envelope/1) and uses that that for its XPath queries. Without getting too much into the weeds, that is why many of the lookup fails, and memory reads back empty, and the empty value fails validation. Hence the misleading error.

The same also applies to the storage settings: It is written as an OVF 2.0 <StorageItem>, and Proxmox only recognizes an <Item> with rasd:ResourceType=17.

I did not try to patch the shipped file. I replaced it with a small OVF 1.0 descriptor that contains the same configuration, but in the dialect that Proxmox can understand.

This will help you to import the VM into proxmox.

Before you start
#

You need a root shell on the Proxmox host, a target storage (something like local-lvm or local-zfs), and a free VMID.

An important and misleading thing about the disk is that it is provisioned at 1 TiB but holds about 1.8 GB of real data. On ZFS, thin LVM, or qcow2 it stays sparse and uses the space that it needs, so do not be intimidated if you see the disk is showing 1TB during the import.

1. Get the OVA onto the host
#

Copy the OVA file to your proxmox host:

scp Nextcloud-AIO.ova root@proxmox:/var/lib/vz/template/

Or download the official image directly:

cd /var/lib/vz/template/
wget https://download.nextcloud.com/aio-vm/Nextcloud-AIO.ova

2. Extract the archive
#

An OVA is a tar. Unpack it:

cd /var/lib/vz/template/
tar xvf Nextcloud-AIO.ova

You end up with Nextcloud-AIO.ovf, Nextcloud-AIO-disk001.vmdk, and a manifest, Nextcloud-AIO.mf.

3. Replace the descriptor
#

Grab the corrected descriptor and drop it next to the VMDK as Nextcloud-AIO-fixed.ovf:

Download Nextcloud-AIO-fixed.ovf

It is short XML, so read and adjust it if you like. It has the same configuration as the original OVF: 4 vCPU, 4096 MB, one disk, with the disk as a proper rasd item. I declared its controller as SCSI (ResourceType 6), which Proxmox maps to its scsi bus, so the disk is configured as scsi0. There is also a vmw:Config firmware hint set to efi. The Proxmox GUI import reads that to preselect UEFI, but the qm importovf CLI ignores it, so I set the firmware manually in step 5.

You can ignore the .mf manifest, or delete it.

4. Import
#

qm importovf <vmid> Nextcloud-AIO-fixed.ovf <storage>

For example:

qm importovf 200 Nextcloud-AIO-fixed.ovf local-zfs

The progress bar crawls through transferred 1.0 TiB of 1.0 TiB. If you are on a sparse storage, it will only take less than 2GB of disk space.

5. Configure the VM
#

When importing from CLI, its defaults to SeaBIOS. However the virtual appliance was installed under UEFI, so SeaBIOS finds nothing to boot and hangs on a black screen right after Booting from Hard Disk.... That one had me a few minutes of staring, until I figured nothing is happening. Give it OVMF and an EFI disk, along with the rest of the hardware, in one go:

qm set <vmid> \
  --bios ovmf \
  --efidisk0 <storage>:1,efitype=4m,pre-enrolled-keys=0 \
  --scsihw virtio-scsi-pci \
  --net0 virtio,bridge=vmbr0 \
  --boot order=scsi0 \
  --ostype l26 \
  --agent enabled=1

Make sure you replace the <vmid> and <storage> with the correct values.

Confirm with qm config <vmid> that you have a bios: ovmf line and the disk on scsi0, then start it. OVMF usually finds the bootloader on its own through the \EFI\BOOT\BOOTX64.EFI fallback. If it dumps you at the OVMF menu, open Boot Manager, pick the disk once, and it sorts itself out.

6. Fix the network on first boot
#

The VM boots and has no address. This one is a bit trickier. During the build time, cloud-init wrote a netplan and assumed a specific NIC name it saw under VirtualBox, enp0s3, and then the image disabled cloud-init with a marker file, freezing that config in place. On Proxmox the virtio NIC shows up as ens18.

To fix this, you need to log in on the console and look:

ip addr show ens18

If it says state DOWN with no address, add a netplan that matches on a pattern instead of a hardcoded name:

sudo tee /etc/netplan/60-dhcp.yaml >/dev/null <<'EOF'
network:
  version: 2
  ethernets:
    lan:
      match:
        name: "en*"
      dhcp4: true
EOF
sudo chmod 600 /etc/netplan/60-dhcp.yaml
sudo netplan apply

en* catches ens18 and whatever it might be renamed to later. You may want to remove the unused 50-cloud-init.yaml, or simply leave it there since cloud-init is disabled by default on that virtual appliance.

For a static address, swap dhcp4: true for the usual addresses, routes, and nameservers under the lan device.

7. Reach the web interface
#

Check that the interface finally has an address:

ip addr show ens18

Then open https://your-nextcloud-ip-address:8080, accept the self-signed cert, and you are at the AIO setup page. Make sure you use the IP address. AIO throws HSTS on 8080, and if you reach it by name once, the browser will refuse to connect using IP address later.

If you would rather not log in to find the address, take the NIC’s MAC from the net0 line of qm config <vmid> and look it up in your router’s DHCP leases. Or, once the guest agent is running, ask Proxmox directly with qm guest cmd <vmid> network-get-interfaces.