Table of Contents
The arc instruction adds the specified arc subpath to the existing path, creating a new path if no path exists. The path created can be modified further by other path-type instructions, and finally stroked, filled, and/or closed.
layer
The layer which should have the specified arc subpath added.
x
The X coordinate of the center of the circle containing the arc to be drawn.
y
The Y coordinate of the center of the circle containing the arc to be drawn.
radius
The radius of the circle containing the arc to be drawn, in pixels.
start
The starting angle of the arc to be drawn, in radians.
end
The ending angle of the arc to be drawn, in radians.
negative
Non-zero if the arc should be drawn from START to END in order of decreasing angle, zero otherwise.
Fills the current path with the specified color. This instruction completes the current path. Future path instructions will begin a new path.
mask
The channel mask to apply when filling the current path in the specified layer.
layer
The layer whose path should be filled.
r
The red component of the color to use to fill the current path in the specified layer.
g
The green component of the color to use to fill the current path in the specified layer.
b
The blue component of the color to use to fill the current path in the specified layer.
a
The alpha component of the color to use to fill the current path in the specified layer.
Applies the current path as the clipping path. Future operations will only draw within the current path. Note that future clip instructions will also be limited by this path. To set a completely new clipping path, you must first reset the layer with a reset instruction. If you wish to only reset the clipping path, but preserve the current transform matrix, push the layer state before setting the clipping path, and pop the layer state to reset.
layer
The layer whose clipping path should be set.
Closes the current path by connecting the start and end points with a straight line.
layer
The layer whose path should be closed.
Copies image data from the specified rectangle of the specified layer or buffer to a different location of another specified layer or buffer.
srclayer
The index of the layer to copy image data from.
srcx
The X coordinate of the upper-left corner of the source rectangle within the source layer.
srcy
The Y coordinate of the upper-left corner of the source rectangle within the source layer.
srcwidth
The width of the source rectangle within the source layer.
srcheight
The height of the source rectangle within the source layer.
mask
The channel mask to apply when drawing the image data on the destination layer.
dstlayer
The index of the layer to draw the image data to.
dstx
The X coordinate of the upper-left corner of the destination within the destination layer.
dsty
The Y coordinate of the upper-left corner of the destination within the destination layer.
Strokes the current path with the specified color. This instruction completes the current path. Future path instructions will begin a new path.
mask
The channel mask to apply when stroking the current path in the specified layer.
layer
The layer whose path should be stroked.
cap
The index of the line cap style to use. This can be either butt (0), round (1), or square (2).
join
The index of the line join style to use. This can be either bevel (0), miter (1), or round (2).
thickness
The thickness of the stroke to draw, in pixels.
r
The red component of the color to use to stroke the current path in the specified layer.
g
The green component of the color to use to stroke the current path in the specified layer.
b
The blue component of the color to use to stroke the current path in the specified layer.
a
The alpha component of the color to use to stroke the current path in the specified layer.
Sets the client's cursor to the image data from the specified rectangle of a layer, with the specified hotspot.
x
The X coordinate of the cursor's hotspot.
y
The Y coordinate of the cursor's hotspot.
srclayer
The index of the layer to copy image data from.
srcx
The X coordinate of the upper-left corner of the source rectangle within the source layer.
srcy
The Y coordinate of the upper-left corner of the source rectangle within the source layer.
srcwidth
The width of the source rectangle within the source layer.
srcheight
The height of the source rectangle within the source layer.
Adds the specified cubic bezier curve subpath.
layer
The layer which should have the specified curve subpath added.
cp1x
The X coordinate of the first control point of the curve.
cp1y
The Y coordinate of the first control point of the curve.
cp2x
The X coordinate of the second control point of the curve.
cp2y
The Y coordinate of the second control point of the curve.
x
The X coordinate of the endpoint of the curve.
y
The Y coordinate of the endpoint of the curve.
Removes the specified layer. The specified layer will be recreated as a new layer if it is referenced again.
layer
The layer to remove.
Sets the given affine transformation matrix to the layer. Unlike transform, this operation is independent of any previously sent transformation matrix. This operation can be undone by setting the layer's transformation matrix to the identity matrix using distort
layer
The layer to distort.
a
The matrix value in row 1, column 1.
b
The matrix value in row 2, column 1.
c
The matrix value in row 1, column 2.
d
The matrix value in row 2, column 2.
e
The matrix value in row 1, column 3.
f
The matrix value in row 2, column 3.
Resets the transform matrix of the specified layer to the identity matrix.
layer
The layer whose transform matrix should be reset.
Fills the current path with a tiled pattern of the image data from the specified layer. This instruction completes the current path. Future path instructions will begin a new path.
mask
The channel mask to apply when filling the current path in the specified layer.
layer
The layer whose path should be filled.
srclayer
The layer to use as the pattern.
Adds the specified line subpath.
layer
The layer which should have the specified line subpath added.
x
The X coordinate of the endpoint of the line.
y
The Y coordinate of the endpoint of the line.
Strokes the current path with a tiled pattern of the image data from the specified layer. This instruction completes the current path. Future path instructions will begin a new path.
mask
The channel mask to apply when filling the current path in the specified layer.
layer
The layer whose path should be filled.
cap
The index of the line cap style to use. This can be either butt (0), round (1), or square (2).
join
The index of the line join style to use. This can be either bevel (0), miter (1), or round (2).
thickness
The thickness of the stroke to draw, in pixels.
srclayer
The layer to use as the pattern.
Moves the given layer to the given location within the specified parent layer. This operation is applicable only to layers, and cannot be applied to buffers (layers with negative indices). Applying this operation to the default layer (layer 0) also has no effect.
layer
The layer to move.
parent
The layer that should be the parent of the given layer.
x
The X coordinate to move the layer to.
y
The Y coordinate to move the layer to.
z
The relative Z-ordering of this layer. Layers with larger values will appear above layers with smaller values.
Loads PNG data into the specified location of the specified layer or buffer.
mask
The channel mask to apply when drawing the image data.
layer
The destination layer.
x
The X coordinate of the upper-left corner of the destination within the destination layer.
y
The Y coordinate of the upper-left corner of the destination within the destination layer.
data
Base64-encoded PNG data.
Restores the previous state of the specified layer from the stack. The state restored includes the transformation matrix and clipping path.
layer
The layer whose state should be restored.
Saves the current state of the specified layer to the stack. The state saved includes the current transformation matrix and clipping path.
layer
The layer whose state should be saved.
Adds a rectangular path to the specified layer.
mask
The channel mask to apply when drawing the image data.
layer
The destination layer.
x
The X coordinate of the upper-left corner of the rectangle to draw.
y
The Y coordinate of the upper-left corner of the rectangle to draw.
width
The width of the rectangle to draw.
height
The width of the rectangle to draw.
Sets the given client-side property to the specified value. Currently there is only one property: miter-limit, the maximum distance between the inner and outer points of a miter joint, proportional to stroke width (if miter-limit is set to 10.0, the default, then the maximum distance between the points of the joint is 10 times the stroke width).
layer
The layer whose property should be set.
property
The name of the property to set.
value
The value to set the given property to.
Sets the opacity of the given layer.
layer
The layer whose opacity should be set.
opacity
The opacity of the layer, where 0 is completely transparent, and 255 is completely opaque.
Sets the size of the specified layer.
layer
The layer to resize.
width
The new width of the layer
height
The new height of the layer
Starts a new subpath at the specified point.
layer
The layer which should start a new subpath.
x
The X coordinate of the first point of the new subpath.
y
The Y coordinate of the first point of the new subpath.
Transfers image data from the specified rectangle of the specified layer or buffer to a different location of another specified layer or buffer, using the specified transfer function. For a list of available functions, see [[http://guac-dev.org/trac/browser/libguac/include/protocol.h|guacamole/protocol.h.
srclayer
The index of the layer to transfer image data from.
srcx
The X coordinate of the upper-left corner of the source rectangle within the source layer.
srcy
The Y coordinate of the upper-left corner of the source rectangle within the source layer.
srcwidth
The width of the source rectangle within the source layer.
srcheight
The height of the source rectangle within the source layer.
function
The index of the transfer function to use. For a list of available functions, see [[http://guac-dev.org/trac/browser/libguac/include/protocol.h|guacamole/protocol.h.
dstlayer
The index of the layer to draw the image data to.
dstx
The X coordinate of the upper-left corner of the destination within the destination layer.
dsty
The Y coordinate of the upper-left corner of the destination within the destination layer.
Applies the specified transformation matrix to future operations. Unlike distort, this operation is dependent on any previously sent transformation matrices, and only affects future operations. This operation can be undone by setting the layer's transformation matrix to the identity matrix using identity, but image data already drawn will not be affected.
layer
The layer to apply the given transformation matrix to.
a
The matrix value in row 1, column 1.
b
The matrix value in row 2, column 1.
c
The matrix value in row 1, column 2.
d
The matrix value in row 2, column 2.
e
The matrix value in row 1, column 3.
f
The matrix value in row 2, column 3.
The ack instruction acknowledges a received data blob, providing a status code and message
indicating whether the operation associated with the blob succeeded or failed. A status code
other than SUCCESS
implicitly ends the stream.
stream
The index of the stream the corresponding blob was received on.
message
A human-readable error message. This typically is not exposed within any user interface, and mainly helps with debugging.
status
The Guacamole status code denoting success or failure.
Several Guacamole instructions, and various other internals of the Guacamole core, use a common set of numeric status codes. These codes denote success or failure of operations, and can be rendered by user interfaces in a human-readable way.
Code | Name | Description |
---|---|---|
0 | SUCCESS |
The operation succeeded. No error. |
256 | UNSUPPORTED |
The requested operation is unsupported. |
512 | SERVER_ERROR |
An internal error occurred, and the operation could not be performed. |
513 | SERVER_BUSY |
The operation could not be performed because the server is busy. |
514 | UPSTREAM_TIMEOUT |
The upstream server is not responding. In most cases, the upstream server is the remote desktop server. |
515 | UPSTREAM_ERROR |
The upstream server encountered an error. In most cases, the upstream server is the remote desktop server. |
516 | RESOURCE_NOT_FOUND |
An associated resource, such as a file or stream, could not be found, and thus the operation failed. |
517 | RESOURCE_CONFLICT |
A resource is already in use or locked, preventing the requested operation. |
768 | CLIENT_BAD_REQUEST |
The parameters of the request are illegal or otherwise invalid. |
769 | CLIENT_UNAUTHORIZED |
Permission was denied, because the user is not logged in. Note that the user may be logged into Guacamole, but still not logged in with respect to the remote desktop server. |
771 | CLIENT_FORBIDDEN |
Permission was denied, and logging in will not solve the problem. |
776 | CLIENT_TIMEOUT |
The client (usually the user of Guacamole or their browser) is taking too long to respond. |
781 | CLIENT_OVERRUN |
The client has sent more data than the protocol allows. |
783 | CLIENT_BAD_TYPE |
The client has sent data of an unexpected or illegal type. |
797 | CLIENT_TOO_MANY |
The client is already using too many resources. Existing resources must be freed before further requests are allowed. |
Allocates a new stream, associating it with the given audio metadata. Audio data will later be sent along the stream with blob instructions. The mimetype given must be a mimetype previously specified by the client during the handshake procedure, and the duration of the audio must be known ahead of time.
stream
The index of the stream to allocate.
channel
The index of the audio channel to use. All audio chunks within the same channel play sequentially, while audio chunks in separate channels play in parallel. This is not the same as the left or right audio channel, and refers only to a channel to which audio data is streamed, where that audio data consists of chunks that may themselves consist of multiple channels in the usual sense of the word. This number is completely arbitrary, and denotes only how audio data should be scheduled for playback.
mimetype
The mimetype of the audio data being sent.
duration
The duration of the audio data being sent, in milliseconds. This value may be a decimal, and need not be expressed in whole milliseconds. This is particularly important for audio formats that do not encode their own durations losslessly (MP3, for example), as well as for scheduling playback of future chunks within the same channel.
Sends a blob of data along the given stream. This blob of data is arbitrary, base64-encoded data, and only has meaning to the Guacamole client or server through the metadata assigned to the stream when the stream was allocated.
stream
The index of the stream along which the given data should be sent.
data
The base64-encoded data to send.
The end instruction terminates an open stream, freeing any client-side or server-side resources. Data sent to a terminated stream will be ignored. Terminating a stream with the end instruction only denotes the end of the stream and does not imply an error.
stream
The index of the stream the corresponding blob was received on.
Allocates a new stream, associating it with the given arbitrary file metadata. The contents of the file will later be sent along the stream with blob instructions. The full size of the file need not be known ahead of time.
stream
The index of the stream to allocate.
mimetype
The mimetype of the file being sent.
filename
The name of the file, as it would be saved on a filesystem.
Encodes part of one or more instructions within a single instruction, associating that packet of data with a stream index. Future nest instructions with the same stream index will append their data to the same logical stream on the client side. Once nested data is received on the client side, the client immediately executes any completed instructions within the associated stream, in order.
index
The index of the stream this data should be appended to. This index is completely arbitrary, and denotes only how nested data should be reassembled.
data
The protocol data, containing part of one or more instructions.
Allocates a new stream, associating it with the given arbitrary named pipe metadata. The contents of the pipe will later be sent along the stream with blob instructions. Pipes in the Guacamole protocol are unidirectional, named pipes, very similar to a UNIX FIFO or pipe. It is up to client-side code to handle pipe data appropriately, likely based upon the name of the pipe, which is arbitrary. Pipes may be opened by either the client or the server.
stream
The index of the stream to allocate.
mimetype
The mimetype of the data being sent along the pipe.
name
The arbitrary name of the pipe, which may have special meaning to client-side code.
Allocates a new stream, associating it with the given video metadata. Video data will later be sent along the stream with blob instructions. The mimetype given must be a mimetype previously specified by the client during the handshake procedure, and the duration of the audio must be known ahead of time.
stream
The index of the stream to allocate.
layer
The index of the layer to stream the video data into. Future drawing operations into this layer will block until the video has finished playing. Playback of this video will not block operations in other layers.
mimetype
The mimetype of the video data being sent.
duration
The duration of the video data being sent, in milliseconds. This value may be a decimal, and need not be expressed in whole milliseconds.
Specifies which audio mimetypes are supported by the client. Each parameter must be a single mimetype, listed in order of client preference, with the optimal mimetype being the first parameter. This is the third instruction sent during the handshake phase.
Begins the connection using the previously specified protocol with the given arguments. This is the last instruction sent during the handshake phase.
The parameters of this instruction correspond exactly to the parameters of the received args instruction. If the received args instruction has, for example, three parameters, the responding connect instruction must also have three parameters.
Requests that the connection be made using the specified protocol. This is the first instruction sent during the handshake phase.
protocol
The protocol to use.
Reports the expected format of the argument list for the protocol requested by the client. This message can be sent by the server during the handshake phase only.
The parameters of the args instruction are the names of all parameters accepted by the server for the protocol in selected by the client, in order. The client's responding connect instruction must the values of each of these parameters in the same order.
Notifies the server that the connection is about to be closed by the client. This message can be sent by the client during any phase, and takes no parameters.
Reports that all operations as of the given server-relative timestamp have been completed. If a sync is received from the server, the client must respond with a corresponding sync once all previous operations have been completed, or the server may stop sending updates until the client catches up. For the client, sending a sync with a timestamp newer than any timestamp received from the server is an error.
Both client and server are expected to occasionally send sync to report on current operation execution state.
timestamp
A valid server-relative timestamp.
Notifies the client that the connection is about to be closed due to the specified error. This message can be sent by the server during any phase.
text
An arbitrary message describing the error
status
The Guacamole status code describing the error. For a list of status codes, see the table in the section called “Status codes”.
The log instruction sends an arbitrary string for debugging purposes. This instruction will be ignored by Guacamole clients, but can be seen in protocol dumps if such dumps become necessary. Sending a log instruction can help add context when searching for the cause of a fault in protocol support.
message
An arbitrary, human-readable message.
The nop instruction does absolutely nothing, has no parameters, and is universally ignored by Guacamole clients. Its main use is as a keep-alive signal, and may be sent by guacd or client plugins when there is no activity to ensure the socket is not closed due to timeout.
The ready instruction sends the ID of a new connection and marks the beginning of the interactive phase of a new, successful connection. The ID sent is a completely arbitrary string, and has no standard format. It must be unique from all existing and future connections and may not match the name of any installed protocol support.
ID
An arbitrary, unique identifier for the current connection. This identifier must be unique from all existing and future connections, and may not match the name of any installed protocol support (such as "vnc" or "rdp").
Indicates that the given timestamp is the current timestamp as of all previous operations. The client must respond to every sync instruction received.
Both client and server are expected to occasionally send sync to report on current operation execution state.
timestamp
A valid server-relative timestamp.
Sends the specified key press or release event.
keysym
The X11 keysym of the key being pressed or released.
pressed
0 if the key is not pressed, 1 if the key is pressed.