7.33. VBoxManage sharedfolder add/remove

VBoxManage sharedfolder     add <uuid|vmname>
                                --name <name> --hostpath <hostpath>
                                [--transient] [--readonly] [--automount]

This command enables you to share folders on the host computer with guest operating systems. For this, the guest systems must have a version of the Oracle VM VirtualBox Guest Additions installed which supports this functionality.

Parameters are as follows:

  • <uuid|vmname>: Specifies the UUID or name of the VM whose guest operating system will be sharing folders with the host computer. Mandatory.

  • --name <name>: Specifies the name of the share. Each share has a unique name within the namespace of the host operating system. Mandatory.

  • -hostpath <hostpath>: Specifies the absolute path on the host operating system of the directory to be shared with the guest operating system. Mandatory.

  • -transient: Specifies that the share is transient, meaning that it can be added and removed at runtime and does not persist after the VM has stopped. Optional.

  • -readonly: Specifies that the share has only read-only access to files at the host path.

    By default, shared folders have read/write access to the files on the host path. On Linux distributions, shared folders are mounted with 770 file permissions with root user and vboxsf as the group. Using this option the file permissions change to 700. Optional.

  • -automount: Specifies that the share will be automatically mounted. On Linux distributions, this will be to either /media/USER/sf_<name> or /media/sf_<name>, where <name> is the share named. The actual location depends on the guest OS. Optional.

VBoxManage sharedfolder     remove <uuid|vmname>
                            --name <name> [--transient]

This command enables you to delete shared folders on the host computer shares with the guest operating systems. For this, the guest systems must have a version of the Oracle VM VirtualBox Guest Additions installed which supports this functionality.

Parameters are as follows:

  • <uuid|vmname>: Specifies the UUID or name of the VM whose guest operating system is sharing folders with the host computer. Mandatory.

  • --name <name>: Specifies the name of the share to be removed. Each share has a unique name within the namespace of the host operating system. Mandatory.

  • -transient: Specifies that the share is transient, meaning that it can be added and removed at runtime and does not persist after the VM has stopped. Optional.

Shared folders are described in Section 4.3, “Shared Folders”.