On Mon, Apr 21, 2025 at 10:37 PM Alex_Yin <skyywh2...@163.com> wrote:

>
> Hello! I am trying to connect to Windows using rdp through guacamole, and
> successfully mounted the network drive. But when I used the network drive
> to download something and disconnected the link, the folder created by
> guacd locally was still there. After reading the source code, I found that
> guacd does not delete the created folder after disconnecting the link, and
> there is no parameter to achieve this function. I started guacd through
> docker, and the version used is guacamole 1.5.0.
>
You are correct - there is no such parameter to accomplish this, and the
code does not do it by default. The assumption made in implementing it is
that users and admins would want the storage location to be persistent
across multiple systems and multiple logins. Personally, I use this to
provide persistent storage across the systems that I access from Guacamole
- having it removed each time would be disastrous :-D.

That doesn't make your request or situation invalid - you just have a
different use-case.


> The parameters are as follows: "enable-drive": “true","create-drive-path":
> “true","drive-name": “disk","client-name": “nickname","drive-path":
> "/Users/alex/guacd/disk/"
>
> I desire a solution where the folders generated by guacd are deleted upon
> disconnection. Is there a method to achieve this function?
>

I can think of one way to (sort of) accomplish this without modifications
to the code - if you use the extension that allows for viewing connection
recording history in the web interface (
https://guacamole.apache.org/doc/gug/recording-playback.html), you could
use the ${HISTORY_UUID} token within the drive-path parameter, and, you'd
essentially get a unique folder for each connection. You could then have a
process run once per day to clean up any folder older than 1 day, or
whatever parameters work for you.

That's a sort of round-about way to accomplish it - the more proper way
would be some sort of connection parameter ( "delete-drive": "true") that
would delete it upon disconnect. However, you'd want to carefully consider
all the possible scenarios with this - for example, let's say you have two
RDP connections, RDP1 and RDP2, both pointed at the same folder
("/Users/alex/guacd/disk"). What happens when you disconnect from RDP1 but
RDP2 is still running?? There may be some way that guacd could check for
open handles on that file and delete only if nothing has it open, but
that's adding a decent amount of complexity to that code.

-Nick

Reply via email to