Using the Virtual Filesystem

Introduction

ownCloud offers the possibility for users to enable a virtual file system (VFS) when synchronizing data. This has the big advantage that all files and folders are visible to the client, but the files are not downloaded until the user requests to do so. Here are some of the key benefits:

  • Full access to files and folders without having to download them all first

  • Selectively sync folders and files based on user requirements

  • Optimize space usage on the client

The quote below gives you a brief overview of what a virtual file system is about.

A virtual file system (VFS) or virtual filesystem switch is an abstract layer on top of a more concrete file system. The purpose of a VFS is to allow client applications to access different types of concrete file systems in a uniform way. A VFS can, for example, be used to access local and network storage devices transparently without the client application noticing the difference. It can be used to bridge the differences in Windows, classic Mac OS/macOS and Unix filesystems, so that applications can access files on local file systems of those types without having to know what type of file system they are accessing.

— https://en.wikipedia.org/wiki/Virtual_file_system

Microsoft VFS Implementation

Background

A sync engine is a service that syncs files, typically between a remote host and a local client. Sync engines on Windows often present those files to the user through the Windows file system and File Explorer.

— https://docs.microsoft.com/en-us/windows/win32/cfapi/build-a-cloud-file-sync-engine
Files can exist in three states:
Full pinned file

The file has been hydrated explicitly by the user through File Explorer and is guaranteed to be available offline.

Full file

The file has been hydrated implicitly and could be dehydrated by the system if space is needed.

Placeholder file

An empty representation of the file and only available if the sync service is available.

The following image demonstrates how the full pinned, full and placeholder file states are shown in File Explorer.

File States

Limitations and Restrictions

Limitations

A virtual file system needs a root folder all synchronization items will be stored in. The following locations are not allowed as synchronization root:

  • The root of a disk like D:\

  • A non-NTFS Filesystem

  • Mounted network shares

  • Symbolic links or junction points

  • Assigned drives

Restrictions

Similar to OneDrive as it also uses Microsoft’s virtual file system, there are some additional restrictions which should be considered like the maximum file size, invalid file or folder names, etc. See the Restrictions and limitations in OneDrive and SharePoint for more information.

ownCloud VFS Implementation

New Sync with VFS enabled

To set up a new synchronization with virtual file system enabled, perform the following steps:

  1. Add a new synchronization by clicking the + Add account button.

    Add Account

  2. Enter the server address and your credentials in the following dialogs.

  3. Select the radio button Use virtual files and set the local folder where your synchronization data will reside.

    Set the Sync Type

  4. When everything is done, you should see a similar screen as below, showing that the setup completed successfully.

    Setup Successful

  5. After the first sync, your synchronization folder will show your items with the Placeholder icon.

    Setup Successful Explorer

  6. When opening a file, the file gets downloaded and its synchronization icon changes to Full.

Convert Full Sync to VFS

If you have full synchronization enabled, you can change to a virtual file system at any time.

  1. Open your existing synchronization, click the …​ button and Enable virtual file support.

    Convert Full to VFS

  2. Your local files will get replaced by placeholders, thus freeing up the space previously occupied.

Convert VFS to Full Sync

You can also change the synchronization setting from virtual file system to full sync.

  1. Open your existing synchronization, click the …​ button and Disable virtual file support.

    Disable VFS 1

  2. A notification window will ask you to confirm before completing the conversion.

    Disable VFS 2

  3. When done, your files will be fully downloaded, which you can tell by the sync icons, see the example image below. Depending on the quantity and size of the files, this may take a while.

    Full Snyc No VFS

Manage VFS from ownCloud

You can manage the synchronization for all files and folders via ownCloud. This can be beneficial if you e.g. want all files to be downloaded (pinned) without you having to open every single one, or if you want to free up all space at once.

Make All Files Full Pinned

  1. Open your existing synchronization, click the …​ button and Availability  Make always available locally.

    Make Iteams always Available

  2. When opening the Explorer, you will see that all files get the sync icon Free Up Space Icon.

    Free Up Space Done

  3. The icon will change to Full Pinned when downloaded. Make Iteams always Available Start Sync

Make All Files Placeholders

You can free up space by unpinning all files at once and making them placeholders with only a view clicks.

  1. Open your existing synchronization, click the …​ button and Availability  Free up local space.

    Free Up Space

  2. When done, Explorer will show the files in Placeholder state.

    Setup Successful Explorer

Manage VFS from Windows Explorer

You can manage individual files in the Explorer window by right-clicking on them. This opens a drop-down menu of actions that can be performed on a specific file.

Create a Local Copy of a File

  1. To create a Full Pinned file (have a local copy of it), use the action Always keep on this device.

    Always keep on this Device

    The state of the file will change to synchronizing.

    Always keep on this Device Syncing

    When the local copy has been created, the state (icon) changes to Full Pinned.

    Always keep on this Device Syned

Free up Space of a File

  1. To free up the space the file occupied, use the action Free up space.

    Free Up Space

  2. When done, Explorer will show the file in Placeholder state.

    Setup Successful Explorer