Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagebash
vclsystem ALL= NOPASSWD: /usr/local/bin/add_iptables_client.sh,/usr/local/bin/del_iptables_client.sh


Management Node Patch

The DataStructure.pm file needs to be patched to add OS information to it. Create a patch file named guacamole_DataStructure.patch with the following content in it:


Code Block
languageperl
titleguacamole_DataStructure.patch
linenumberstrue
diff --git managementnode/lib/VCL/DataStructure.pm managementnode/lib/VCL/DataStructure.pm
index 8ffe9a2..238e164 100644
--- managementnode/lib/VCL/DataStructure.pm
+++ managementnode/lib/VCL/DataStructure.pm
@@ -2342,6 +2342,7 @@ sub get_reservation_info_json_string {
        $json_data->{reservation}               = prune_hash_child_references($request_data_clone->{reservation}{$reservation_id});
        $json_data->{imagerevision}     = prune_hash_child_references($request_data_clone->{reservation}{$reservation_id}{imagerevision});
        $json_data->{image}                             = prune_hash_child_references($request_data_clone->{reservation}{$reservation_id}{image});
+       $json_data->{OS}              = prune_hash_child_references($request_data_clone->{reservation}{$reservation_id}{image}{OS});
        $json_data->{computer}                  = prune_hash_child_references($request_data_clone->{reservation}{$reservation_id}{computer});
 
        if (defined($request_data_clone->{reservation}{$reservation_id}{computer}{vmhost})) {
@@ -2349,10 +2350,15 @@ sub get_reservation_info_json_string {
                $json_data->{vmhost_computer}   = prune_hash_child_references($request_data_clone->{reservation}{$reservation_id}{computer}{vmhost}{computer});
        }
 
-       # TODO: figure out how to handle user info, what structure, etc
        #$json_data->{users}                            = $request_data_clone->{reservation}{$reservation_id}{users};
-       #$json_data->{user} = $request_data_clone->{user};
-       #$json_data->{user}{username} = $json_data->{user}{unityid};
+       $json_data->{user}              = prune_hash_child_references($request_data_clone->{user});
+       $json_data->{user}{username}    = $json_data->{user}{unityid};
+       $json_data->{user}{affiliation} = $request_data_clone->{user}{affiliation}{name};
+
+       my @delete_keys = ('IMtypeid', 'sshpublickeys', 'showallgroups', 'validated', 'usepublickeys', 'RETRIEVAL_TIME', 'lastupdated', 'FEDERATED_LINUX_AUTHENTICATION', 'IMid', 'ROOTACCESS');
+       foreach my $key (@delete_keys) {
+               delete $json_data->{user}{$key};
+       }
 
        # IMPORTANT: delete vmprofile data and anything else that may contain passwords
        #delete $json_data->{computer}{vmhost}{vmprofile};

After creating the patch, cd to /usr/local/vcl and apply the patch with the following command (assuming the patch is in /tmp):

patch -p1 < /tmp/guacamole_DataStructure.patch

You should see output similar to:

patching file lib/VCL/DataStructure.pm
Hunk #1 succeeded at 2303 (offset -39 lines).
Hunk #2 succeeded at 2311 (offset -39 lines).

Restart vcld after applying the patch.

Management Node Scripts

There are three hook scripts that need to be added to the management node so that connections are added/removed on the Guacamole server as reservations are created and deleted. All of the scripts are located under /usr/local/vcl/tools/ManagementNode/Scripts. Ensure to set the IP address for your Guacamole server in place of 10.10.10.10 for $guacServerIP.

...