@Override
	public void unmountSharedFolder(VirtualMachine virtualMachine, String shareName, 
			String hostPath, String guestPath)
			throws Exception {

		if (status(virtualMachine) == VirtualMachineStatus.POWERED_OFF) {
			throw new Exception("Unable to unmount shared folder. Machine is not started.");
		}

		String password = virtualMachine.getProperty(VirtualMachineConstants.GUEST_PASSWORD);
		String user = virtualMachine.getProperty(VirtualMachineConstants.GUEST_USER);

		if (HypervisorUtils.isWindowsGuest(virtualMachine)) {

			//TODO unmount for Windows guest

		} else if (HypervisorUtils.isLinuxGuest(virtualMachine)) {

			File unmountFile = File.createTempFile("unmount-", ".sh");
			String unmountScriptFilePath = "/tmp/" + unmountFile.getName();
			
			FileWriter unmountFileWriter = new FileWriter(unmountFile);
			unmountFileWriter.write(
					"sudo umount " + guestPath + "; " +
							"rm " + unmountScriptFilePath);
			unmountFileWriter.close();

			try {

				ProcessBuilder copyUnmountScriptBuilder = getProcessBuilder(
						"guestcontrol " + virtualMachine.getName() +  
						" copyto \"" + unmountFile.getCanonicalPath() + "\" /tmp/" + 
						" --username " + user + " --password " + password);
				ExecutionResult executionResult = HypervisorUtils.runProcess(
						copyUnmountScriptBuilder);

				if (executionResult.getReturnValue() != ExecutionResult.OK && 
						!executionResult.getStdErr().toString().contains(VBoxStrategy.COPY_ERROR)) {
					//We are checking if COPY_ERROR was sent because of a bug where the copy is done
					//properly although it still spawns this error message with exit value different than 0
					throw new Exception(executionResult.getStdErr().toString());
				}

				HypervisorUtils.checkReturnValue(
						exec(virtualMachine, "/bin/bash " + unmountScriptFilePath));

			} finally {
				unmountFile.delete();
			}

		} else {
			throw new Exception("Guest OS not supported");
		}

	}